diff --git a/src/components/HistoryPage.vue b/src/components/HistoryPage.vue index 3c650b8e..8b592cb5 100644 --- a/src/components/HistoryPage.vue +++ b/src/components/HistoryPage.vue @@ -54,6 +54,8 @@ export default { duration: video.duration, thumbnail: video.thumbnail, watchedAt: video.watchedAt, + watched: true, + currentTime: video.currentTime, }); if (this.videos.length < 1000) cursor.continue(); } diff --git a/src/components/PlaylistPage.vue b/src/components/PlaylistPage.vue index 26d2c5db..fac2c420 100644 --- a/src/components/PlaylistPage.vue +++ b/src/components/PlaylistPage.vue @@ -106,7 +106,10 @@ export default { async getPlaylistData() { this.fetchPlaylist() .then(data => (this.playlist = data)) - .then(() => this.updateTitle()); + .then(() => { + this.updateTitle(); + this.updateWatched(this.playlist.relatedStreams); + }); }, async updateTitle() { document.title = this.playlist.name + " - Piped"; diff --git a/src/components/PlaylistVideos.vue b/src/components/PlaylistVideos.vue index f8a118e2..b054662b 100644 --- a/src/components/PlaylistVideos.vue +++ b/src/components/PlaylistVideos.vue @@ -32,6 +32,7 @@ export default { }, mounted() { this.updateScroll(); + this.updateWatched(this.playlist.relatedStreams); }, methods: { updateScroll() { diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue index 8e0c38ea..b059cbe9 100644 --- a/src/components/SearchResults.vue +++ b/src/components/SearchResults.vue @@ -72,7 +72,10 @@ export default { }, async updateResults() { document.title = this.$route.query.search_query + " - Piped"; - this.results = this.fetchResults().then(json => (this.results = json)); + this.results = this.fetchResults().then(json => { + this.results = json; + this.updateWatched(this.results.items); + }); }, updateFilter() { this.$router.replace({ diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index 44235b23..bc2e48ba 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -10,13 +10,24 @@ }, }" > - +
+ + +
+
+
+
+
(elem.outerHTML = "\n")); this.video.description = this.rewriteDescription(xmlDoc.querySelector("body").innerHTML); + this.updateWatched(this.video.relatedStreams); } }); }, diff --git a/src/main.js b/src/main.js index e27ff57b..341a24c8 100644 --- a/src/main.js +++ b/src/main.js @@ -213,6 +213,7 @@ const mixin = { request.onsuccess = function (event) { if (event.target.result) { video.watched = true; + video.currentTime = event.target.result.currentTime; } }; });