Skip to content

Commit

Permalink
修复第一次进入歌单加载失败的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
qinlili23333 committed Dec 13, 2023
1 parent 8f56e1a commit ca9d778
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ <H3>去全部歌单里添加一些吧</H3>
Hamood.init(hamoodConfig, false);
})();
window.isBiliLite = false;
window.list = [];
const $ = text => {
if (text == '.h5-download-bar') {
window.isBiliLite = true;
Expand Down Expand Up @@ -1648,15 +1649,17 @@ <H3>去全部歌单里添加一些吧</H3>
allSongs = allSongs.concat(folder.list);
});
let newList = [];
window.list.forEach(song => {
let newSong = allSongs.find(s => { return s.name == song.name && s.release_date == song.release_date });
if (!newSong) {
newSong = song;
};
if (song.viewed) { newSong.viewed = song.viewed };
newList.push(newSong);
});
window.list = newList;
if (window.list.length > 0) {
window.list.forEach(song => {
let newSong = allSongs.find(s => { return s.name == song.name && s.release_date == song.release_date });
if (!newSong) {
newSong = song;
};
if (song.viewed) { newSong.viewed = song.viewed };
newList.push(newSong);
});
window.list = newList;
}
localStorage.playList = JSON.stringify(window.list);
renderPlayList();
};
Expand Down

0 comments on commit ca9d778

Please sign in to comment.