mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 17:28:12 +02:00
See #170: subsonic API for podcasts
This commit is contained in:
parent
f8baae53fd
commit
23d3893f01
8 changed files with 452 additions and 9 deletions
|
@ -31,6 +31,15 @@ class ChannelQuerySet(models.QuerySet):
|
|||
return self.filter(query)
|
||||
return self.exclude(query)
|
||||
|
||||
def subscribed(self, actor):
|
||||
if not actor:
|
||||
return self.none()
|
||||
|
||||
subscriptions = actor.emitted_follows.filter(
|
||||
approved=True, target__channel__isnull=False
|
||||
)
|
||||
return self.filter(actor__in=subscriptions.values_list("target", flat=True))
|
||||
|
||||
|
||||
class Channel(models.Model):
|
||||
uuid = models.UUIDField(default=uuid.uuid4, unique=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue