mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Ensure watch history preference actually works.
This commit is contained in:
		
							parent
							
								
									7d4f0109d6
								
							
						
					
					
						commit
						ece47821fb
					
				
					 4 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -36,7 +36,7 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
        (async () => {
 | 
			
		||||
            if (window.db) {
 | 
			
		||||
            if (window.db && this.getPreferenceBoolean("watchHistory", false)) {
 | 
			
		||||
                var tx = window.db.transaction("watch_history", "readonly");
 | 
			
		||||
                var store = tx.objectStore("watch_history");
 | 
			
		||||
                const cursorRequest = store.index("watchedAt").openCursor(null, "prev");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -226,7 +226,7 @@ export default {
 | 
			
		|||
                }
 | 
			
		||||
                videoEl.currentTime = start;
 | 
			
		||||
                this.initialSeekComplete = true;
 | 
			
		||||
            } else if (window.db) {
 | 
			
		||||
            } else if (window.db && this.getPreferenceBoolean("watchHistory", false)) {
 | 
			
		||||
                var tx = window.db.transaction("watch_history", "readonly");
 | 
			
		||||
                var store = tx.objectStore("watch_history");
 | 
			
		||||
                var request = store.get(this.video.id);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -306,7 +306,7 @@ export default {
 | 
			
		|||
            (async () => {
 | 
			
		||||
                const videoId = this.getVideoId();
 | 
			
		||||
                const instance = this;
 | 
			
		||||
                if (window.db && !this.video.error) {
 | 
			
		||||
                if (window.db && this.getPreferenceBoolean("watchHistory", false) && !this.video.error) {
 | 
			
		||||
                    var tx = window.db.transaction("watch_history", "readwrite");
 | 
			
		||||
                    var store = tx.objectStore("watch_history");
 | 
			
		||||
                    var request = store.get(videoId);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -196,7 +196,7 @@ const mixin = {
 | 
			
		|||
                });
 | 
			
		||||
        },
 | 
			
		||||
        async updateWatched(videos) {
 | 
			
		||||
            if (window.db) {
 | 
			
		||||
            if (window.db && this.getPreferenceBoolean("watchHistory", false)) {
 | 
			
		||||
                var tx = window.db.transaction("watch_history", "readonly");
 | 
			
		||||
                var store = tx.objectStore("watch_history");
 | 
			
		||||
                videos.map(async video => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue