mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	replaced filter with some/findLast
This commit is contained in:
		
							parent
							
								
									690031c010
								
							
						
					
					
						commit
						67c55426b9
					
				
					 3 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -88,7 +88,7 @@ export default {
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            }).then(json => {
 | 
					            }).then(json => {
 | 
				
			||||||
                if (json.error) alert(json.error);
 | 
					                if (json.error) alert(json.error);
 | 
				
			||||||
                else if (json.filter(playlist => playlist.id === playlistId).length > 0) this.admin = true;
 | 
					                else if (json.some(playlist => playlist.id === playlistId)) this.admin = true;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        this.isPlaylistBookmarked();
 | 
					        this.isPlaylistBookmarked();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -425,7 +425,7 @@ export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.fetchJson("https://piped-instances.kavin.rocks/").then(resp => {
 | 
					        this.fetchJson("https://piped-instances.kavin.rocks/").then(resp => {
 | 
				
			||||||
            this.instances = resp;
 | 
					            this.instances = resp;
 | 
				
			||||||
            if (this.instances.filter(instance => instance.api_url == this.apiUrl()).length == 0)
 | 
					            if (!this.instances.some(instance => instance.api_url == this.apiUrl()))
 | 
				
			||||||
                this.instances.push({
 | 
					                this.instances.push({
 | 
				
			||||||
                    name: "Custom Instance",
 | 
					                    name: "Custom Instance",
 | 
				
			||||||
                    api_url: this.apiUrl(),
 | 
					                    api_url: this.apiUrl(),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -320,7 +320,7 @@ export default {
 | 
				
			||||||
                uri = this.video.hls;
 | 
					                uri = this.video.hls;
 | 
				
			||||||
                mime = "application/x-mpegURL";
 | 
					                mime = "application/x-mpegURL";
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                uri = this.video.videoStreams.filter(stream => stream.codec == null).slice(-1)[0].url;
 | 
					                uri = this.video.videoStreams.findLast(stream => stream.codec == null).url;
 | 
				
			||||||
                mime = "video/mp4";
 | 
					                mime = "video/mp4";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue