mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 16:51:57 +00:00
fixed a continue watching bug where removed content won't reappearing even after watching it again
This commit is contained in:
parent
bf22e559c5
commit
8b5a707daa
1 changed files with 70 additions and 55 deletions
|
|
@ -266,6 +266,21 @@ class StorageService {
|
|||
const timestamp = (options?.preserveTimestamp && typeof progress.lastUpdated === 'number')
|
||||
? progress.lastUpdated
|
||||
: Date.now();
|
||||
|
||||
|
||||
try {
|
||||
const removedMap = await this.getContinueWatchingRemoved();
|
||||
const removedKey = this.buildWpKeyString(id, type);
|
||||
const removedAt = removedMap[removedKey];
|
||||
|
||||
if (removedAt != null && timestamp > removedAt) {
|
||||
logger.log(`♻️ [StorageService] restoring content to continue watching due to new progress: ${type}:${id}`);
|
||||
await this.removeContinueWatchingRemoved(id, type);
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore error checks for restoration to prevent blocking save
|
||||
}
|
||||
|
||||
const updated = { ...progress, lastUpdated: timestamp };
|
||||
await mmkvStorage.setItem(key, JSON.stringify(updated));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue