mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-10 13:18:14 -05:00
[web-src] Do not rely on name of playlist for podcast deletion
This commit is contained in:
parent
4b1688ceb8
commit
f2d4b88c12
@ -130,15 +130,14 @@ export default {
|
|||||||
|
|
||||||
open_remove_podcast_dialog: function () {
|
open_remove_podcast_dialog: function () {
|
||||||
this.show_album_details_modal = false
|
this.show_album_details_modal = false
|
||||||
webapi.search({ type: 'playlist', query: this.album.name }).then(({ data }) => {
|
webapi.library_track_playlists(this.tracks[0].id).then(({ data }) => {
|
||||||
var playlists = data.playlists.items.filter(pl => pl.name === this.album.name && pl.type === 'rss')
|
const rssPlaylists = data.items.filter(pl => pl.type === 'rss')
|
||||||
|
if (rssPlaylists.length !== 1) {
|
||||||
if (playlists.length !== 1) {
|
|
||||||
this.$store.dispatch('add_notification', { text: 'Podcast cannot be removed. Probably it was not added as an RSS playlist.', type: 'danger' })
|
this.$store.dispatch('add_notification', { text: 'Podcast cannot be removed. Probably it was not added as an RSS playlist.', type: 'danger' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rss_playlist_to_remove = playlists[0]
|
this.rss_playlist_to_remove = rssPlaylists[0]
|
||||||
this.show_remove_podcast_modal = true
|
this.show_remove_podcast_modal = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -167,16 +167,17 @@ export default {
|
|||||||
|
|
||||||
open_remove_podcast_dialog: function () {
|
open_remove_podcast_dialog: function () {
|
||||||
this.show_album_details_modal = false
|
this.show_album_details_modal = false
|
||||||
webapi.search({ type: 'playlist', query: this.selected_album.name }).then(({ data }) => {
|
webapi.library_album_tracks(this.selected_album.id, { limit: 1 }).then(({ data }) => {
|
||||||
var playlists = data.playlists.items.filter(pl => pl.name === this.selected_album.name && pl.type === 'rss')
|
webapi.library_track_playlists(data.items[0].id).then(({ data }) => {
|
||||||
|
const rssPlaylists = data.items.filter(pl => pl.type === 'rss')
|
||||||
|
if (rssPlaylists.length !== 1) {
|
||||||
|
this.$store.dispatch('add_notification', { text: 'Podcast cannot be removed. Probably it was not added as an RSS playlist.', type: 'danger' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (playlists.length !== 1) {
|
this.rss_playlist_to_remove = rssPlaylists[0]
|
||||||
this.$store.dispatch('add_notification', { text: 'Podcast cannot be removed. Probably it was not added as an RSS playlist.', type: 'danger' })
|
this.show_remove_podcast_modal = true
|
||||||
return
|
})
|
||||||
}
|
|
||||||
|
|
||||||
this.rss_playlist_to_remove = playlists[0]
|
|
||||||
this.show_remove_podcast_modal = true
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -217,8 +217,10 @@ export default {
|
|||||||
return axios.get('/api/library/albums/' + albumId)
|
return axios.get('/api/library/albums/' + albumId)
|
||||||
},
|
},
|
||||||
|
|
||||||
library_album_tracks (albumId) {
|
library_album_tracks (albumId, filter = { limit: -1, offset: 0 }) {
|
||||||
return axios.get('/api/library/albums/' + albumId + '/tracks')
|
return axios.get('/api/library/albums/' + albumId + '/tracks', {
|
||||||
|
params: filter
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
library_album_track_update (albumId, attributes) {
|
library_album_track_update (albumId, attributes) {
|
||||||
@ -319,6 +321,10 @@ export default {
|
|||||||
return axios.get('/api/library/tracks/' + trackId)
|
return axios.get('/api/library/tracks/' + trackId)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
library_track_playlists (trackId) {
|
||||||
|
return axios.get('/api/library/tracks/' + trackId + '/playlists')
|
||||||
|
},
|
||||||
|
|
||||||
library_track_update (trackId, attributes = {}) {
|
library_track_update (trackId, attributes = {}) {
|
||||||
return axios.put('/api/library/tracks/' + trackId, undefined, { params: attributes })
|
return axios.put('/api/library/tracks/' + trackId, undefined, { params: attributes })
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user