mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-14 22:30:28 +05:30
Fix local playlist import
This commit is contained in:
parent
38b2984460
commit
689d43577d
@ -484,13 +484,13 @@ const mixin = {
|
|||||||
if (!this.authenticated) {
|
if (!this.authenticated) {
|
||||||
const playlist = await this.getLocalPlaylist(playlistId);
|
const playlist = await this.getLocalPlaylist(playlistId);
|
||||||
const currentVideoIds = JSON.parse(playlist.videoIds);
|
const currentVideoIds = JSON.parse(playlist.videoIds);
|
||||||
if (currentVideoIds.length == 0) playlist.thumbnail = videoInfos[0].thumbnail;
|
|
||||||
currentVideoIds.push(...videoIds);
|
currentVideoIds.push(...videoIds);
|
||||||
playlist.videoIds = JSON.stringify(currentVideoIds);
|
playlist.videoIds = JSON.stringify(currentVideoIds);
|
||||||
this.createOrUpdateLocalPlaylist(playlist);
|
|
||||||
let streamInfos =
|
let streamInfos =
|
||||||
videoInfos ??
|
videoInfos ??
|
||||||
(await Promise.all(videoIds.map(videoId => this.fetchJson(this.apiUrl() + "/streams/" + videoId))));
|
(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) {
|
for (let i in videoIds) {
|
||||||
this.createLocalPlaylistVideo(videoIds[i], streamInfos[i]);
|
this.createLocalPlaylistVideo(videoIds[i], streamInfos[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user