1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Display number of resources being fetched in side bar

This commit is contained in:
Laurent Cozic
2018-11-13 22:25:23 +00:00
parent 06091933e1
commit e17f3051f0
6 changed files with 45 additions and 3 deletions

View File

@ -37,6 +37,11 @@ class Resource extends BaseItem {
return this.modelSelectAll(sql, [Resource.FETCH_STATUS_IDLE]);
}
static async needToBeFetchedCount() {
const r = await this.db().selectOne('SELECT count(*) as total FROM resource_local_states WHERE fetch_status = ?', [Resource.FETCH_STATUS_IDLE]);
return r ? r['total'] : 0;
}
static fsDriver() {
if (!Resource.fsDriver_) Resource.fsDriver_ = new FsDriverDummy();
return Resource.fsDriver_;