Ver Fonte

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

Sv443 há 1 mês atrás
pai
commit
4ca0c6200c
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      src/features/behavior.ts

+ 6 - 0
src/features/behavior.ts

@@ -139,6 +139,12 @@ export async function initRememberSongTime() {
     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);
 
   await remTimeRestoreTime();