Clarify download states and make the empty page useful
This commit is contained in:
@@ -45,5 +45,11 @@
|
||||
return () => { alive = false; clearInterval(timer); clearInterval(diskTimer); };
|
||||
} });
|
||||
}
|
||||
const api = { configure, breakdown, bytes }; if (typeof module !== 'undefined') module.exports = api; else root.Downloads = api;
|
||||
function getJobs() { return adapter && typeof adapter.jobs === 'function' ? adapter.jobs() : []; }
|
||||
function action(id, act) { if (adapter && typeof adapter.action === 'function') return adapter.action(id, act); }
|
||||
function getFiles() { return adapter && typeof adapter.files === 'function' ? adapter.files() : Promise.resolve([]); }
|
||||
function getPlaylists() { return adapter && typeof adapter.playlists === 'function' ? adapter.playlists() : []; }
|
||||
function getSlots() { return adapter && typeof adapter.slots === 'function' ? adapter.slots() : 4; }
|
||||
function snapshot() { return { jobs: getJobs(), slots: getSlots(), playlists: getPlaylists() }; }
|
||||
const api = { configure, breakdown, bytes, getJobs, action, getFiles, getPlaylists, getSlots, snapshot }; if (typeof module !== 'undefined') module.exports = api; else root.Downloads = api;
|
||||
})(typeof window !== 'undefined' ? window : globalThis);
|
||||
|
||||
Reference in New Issue
Block a user