mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-04-04 14:56:58 +00:00
feat: mark as watched button in feed (#3746)
* feat: add mark as watched/unwatched button * fix: remove from trending page and hide if watch history is diabled remove the button from trending page because it only works in feed page. * fix: missing thumbnail url in watch_history when using mark as watched * fix: missing uploadername in watch_history when using mark as watched * refactor: make mark as watched consistent with other app elements * refactor: simplify setting "watched" property for videos --------- Co-authored-by: Bnyro <bnyro@tutanota.com>
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
|
||||
<LoadingIndicatorPage :show-content="videosStore != null" class="video-grid">
|
||||
<template v-for="video in filteredVideos" :key="video.url">
|
||||
<VideoItem v-if="shouldShowVideo(video)" :is-feed="true" :item="video" />
|
||||
<VideoItem v-if="shouldShowVideo(video)" :is-feed="true" :item="video" @update:watched="onUpdateWatched" />
|
||||
</template>
|
||||
</LoadingIndicatorPage>
|
||||
</template>
|
||||
@@ -140,6 +140,15 @@ export default {
|
||||
this.loadMoreVideos();
|
||||
}
|
||||
},
|
||||
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);
|
||||
},
|
||||
shouldShowVideo(video) {
|
||||
switch (this.selectedFilter.toLowerCase()) {
|
||||
case "shorts":
|
||||
|
||||
Reference in New Issue
Block a user