[web] Fix an issue preventing removal of RSS podcasts #1616

RSS podcasts can now be removed. Moreover, the remove option is not shown anymore to non-RSS podcasts.
This commit is contained in:
Alain Nussbaumer 2023-06-02 23:13:44 +02:00
parent 784de0c4a1
commit 9bd68ca306
9 changed files with 32 additions and 55 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -146,16 +146,7 @@ export default {
.library_album_tracks(this.selected_album.id, { limit: 1 })
.then(({ data }) => {
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: this.$t('list.albums.notification'),
type: 'danger'
})
return
}
this.rss_playlist_to_remove = rssPlaylists[0]
this.rss_playlist_to_remove = data.items.filter((pl) => pl.type === 'rss')[0]
this.show_remove_podcast_modal = true
this.show_details_modal = false
})

View File

@ -14,7 +14,7 @@
<span class="icon"><mdicon name="cancel" size="16" /></span>
<span
class="is-size-7"
v-text="close_action ? close_action : t('dialog.cancel')"
v-text="close_action ? close_action : $t('dialog.cancel')"
/>
</a>
<a

View File

@ -26,6 +26,7 @@
v-text="$t('dialog.album.mark-as-played')"
/>
<a
v-if="album.data_kind === 'url'"
class="button is-small"
@click="$emit('remove-podcast')"
v-text="$t('dialog.album.remove-podcast')"

View File

@ -193,7 +193,6 @@
"albums": {
"info-1": "Diesen Podcast dauerhaft aus der Bibliothek löschen?",
"info-2": "Dies wir auch RSS-Playlisten löschen ",
"notification": "Podcast kann nicht gelöscht werden - evtl. wurde er nicht als RSS-Playlist hinzugefügt.",
"remove": "Entfernen",
"remove-podcast":"Entferne podcast"
},
@ -380,7 +379,6 @@
"podcast": {
"play": "Spielen",
"remove": "Entfernen",
"remove-error": "Podcast kann nicht entfernt werden, evtl. wurde er nicht als RSS-Playlist hinzugefügt.",
"remove-info-1": "Diesen Podcast wirklich dauerhaft aus der Bibliothek löschen?",
"remove-info-2": "Damit wird auch die RSS-Playliste gelöscht. ",
"remove-podcast":"Entferne podcast",

View File

@ -193,7 +193,6 @@
"albums": {
"info-1": "Permanently remove this podcast from your library?",
"info-2": "This will also remove the RSS playlist ",
"notification": "Podcast cannot be removed. Probably it was not added as an RSS playlist.",
"remove": "Remove",
"remove-podcast": "Remove podcast"
},
@ -380,7 +379,6 @@
"podcast": {
"play": "Play",
"remove": "Remove",
"remove-error": "Podcast cannot be removed. Probably it was not added as an RSS playlist.",
"remove-info-1": "Permanently remove this podcast from your library?",
"remove-info-2": "This will also remove the RSS playlist ",
"remove-podcast": "Remove podcast",

View File

@ -193,7 +193,6 @@
"albums": {
"info-1": "Supprimer définitivement ce podcast de votre bibliothèque ?",
"info-2": "Cela supprimera également la liste de lecture RSS ",
"notification": "Le podcast ne peut être supprimé. Il navait probablement pas été ajouté comme une liste de lecture RSS.",
"remove": "Supprimer",
"remove-podcast": "Supprimer le podcast"
},
@ -380,7 +379,6 @@
"podcast": {
"play": "Lire",
"remove": "Supprimer",
"remove-error": "Le podcast ne peut pas être supprimé. Il na probablement pas été ajouté en tant que liste de lecture RSS.",
"remove-info-1": "Supprimer ce podcast de manière permanente de la bibliothèque ?",
"remove-info-2": "Cela supprimera également la liste de lecture RSS ",
"remove-podcast":"Supprimer le podcast",

View File

@ -7,7 +7,7 @@
<div class="buttons is-centered">
<a
class="button is-small is-light is-rounded"
@click="show_album_details_modal = true"
@click="show_details_modal = true"
>
<span class="icon"><mdicon name="dots-horizontal" size="16" /></span>
</a>
@ -28,11 +28,11 @@
@play-count-changed="reload_tracks"
/>
<modal-dialog-album
:show="show_album_details_modal"
:show="show_details_modal"
:album="album"
:media_kind="'podcast'"
:new_tracks="new_tracks"
@close="show_album_details_modal = false"
@close="show_details_modal = false"
@play-count-changed="reload_tracks"
@remove-podcast="open_remove_podcast_dialog"
/>
@ -103,7 +103,7 @@ export default {
return {
album: {},
tracks: new GroupByList(),
show_album_details_modal: false,
show_details_modal: false,
show_remove_podcast_modal: false,
rss_playlist_to_remove: {}
}
@ -121,19 +121,10 @@ export default {
},
open_remove_podcast_dialog: function () {
this.show_album_details_modal = false
webapi.library_track_playlists(this.tracks[0].id).then(({ data }) => {
const rssPlaylists = data.items.filter((pl) => pl.type === 'rss')
if (rssPlaylists.length !== 1) {
this.$store.dispatch('add_notification', {
text: this.$t('page.podcast.remove-error'),
type: 'danger'
})
return
}
this.rss_playlist_to_remove = rssPlaylists[0]
webapi.library_track_playlists(this.tracks.items[0].id).then(({ data }) => {
this.rss_playlist_to_remove = data.items.filter((pl) => pl.type === 'rss')[0]
this.show_remove_podcast_modal = true
this.show_details_modal = false
})
},