Kaynağa Gözat

fix: delete "remember song time" entries with outdated format

Sv443 1 ay önce
ebeveyn
işleme
4ca0c6200c
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 6 0
      src/features/behavior.ts

+ 6 - 0
src/features/behavior.ts

@@ -139,6 +139,12 @@ export async function initRememberSongTime() {
     remVids = [];
     remVids = [];
   }
   }
 
 
+  if(remVids.some(e => "watchID" in e)) {
+    remVids = remVids.filter(e => "id" in e);
+    await GM.setValue("bytm-rem-songs", JSON.stringify(remVids));
+    log(`Removed ${remVids.length} ${autoPlural("entry", remVids)} with an outdated format from the video time cache`);
+  }
+
   log(`Initialized video time restoring with ${remVids.length} initial ${autoPlural("entry", remVids)}:`, remVids);
   log(`Initialized video time restoring with ${remVids.length} initial ${autoPlural("entry", remVids)}:`, remVids);
 
 
   await remTimeRestoreTime();
   await remTimeRestoreTime();