diff --git a/web-src/src/pages/PagePodcast.vue b/web-src/src/pages/PagePodcast.vue
index 7a2654db..9786924e 100644
--- a/web-src/src/pages/PagePodcast.vue
+++ b/web-src/src/pages/PagePodcast.vue
@@ -2,12 +2,6 @@
@@ -53,7 +47,19 @@
:media_kind="'podcast'"
:new_tracks="new_tracks"
@close="show_album_details_modal = false"
- @play_count_changed="reload_tracks" />
+ @play_count_changed="reload_tracks"
+ @remove_podcast="open_remove_podcast_dialog" />
+
+
+ Permanently remove this podcast from your library?
+ (This will also remove the RSS playlist {{ rss_playlist_to_remove.name }}.)
+
+
@@ -64,6 +70,7 @@ import ContentWithHeading from '@/templates/ContentWithHeading'
import ListItemTrack from '@/components/ListItemTrack'
import ModalDialogTrack from '@/components/ModalDialogTrack'
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
+import ModalDialog from '@/components/ModalDialog'
import RangeSlider from 'vue-range-slider'
import webapi from '@/webapi'
@@ -84,7 +91,7 @@ const albumData = {
export default {
name: 'PagePodcast',
mixins: [LoadDataBeforeEnterMixin(albumData)],
- components: { ContentWithHeading, ListItemTrack, ModalDialogTrack, RangeSlider, ModalDialogAlbum },
+ components: { ContentWithHeading, ListItemTrack, ModalDialogTrack, RangeSlider, ModalDialogAlbum, ModalDialog },
data () {
return {
@@ -94,7 +101,10 @@ export default {
show_details_modal: false,
selected_track: {},
- show_album_details_modal: false
+ show_album_details_modal: false,
+
+ show_remove_podcast_modal: false,
+ rss_playlist_to_remove: {}
}
},
@@ -118,20 +128,25 @@ export default {
this.show_details_modal = true
},
- rss_unsubscribe: function () {
+ open_remove_podcast_dialog: function () {
+ this.show_album_details_modal = false
webapi.search({ type: 'playlist', query: this.album.name }).then(({ data }) => {
- var plids = [...new Set(data.playlists.items
- .filter(pl => pl.name === this.album.name)
- .map(pl => pl.id))]
+ var playlists = data.playlists.items.filter(pl => pl.name === this.album.name && pl.type === 'rss')
- if (plids.length === 1) {
- plids.forEach(pl => {
- webapi.library_playlist_delete(pl)
- })
- this.$router.push({ path: '/podcasts' })
- } else {
- this.$store.dispatch('add_notification', { text: 'Failed to delete playlist, unable to find unique plid', type: 'danger' })
+ 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' })
+ return
}
+
+ this.rss_playlist_to_remove = playlists[0]
+ this.show_remove_podcast_modal = true
+ })
+ },
+
+ remove_podcast: function () {
+ this.show_remove_podcast_modal = false
+ webapi.library_playlist_delete(this.rss_playlist_to_remove.id).then(() => {
+ this.$router.replace({ path: '/podcasts' })
})
},
diff --git a/web-src/src/pages/PagePodcasts.vue b/web-src/src/pages/PagePodcasts.vue
index 9915b58f..d0c166e8 100644
--- a/web-src/src/pages/PagePodcasts.vue
+++ b/web-src/src/pages/PagePodcasts.vue
@@ -59,7 +59,24 @@
-
+
+
+
+ Permanently remove this podcast from your library?
+ (This will also remove the RSS playlist {{ rss_playlist_to_remove.name }}.)
+
+
@@ -74,6 +91,7 @@ import ListItemAlbum from '@/components/ListItemAlbum'
import ModalDialogTrack from '@/components/ModalDialogTrack'
import ModalDialogAlbum from '@/components/ModalDialogAlbum'
import ModalDialogAddRss from '@/components/ModalDialogAddRss'
+import ModalDialog from '@/components/ModalDialog'
import RangeSlider from 'vue-range-slider'
import webapi from '@/webapi'
@@ -94,7 +112,7 @@ const albumsData = {
export default {
name: 'PagePodcasts',
mixins: [LoadDataBeforeEnterMixin(albumsData)],
- components: { ContentWithHeading, ListItemTrack, ListItemAlbum, ModalDialogTrack, ModalDialogAlbum, ModalDialogAddRss, RangeSlider },
+ components: { ContentWithHeading, ListItemTrack, ListItemAlbum, ModalDialogTrack, ModalDialogAlbum, ModalDialogAddRss, ModalDialog, RangeSlider },
data () {
return {
@@ -107,7 +125,10 @@ export default {
show_url_modal: false,
show_track_details_modal: false,
- selected_track: {}
+ selected_track: {},
+
+ show_remove_podcast_modal: false,
+ rss_playlist_to_remove: {}
}
},
@@ -141,6 +162,28 @@ export default {
this.show_url_modal = true
},
+ open_remove_podcast_dialog: function () {
+ this.show_album_details_modal = false
+ webapi.search({ type: 'playlist', query: this.selected_album.name }).then(({ data }) => {
+ var playlists = data.playlists.items.filter(pl => pl.name === this.selected_album.name && pl.type === 'rss')
+
+ 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' })
+ return
+ }
+
+ this.rss_playlist_to_remove = playlists[0]
+ this.show_remove_podcast_modal = true
+ })
+ },
+
+ remove_podcast: function () {
+ this.show_remove_podcast_modal = false
+ webapi.library_playlist_delete(this.rss_playlist_to_remove.id).then(() => {
+ this.reload_podcasts()
+ })
+ },
+
reload_new_episodes: function () {
webapi.library_podcasts_new_episodes().then(({ data }) => {
this.new_episodes = data.tracks
From 1d24622c990eaf4b7bcd265e45a72e8c2f33e9c7 Mon Sep 17 00:00:00 2001
From: chme
Date: Sun, 12 Apr 2020 09:37:32 +0200
Subject: [PATCH 12/25] [web-src] "add podcast" dialog updates
---
web-src/src/components/ModalDialogAddRss.vue | 14 ++++++++------
web-src/src/pages/PagePodcasts.vue | 11 +++++++----
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/web-src/src/components/ModalDialogAddRss.vue b/web-src/src/components/ModalDialogAddRss.vue
index 22d5eaab..bb8f66ca 100644
--- a/web-src/src/components/ModalDialogAddRss.vue
+++ b/web-src/src/components/ModalDialogAddRss.vue
@@ -6,20 +6,22 @@
@@ -27,7 +29,7 @@
-
@@ -58,7 +60,7 @@ export default {
this.loading = true
webapi.library_add(this.url).then(() => {
this.$emit('close')
- this.$emit('rss_change')
+ this.$emit('podcast_added')
this.url = ''
}).catch(() => {
this.loading = false
diff --git a/web-src/src/pages/PagePodcasts.vue b/web-src/src/pages/PagePodcasts.vue
index d0c166e8..3d9f5109 100644
--- a/web-src/src/pages/PagePodcasts.vue
+++ b/web-src/src/pages/PagePodcasts.vue
@@ -43,11 +43,11 @@
@@ -77,7 +77,10 @@
(This will also remove the RSS playlist {{ rss_playlist_to_remove.name }}.)
-
+
@@ -158,7 +161,7 @@ export default {
this.new_episodes.items = { }
},
- open_add_stream_dialog: function (item) {
+ open_add_podcast_dialog: function (item) {
this.show_url_modal = true
},
From b298fc117083e780c0389b206659d1500ac1b55b Mon Sep 17 00:00:00 2001
From: chme
Date: Sat, 18 Apr 2020 06:57:55 +0200
Subject: [PATCH 13/25] [web-src] Restyling of navbars and now playing page
---
web-src/src/App.vue | 39 +-
web-src/src/components/NavbarBottom.vue | 358 +++++++++++++++++-
web-src/src/components/NavbarItemLink.vue | 35 +-
web-src/src/components/NavbarTop.vue | 266 +++----------
.../src/components/PlayerButtonConsume.vue | 8 +-
web-src/src/components/PlayerButtonNext.vue | 8 +-
.../src/components/PlayerButtonPlayPause.vue | 2 +-
.../src/components/PlayerButtonPrevious.vue | 8 +-
web-src/src/components/PlayerButtonRepeat.vue | 8 +-
.../src/components/PlayerButtonShuffle.vue | 8 +-
web-src/src/pages/PageNowPlaying.vue | 78 ++--
web-src/src/router/index.js | 12 +-
web-src/src/store/index.js | 6 +-
web-src/src/store/mutation_types.js | 1 +
14 files changed, 567 insertions(+), 270 deletions(-)
diff --git a/web-src/src/App.vue b/web-src/src/App.vue
index 8972f475..e985a277 100644
--- a/web-src/src/App.vue
+++ b/web-src/src/App.vue
@@ -8,7 +8,10 @@
-
+
+
@@ -35,8 +38,21 @@ export default {
},
computed: {
- show_burger_menu () {
- return this.$store.state.show_burger_menu
+ show_burger_menu: {
+ get () {
+ return this.$store.state.show_burger_menu
+ },
+ set (value) {
+ this.$store.commit(types.SHOW_BURGER_MENU, value)
+ }
+ },
+ show_player_menu: {
+ get () {
+ return this.$store.state.show_player_menu
+ },
+ set (value) {
+ this.$store.commit(types.SHOW_PLAYER_MENU, value)
+ }
}
},
@@ -209,16 +225,23 @@ export default {
this.$store.commit(types.UPDATE_PAIRING, data)
this.pairing_active = data.active
})
+ },
+
+ update_is_clipped: function () {
+ if (this.show_burger_menu || this.show_player_menu) {
+ document.querySelector('html').classList.add('is-clipped')
+ } else {
+ document.querySelector('html').classList.remove('is-clipped')
+ }
}
},
watch: {
'show_burger_menu' () {
- if (this.show_burger_menu) {
- document.querySelector('html').classList.add('is-clipped')
- } else {
- document.querySelector('html').classList.remove('is-clipped')
- }
+ this.update_is_clipped()
+ },
+ 'show_player_menu' () {
+ this.update_is_clipped()
}
}
}
diff --git a/web-src/src/components/NavbarBottom.vue b/web-src/src/components/NavbarBottom.vue
index ae5ccd95..c4d2ea01 100644
--- a/web-src/src/components/NavbarBottom.vue
+++ b/web-src/src/components/NavbarBottom.vue
@@ -1,40 +1,380 @@
-