From 689d43577deb1d1f1788c0fdaf60794fdace32cf Mon Sep 17 00:00:00 2001 From: Shiny Nematoda <122038334+snematoda@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:42:11 +0200 Subject: [PATCH] Fix local playlist import --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 65e0277d..138e4602 100644 --- a/src/main.js +++ b/src/main.js @@ -484,13 +484,13 @@ const mixin = { if (!this.authenticated) { const playlist = await this.getLocalPlaylist(playlistId); const currentVideoIds = JSON.parse(playlist.videoIds); - if (currentVideoIds.length == 0) playlist.thumbnail = videoInfos[0].thumbnail; currentVideoIds.push(...videoIds); playlist.videoIds = JSON.stringify(currentVideoIds); - this.createOrUpdateLocalPlaylist(playlist); let streamInfos = videoInfos ?? (await Promise.all(videoIds.map(videoId => this.fetchJson(this.apiUrl() + "/streams/" + videoId)))); + playlist.thumbnail = streamInfos[0].thumbnail || streamInfos[0].thumbnailUrl; + this.createOrUpdateLocalPlaylist(playlist); for (let i in videoIds) { this.createLocalPlaylistVideo(videoIds[i], streamInfos[i]); }