diff --git a/src/components/FeedPage.vue b/src/components/FeedPage.vue index bb8ac13d..35c0888d 100644 --- a/src/components/FeedPage.vue +++ b/src/components/FeedPage.vue @@ -48,7 +48,7 @@ @@ -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": diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index e44c5e06..49f73d80 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -127,6 +127,18 @@ > + diff --git a/src/locales/en.json b/src/locales/en.json index b296c2c5..9c9d505a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -132,6 +132,8 @@ "show_chapters": "Chapters", "store_search_history": "Store Search History", "hide_watched": "Hide watched videos in the feed", + "mark_as_watched": "Mark as Watched", + "mark_as_unwatched": "Mark as Unwatched", "documentation": "Documentation", "status_page": "Status", "source_code": "Source code", diff --git a/src/main.js b/src/main.js index b7d5b187..eff06f92 100644 --- a/src/main.js +++ b/src/main.js @@ -144,7 +144,7 @@ const mixin = { var request = store.get(video.url.substr(-11)); request.onsuccess = function (event) { if (event.target.result) { - video.watched = true; + video.watched = event.target.result.currentTime != 0; video.currentTime = event.target.result.currentTime; } };