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 a08b59e1..998d62a2 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -122,6 +122,11 @@ > + + diff --git a/src/locales/en.json b/src/locales/en.json index 0ca47400..eb73143b 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..31074170 100644 --- a/src/main.js +++ b/src/main.js @@ -144,6 +144,11 @@ const mixin = { var request = store.get(video.url.substr(-11)); request.onsuccess = function (event) { if (event.target.result) { + if (event.target.result.currentTime == 0) { + video.watched = false; + video.currentTime = event.target.result.currentTime; + return; + } video.watched = true; video.currentTime = event.target.result.currentTime; }