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

Server: Support for notifications and clean up

This commit is contained in:
Laurent Cozic
2020-12-30 18:35:18 +00:00
parent 4128c53fcf
commit d2771029a3
30 changed files with 564 additions and 115 deletions

View File

@@ -313,6 +313,17 @@ class Resource extends BaseItem {
return r ? r.total : 0;
}
static async createdLocallyCount() {
const r = await this.db().selectOne(`
SELECT count(*) as total
FROM resources
WHERE id NOT IN
(SELECT resource_id FROM resource_local_states)
`);
return r ? r.total : 0;
}
static fetchStatusToLabel(status) {
if (status === Resource.FETCH_STATUS_IDLE) return _('Not downloaded');
if (status === Resource.FETCH_STATUS_STARTED) return _('Downloading');