mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-08-16 12:24:40 +00:00
cw ordering fix
This commit is contained in:
parent
837decd9bd
commit
6c06126b68
2 changed files with 12 additions and 2 deletions
|
|
@ -1363,7 +1363,10 @@ class SupabaseSyncService {
|
|||
|
||||
const local = await storageService.getWatchProgress(row.content_id, type, episodeId);
|
||||
const remoteLastWatched = this.normalizeEpochMs(row.last_watched);
|
||||
if (local && Number(local.lastUpdated || 0) >= remoteLastWatched) {
|
||||
// Always pull remote data if local is a placeholder (currentTime=1,duration=1)
|
||||
// to recover from corruption by watched-items sync
|
||||
const isPlaceholder = local && local.currentTime === 1 && local.duration === 1;
|
||||
if (local && !isPlaceholder && Number(local.lastUpdated || 0) >= remoteLastWatched) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -765,6 +765,12 @@ class WatchedService {
|
|||
): Promise<void> {
|
||||
try {
|
||||
if (watched) {
|
||||
// If existing progress has real playback data, don't overwrite with placeholder
|
||||
const existing = await storageService.getWatchProgress(id, type, episodeId);
|
||||
if (existing && existing.currentTime > 1 && existing.duration > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a "completed" progress entry (100% watched)
|
||||
const progress = {
|
||||
currentTime: 1, // Minimal values to indicate completion
|
||||
|
|
@ -775,7 +781,8 @@ class WatchedService {
|
|||
};
|
||||
await storageService.setWatchProgress(id, type, progress, episodeId, {
|
||||
forceWrite: true,
|
||||
forceNotify: true
|
||||
forceNotify: true,
|
||||
preserveTimestamp: true,
|
||||
});
|
||||
|
||||
// Also set the legacy watched flag for movies
|
||||
|
|
|
|||
Loading…
Reference in a new issue