mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Update onUpdateWatched to update a subset of videos.
This commit is contained in:
parent
ae460bbcde
commit
c4d3e4a7a2
2 changed files with 10 additions and 4 deletions
|
@ -91,8 +91,14 @@ export default {
|
||||||
this.loadMoreVideos();
|
this.loadMoreVideos();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUpdateWatched() {
|
onUpdateWatched(urls = null) {
|
||||||
|
if (urls === null) {
|
||||||
if (this.videos.length > 0) this.updateWatched(this.videos);
|
if (this.videos.length > 0) this.updateWatched(this.videos);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const subset = this.videos.filter(({ url }) => urls.includes(url));
|
||||||
|
if (subset.length > 0) this.updateWatched(subset);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -206,7 +206,7 @@ export default {
|
||||||
if (this.video.watched) {
|
if (this.video.watched) {
|
||||||
let request = store.delete(videoId);
|
let request = store.delete(videoId);
|
||||||
request.onsuccess = function () {
|
request.onsuccess = function () {
|
||||||
instance.$emit("update:watched");
|
instance.$emit("update:watched", [instance.video.url]);
|
||||||
};
|
};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ export default {
|
||||||
// Save
|
// Save
|
||||||
store.put(video);
|
store.put(video);
|
||||||
// Disappear if hideWatched is on
|
// Disappear if hideWatched is on
|
||||||
instance.$emit("update:watched");
|
instance.$emit("update:watched", [instance.video.url]);
|
||||||
instance.shouldShowVideo();
|
instance.shouldShowVideo();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue