MCPcopy Index your code
hub / github.com/ollm/OpenComic / getStorageSize

Function getStorageSize

scripts/settings.js:28–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28async function getStorageSize()
29{
30 // Cache size
31 let cacheSize = await fileManager.dirSize(cache.folder);
32
33 cacheSize = cacheSize / 1000 / 1000;
34
35 if(cacheSize > 1000)
36 cacheSize = app.round(cacheSize / 1000, 1)+'GB';
37 else
38 cacheSize = app.round(cacheSize, 1)+'MB';
39
40 dom.queryAll('.cacheSize').html(' ('+cacheSize+')');
41
42 // Temp size
43 let tmpSize = await fileManager.dirSize(tempFolder);
44
45 tmpSize = tmpSize / 1000 / 1000;
46
47 if(tmpSize > 1000)
48 tmpSize = app.round(tmpSize / 1000, 1)+'GB';
49 else
50 tmpSize = app.round(tmpSize, 1)+'MB';
51
52 dom.queryAll('.temporaryFilesSize').html(' ('+tmpSize+')');
53}
54
55async function clearCache()
56{

Callers 3

startSecondFunction · 0.85
clearCacheFunction · 0.85
removeTemporaryFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected