1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

All: Fixes #932: Certain attachments were not being automatically deleted

This commit is contained in:
Laurent Cozic
2021-10-05 17:47:38 +01:00
parent f47478f730
commit 5a9bc1297b
4 changed files with 84 additions and 11 deletions

View File

@@ -603,6 +603,11 @@ export default class BaseItem extends BaseModel {
throw new Error('Unreachable');
}
public static async itemHasBeenSynced(itemId: string): Promise<boolean> {
const r = await this.db().selectOne('SELECT item_id FROM sync_items WHERE item_id = ?', [itemId]);
return !!r;
}
public static async itemsThatNeedSync(syncTarget: number, limit = 100): Promise<ItemsThatNeedSyncResult> {
// Although we keep the master keys in the database, we no longer sync them
const classNames = this.syncItemClassNames().filter(n => n !== 'MasterKey');