Skip to content

Commit

Permalink
🐛 fix: song id conflict
Browse files Browse the repository at this point in the history
Signed-off-by: SimonShiki <[email protected]>
  • Loading branch information
SimonShiki committed Sep 3, 2024
1 parent 0d445dd commit ff0701e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/jotais/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ sharedStore.sub(scannedJotai, () => {

const list: Song<string>[] = [];
const storages = sharedStore.get(storagesJotai);
const idPool: Song<string>['id'][] = [];
for (const storageId in storages) {
const { songList } = storages[storageId];
let { songList } = storages[storageId];
songList = songList.filter((song) => {
if (!idPool.includes(song.id)) {
idPool.push(song.id);
return true;
}
});
list.push(...songList);
}

Expand Down

0 comments on commit ff0701e

Please sign in to comment.