From 67c55426b9e7f7a4fba3c6a26baebf375ab7f62c Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Sat, 4 Mar 2023 08:03:45 +0000 Subject: [PATCH 1/2] replaced filter with some/findLast --- src/components/PlaylistPage.vue | 2 +- src/components/PreferencesPage.vue | 2 +- src/components/VideoPlayer.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/PlaylistPage.vue b/src/components/PlaylistPage.vue index fac2c420..42802c9f 100644 --- a/src/components/PlaylistPage.vue +++ b/src/components/PlaylistPage.vue @@ -88,7 +88,7 @@ export default { }, }).then(json => { 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(); }, diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 65a381f7..060bc427 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -425,7 +425,7 @@ export default { this.fetchJson("https://piped-instances.kavin.rocks/").then(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({ name: "Custom Instance", api_url: this.apiUrl(), diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 5464bac9..0b765342 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -320,7 +320,7 @@ export default { uri = this.video.hls; mime = "application/x-mpegURL"; } 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"; } From b9d5eaba555c1aead52fe33b74ed74ccca41b44f Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Sat, 4 Mar 2023 08:49:53 +0000 Subject: [PATCH 2/2] fix aspect ratio of music_songs --- src/components/VideoItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index bc2e48ba..b5b6474e 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -12,7 +12,7 @@ >