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();
|
||||
}
|
||||
},
|
||||
onUpdateWatched() {
|
||||
onUpdateWatched(urls = null) {
|
||||
if (urls === null) {
|
||||
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) {
|
||||
let request = store.delete(videoId);
|
||||
request.onsuccess = function () {
|
||||
instance.$emit("update:watched");
|
||||
instance.$emit("update:watched", [instance.video.url]);
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ export default {
|
|||
// Save
|
||||
store.put(video);
|
||||
// Disappear if hideWatched is on
|
||||
instance.$emit("update:watched");
|
||||
instance.$emit("update:watched", [instance.video.url]);
|
||||
instance.shouldShowVideo();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue