summaryrefslogtreecommitdiffhomepage
path: root/src/lib/cache/autoCacheService.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-04-09 20:09:47 +0900
committerAdam Malczewski <[email protected]>2026-04-09 20:09:47 +0900
commitcbf41c0e495367bb3f582ea22aabdc03bd2d046d (patch)
treeca635b706d7d0a5a2430d1010097e27a04003ea4 /src/lib/cache/autoCacheService.ts
parentbafc36cbb2287ecb3b806cb32118a9ee9d5f7170 (diff)
downloadflashair-speedsync-cbf41c0e495367bb3f582ea22aabdc03bd2d046d.tar.gz
flashair-speedsync-cbf41c0e495367bb3f582ea22aabdc03bd2d046d.zip
show caching progress
Diffstat (limited to 'src/lib/cache/autoCacheService.ts')
-rw-r--r--src/lib/cache/autoCacheService.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/cache/autoCacheService.ts b/src/lib/cache/autoCacheService.ts
index 04dc92b..e5a6584 100644
--- a/src/lib/cache/autoCacheService.ts
+++ b/src/lib/cache/autoCacheService.ts
@@ -76,6 +76,21 @@ class AutoCacheService {
return this._progressMap.get(path);
}
+ /** Whether the service is actively caching (running and not finished). */
+ get isActive(): boolean {
+ return this._running && (this._downloading || this._nextIndex < this._images.length);
+ }
+
+ /** Number of images confirmed cached so far. */
+ get cachedCount(): number {
+ return this._cachedPaths.size;
+ }
+
+ /** Total number of images in the work queue. */
+ get totalCount(): number {
+ return this._images.length;
+ }
+
/** Check if a path has been confirmed fully cached. */
isCached(path: string): boolean {
return this._cachedPaths.has(path);