Compare commits

...

4 commits

Author SHA1 Message Date
972f9dffb9
[YouTube UI] Fixed infinite scroll for channels.
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-13 00:54:29 +02:00
81fb1a47c3
Merge branch 'master' into 391/improve-youtube-support 2024-07-13 00:41:46 +02:00
24b5b3ba14
[youtube] Added youtube.is_subscribed action.
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-13 00:41:38 +02:00
c7f12e0bd8
[Automatic] Updated components cache
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-12 01:13:48 +00:00
3 changed files with 19 additions and 4 deletions

View file

@ -1,8 +1,8 @@
<template> <template>
<div class="media-youtube-channel" @scroll="onScroll"> <div class="media-youtube-channel">
<Loading v-if="loading" /> <Loading v-if="loading" />
<div class="channel" @scroll="onScroll" v-else-if="channel"> <div class="channel" v-else-if="channel">
<div class="header"> <div class="header">
<div class="banner"> <div class="banner">
<img :src="channel.banner" v-if="channel?.banner?.length" /> <img :src="channel.banner" v-if="channel?.banner?.length" />
@ -45,8 +45,10 @@
:filter="filter" :filter="filter"
:selected-result="selectedResult" :selected-result="selectedResult"
ref="results" ref="results"
@play="$emit('play', $event)"
@scroll-end="loadNextPage"
@select="selectedResult = $event" @select="selectedResult = $event"
@play="$emit('play', $event)" /> />
</div> </div>
</div> </div>
</template> </template>
@ -135,7 +137,7 @@ export default {
if (!el) if (!el)
return return
const bottom = (el.scrollHeight - el.scrollTop) <= el.clientHeight + 150 const bottom = (el.scrollHeight - el.scrollTop) <= el.clientHeight + 100
if (!bottom) if (!bottom)
return return

Binary file not shown.

View file

@ -360,6 +360,19 @@ class YoutubePlugin(Plugin):
json={'playlistId': id}, json={'playlistId': id},
) )
@action
def is_subscribed(self, channel_id: str) -> bool:
"""
Check if the user is subscribed to a channel.
:param channel_id: YouTube channel ID.
:return: True if the user is subscribed to the channel, False otherwise.
"""
return self._request(
'subscribed',
params={'channelId': channel_id},
).get('subscribed', False)
@action @action
def subscribe(self, channel_id: str): def subscribe(self, channel_id: str):
""" """