Skip to content

Commit

Permalink
Scanner: refresh maps with missing cache data
Browse files Browse the repository at this point in the history
  • Loading branch information
ibillingsley committed Aug 20, 2023
1 parent 66893f4 commit 03bb762
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libraries/scanner/beatmap/BeatmapScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ export default class BeatmapScanner implements ScannerInterface<BeatmapLocal> {
);
}

// Refresh maps with missing cache data
if (forceUpdate) {
const validCache = BeatsaverCachedLibrary.GetAllValid();
const missing = BeatmapLibrary.GetAllValidMap().filter(
(beatmap) =>
beatmap.hash && !validCache.has(beatmap.hash.toUpperCase())
);
const paths = missing.map((beatmap) => beatmap.folderPath);
BeatmapLibrary.RemoveBeatmapByPaths(paths);
diff.added = diff.added.concat(paths);
}

progress.setTotal(diff.added.length + retryTargetItems.length);

// 追加された曲
Expand Down

0 comments on commit 03bb762

Please sign in to comment.