소스 검색

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

Sv443 1 개월 전
부모
커밋
4ca0c6200c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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();