From d617443af686ebfeb18b461114f4dfbc303b89a9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 15 Nov 2023 03:04:49 +0100 Subject: [PATCH] [YouTube] Added subscriptions+channels support. Closes: #337 --- .../src/components/panels/Media/Nav.vue | 2 +- .../panels/Media/Providers/YouTube.vue | 17 ++ .../Media/Providers/YouTube/Channel.vue | 188 ++++++++++++++++++ .../Media/Providers/YouTube/Subscriptions.vue | 137 +++++++++++++ .../src/components/panels/Media/Results.vue | 14 +- platypush/plugins/youtube/__init__.py | 76 ++++++- platypush/schemas/piped.py | 107 ++++++++++ 7 files changed, 529 insertions(+), 12 deletions(-) create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Channel.vue create mode 100644 platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Subscriptions.vue diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue b/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue index 2409dac4c..93e370a40 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Nav.vue @@ -63,7 +63,7 @@ nav { position: relative; box-shadow: 2.5px 0 4.5px 2px $nav-collapsed-fg; margin-left: 2.5px; - overflow: hidden; + overflow: auto; .menu-button { position: absolute; diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue index 297422e88..ee341678c 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube.vue @@ -14,6 +14,11 @@ @play="$emit('play', $event)" @select="onPlaylistSelected" v-else-if="selectedView === 'playlists'" /> + @@ -29,6 +34,7 @@ import Feed from "./YouTube/Feed"; import Index from "./YouTube/Index"; import NoToken from "./YouTube/NoToken"; import Playlists from "./YouTube/Playlists"; +import Subscriptions from "./YouTube/Subscriptions"; export default { mixins: [MediaProvider], @@ -39,6 +45,7 @@ export default { MediaNav, NoToken, Playlists, + Subscriptions, }, data() { @@ -46,6 +53,7 @@ export default { youtubeConfig: null, selectedView: null, selectedPlaylist: null, + selectedChannel: null, path: [], } }, @@ -83,6 +91,8 @@ export default { this.selectedView = view if (view === 'playlists') this.selectedPlaylist = null + else if (view === 'subscriptions') + this.selectedChannel = null if (view?.length) { this.path = [ @@ -102,6 +112,13 @@ export default { title: playlist.name, }) }, + + onChannelSelected(channel) { + this.selectedChannel = channel.id + this.path.push({ + title: channel.name, + }) + }, }, mounted() { diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Channel.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Channel.vue new file mode 100644 index 000000000..bebd83539 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Channel.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Subscriptions.vue b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Subscriptions.vue new file mode 100644 index 000000000..e97cdf793 --- /dev/null +++ b/platypush/backend/http/webapp/src/components/panels/Media/Providers/YouTube/Subscriptions.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/platypush/backend/http/webapp/src/components/panels/Media/Results.vue b/platypush/backend/http/webapp/src/components/panels/Media/Results.vue index b82362841..c45530b35 100644 --- a/platypush/backend/http/webapp/src/components/panels/Media/Results.vue +++ b/platypush/backend/http/webapp/src/components/panels/Media/Results.vue @@ -1,16 +1,12 @@