mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-10 09:46:40 +02:00
fix select children
This commit is contained in:
parent
e3f011b724
commit
8e91f57cb3
10
src/itemdb.d
10
src/itemdb.d
|
@ -92,7 +92,7 @@ final class ItemDatabase
|
|||
FROM item
|
||||
WHERE driveId = ?1 AND id = ?2
|
||||
");
|
||||
selectItemByParentIdStmt = db.prepare("SELECT driveId, id FROM item WHERE parentId = ? AND id = ?");
|
||||
selectItemByParentIdStmt = db.prepare("SELECT * FROM item WHERE parentDriveId = ? AND parentId = ?");
|
||||
deleteItemByIdStmt = db.prepare("DELETE FROM item WHERE driveId = ? AND id = ?");
|
||||
}
|
||||
|
||||
|
@ -127,11 +127,9 @@ final class ItemDatabase
|
|||
selectItemByParentIdStmt.bind(2, id);
|
||||
auto res = selectItemByParentIdStmt.exec();
|
||||
Item[] items;
|
||||
foreach (row; res) {
|
||||
Item item;
|
||||
bool found = selectById(row[0], row[1], item);
|
||||
assert(found, "Could not select the child of the item");
|
||||
items ~= item;
|
||||
while (!res.empty) {
|
||||
items ~= buildItem(res);
|
||||
res.step();
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue