mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-04 06:31:55 +00:00 
			
		
		
		
	fix: missing uploadername in watch_history when using mark as watched
This commit is contained in:
		@@ -227,7 +227,6 @@ export default {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        toggleWatched(videoId) {
 | 
					        toggleWatched(videoId) {
 | 
				
			||||||
            if (window.db) {
 | 
					            if (window.db) {
 | 
				
			||||||
                // Should match WatchVideo.vue
 | 
					 | 
				
			||||||
                var tx = window.db.transaction("watch_history", "readwrite");
 | 
					                var tx = window.db.transaction("watch_history", "readwrite");
 | 
				
			||||||
                var store = tx.objectStore("watch_history");
 | 
					                var store = tx.objectStore("watch_history");
 | 
				
			||||||
                var instance = this;
 | 
					                var instance = this;
 | 
				
			||||||
@@ -237,23 +236,19 @@ export default {
 | 
				
			|||||||
                    if (video) {
 | 
					                    if (video) {
 | 
				
			||||||
                        video.watchedAt = Date.now();
 | 
					                        video.watchedAt = Date.now();
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        // Should match WatchVideo.vue
 | 
					 | 
				
			||||||
                        video = {
 | 
					                        video = {
 | 
				
			||||||
                            videoId: videoId,
 | 
					                            videoId: videoId,
 | 
				
			||||||
                            title: instance.item.title,
 | 
					                            title: instance.item.title,
 | 
				
			||||||
                            duration: instance.item.duration,
 | 
					                            duration: instance.item.duration,
 | 
				
			||||||
                            thumbnail: instance.item.thumbnail,
 | 
					                            thumbnail: instance.item.thumbnail,
 | 
				
			||||||
                            uploaderUrl: instance.item.uploaderUrl,
 | 
					                            uploaderUrl: instance.item.uploaderUrl,
 | 
				
			||||||
                            uploaderName: instance.item.uploader,
 | 
					                            uploaderName: instance.item.uploaderName,
 | 
				
			||||||
                            watchedAt: Date.now(),
 | 
					                            watchedAt: Date.now(),
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    // Set time to end for shouldShowVideo
 | 
					 | 
				
			||||||
                    video.currentTime =
 | 
					                    video.currentTime =
 | 
				
			||||||
                        instance.item.currentTime !== instance.item.duration ? instance.item.duration : 0;
 | 
					                        instance.item.currentTime !== instance.item.duration ? instance.item.duration : 0;
 | 
				
			||||||
                    // Save
 | 
					 | 
				
			||||||
                    store.put(video);
 | 
					                    store.put(video);
 | 
				
			||||||
                    // Disappear if hideWatched is on
 | 
					 | 
				
			||||||
                    instance.$emit("update:watched", [instance.item.url]);
 | 
					                    instance.$emit("update:watched", [instance.item.url]);
 | 
				
			||||||
                    instance.shouldShowVideo();
 | 
					                    instance.shouldShowVideo();
 | 
				
			||||||
                };
 | 
					                };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user