mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
better way to check if a JSONValue has a member
This commit is contained in:
parent
2acd00209f
commit
9da9b7240d
11
src/sync.d
11
src/sync.d
|
@ -9,22 +9,17 @@ private long thresholdFileSize = 10 * 2^^20; // 10 Mib
|
||||||
|
|
||||||
private bool isItemFolder(const ref JSONValue item)
|
private bool isItemFolder(const ref JSONValue item)
|
||||||
{
|
{
|
||||||
scope (failure) return false;
|
return (("folder" in item.object) !is null);
|
||||||
JSONValue folder = item["folder"];
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isItemFile(const ref JSONValue item)
|
private bool isItemFile(const ref JSONValue item)
|
||||||
{
|
{
|
||||||
scope (failure) return false;
|
return (("file" in item.object) !is null);
|
||||||
JSONValue folder = item["file"];
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isItemDeleted(const ref JSONValue item)
|
private bool isItemDeleted(const ref JSONValue item)
|
||||||
{
|
{
|
||||||
scope (failure) return false;
|
return (("deleted" in item.object) !is null);
|
||||||
return !item["deleted"].isNull();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool testCrc32(string path, const(char)[] crc32)
|
private bool testCrc32(string path, const(char)[] crc32)
|
||||||
|
|
Loading…
Reference in a new issue