mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	update watched videos in each separate component
This commit is contained in:
		
							parent
							
								
									005a938261
								
							
						
					
					
						commit
						949527ed43
					
				
					 6 changed files with 12 additions and 3 deletions
				
			
		| 
						 | 
					@ -54,6 +54,8 @@ export default {
 | 
				
			||||||
                            duration: video.duration,
 | 
					                            duration: video.duration,
 | 
				
			||||||
                            thumbnail: video.thumbnail,
 | 
					                            thumbnail: video.thumbnail,
 | 
				
			||||||
                            watchedAt: video.watchedAt,
 | 
					                            watchedAt: video.watchedAt,
 | 
				
			||||||
 | 
					                            watched: true,
 | 
				
			||||||
 | 
					                            currentTime: video.currentTime,
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        if (this.videos.length < 1000) cursor.continue();
 | 
					                        if (this.videos.length < 1000) cursor.continue();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -106,7 +106,10 @@ export default {
 | 
				
			||||||
        async getPlaylistData() {
 | 
					        async getPlaylistData() {
 | 
				
			||||||
            this.fetchPlaylist()
 | 
					            this.fetchPlaylist()
 | 
				
			||||||
                .then(data => (this.playlist = data))
 | 
					                .then(data => (this.playlist = data))
 | 
				
			||||||
                .then(() => this.updateTitle());
 | 
					                .then(() => {
 | 
				
			||||||
 | 
					                    this.updateTitle();
 | 
				
			||||||
 | 
					                    this.updateWatched(this.playlist.relatedStreams);
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async updateTitle() {
 | 
					        async updateTitle() {
 | 
				
			||||||
            document.title = this.playlist.name + " - Piped";
 | 
					            document.title = this.playlist.name + " - Piped";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,6 +32,7 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
        this.updateScroll();
 | 
					        this.updateScroll();
 | 
				
			||||||
 | 
					        this.updateWatched(this.playlist.relatedStreams);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
        updateScroll() {
 | 
					        updateScroll() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,7 +72,10 @@ export default {
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async updateResults() {
 | 
					        async updateResults() {
 | 
				
			||||||
            document.title = this.$route.query.search_query + " - Piped";
 | 
					            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() {
 | 
					        updateFilter() {
 | 
				
			||||||
            this.$router.replace({
 | 
					            this.$router.replace({
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,7 +159,6 @@ export default {
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
        this.updateWatched([this.item]);
 | 
					 | 
				
			||||||
        this.shouldShowVideo();
 | 
					        this.shouldShowVideo();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -422,6 +422,7 @@ export default {
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
                        xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
 | 
					                        xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n"));
 | 
				
			||||||
                        this.video.description = this.rewriteDescription(xmlDoc.querySelector("body").innerHTML);
 | 
					                        this.video.description = this.rewriteDescription(xmlDoc.querySelector("body").innerHTML);
 | 
				
			||||||
 | 
					                        this.updateWatched(this.video.relatedStreams);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue