fix: taskList saving individual videos instead of playlist

This commit is contained in:
Jelle Glebbeek
2021-07-03 21:01:44 +02:00
parent bee467b666
commit 77d59f0e08

View File

@@ -305,6 +305,7 @@ class QueryManager {
removeVideo(video) {
this.managedVideos = this.managedVideos.filter(item => item.identifier !== video.identifier);
this.playlistMetadata = this.playlistMetadata.filter(item => item.video_url !== video.url && item.playlist_url !== video.url);
this.window.webContents.send("videoAction", { action: "remove", identifier: video.identifier })
}
@@ -518,10 +519,22 @@ class QueryManager {
getTaskList() {
const urlList = []
const filteredUrlList = [];
for(const video of this.managedVideos) {
urlList.push(video.url)
}
return urlList
for(const video of this.playlistMetadata) {
for(let i = 0; i < urlList.length; i++) {
if(urlList[i] === video.video_url || urlList[i] === video.playlist_url) {
urlList.splice(i, 1);
i--;
filteredUrlList.push(video.playlist_url);
} else {
filteredUrlList.push(urlList[i]);
}
}
}
return [...new Set(filteredUrlList)]
}
loadTaskList(taskList) {