mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Fix removing videos from local playlist
This commit is contained in:
parent
f854af3581
commit
d044accf5e
2 changed files with 3 additions and 3 deletions
|
@ -177,7 +177,7 @@ export default {
|
|||
methods: {
|
||||
removeVideo() {
|
||||
this.$refs.removeButton.disabled = true;
|
||||
this.removeVideoFromPlaylist(this.playlistId, null, this.index).then(json => {
|
||||
this.removeVideoFromPlaylist(this.playlistId, this.index).then(json => {
|
||||
if (json.error) alert(json.error);
|
||||
else this.$emit("remove");
|
||||
});
|
||||
|
|
|
@ -518,11 +518,11 @@ const mixin = {
|
|||
},
|
||||
});
|
||||
},
|
||||
async removeVideoFromPlaylist(playlistId, videoId, index) {
|
||||
async removeVideoFromPlaylist(playlistId, index) {
|
||||
if (!this.authenticated) {
|
||||
const playlist = await this.getLocalPlaylist(playlistId);
|
||||
const videoIds = JSON.parse(playlist.videoIds);
|
||||
videoIds.splice(videoIds.indexOf(videoId), 1);
|
||||
videoIds.splice(index, 1);
|
||||
playlist.videoIds = JSON.stringify(videoIds);
|
||||
if (videoIds.length == 0) playlist.thumbnail = "https://pipedproxy.kavin.rocks/?host=i.ytimg.com";
|
||||
this.createOrUpdateLocalPlaylist(playlist);
|
||||
|
|
Loading…
Reference in a new issue