mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-13 22:00:28 +05:30
Improve querying and check if 90% of video is watched.
This commit is contained in:
parent
8ae7a36627
commit
6d14103e61
@ -185,14 +185,12 @@ export default {
|
|||||||
if (!this.isFeed || !this.getPreferenceBoolean("hideWatched", false)) return;
|
if (!this.isFeed || !this.getPreferenceBoolean("hideWatched", false)) return;
|
||||||
|
|
||||||
const objectStore = window.db.transaction("watch_history", "readonly").objectStore("watch_history");
|
const objectStore = window.db.transaction("watch_history", "readonly").objectStore("watch_history");
|
||||||
objectStore.openCursor().onsuccess = event => {
|
const request = objectStore.get(this.video.url.substr(-11));
|
||||||
const cursor = event.target.result;
|
request.onsuccess = event => {
|
||||||
if (cursor) {
|
const video = event.target.result;
|
||||||
if (cursor.value.videoId === this.video.url.replace("/watch?v=", "")) {
|
if (video && (video.currentTime ?? 0) > video.duration * 0.9) {
|
||||||
this.showVideo = false;
|
this.showVideo = false;
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
cursor.continue();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user