diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index dd6ba219..e05e3992 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -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"); }); diff --git a/src/main.js b/src/main.js index e6d25c50..22f60614 100644 --- a/src/main.js +++ b/src/main.js @@ -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);