mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 09:09:16 +02:00
See #170: updates to upload API to support channels publishing
This commit is contained in:
parent
e80eb3eb3e
commit
c94d9214ec
13 changed files with 895 additions and 104 deletions
|
@ -68,7 +68,7 @@ class ActorQuerySet(models.QuerySet):
|
|||
|
||||
def with_current_usage(self):
|
||||
qs = self
|
||||
for s in ["pending", "skipped", "errored", "finished"]:
|
||||
for s in ["draft", "pending", "skipped", "errored", "finished"]:
|
||||
uploads_query = models.Q(
|
||||
libraries__uploads__import_status=s,
|
||||
libraries__uploads__audio_file__isnull=False,
|
||||
|
@ -247,7 +247,7 @@ class Actor(models.Model):
|
|||
def get_current_usage(self):
|
||||
actor = self.__class__.objects.filter(pk=self.pk).with_current_usage().get()
|
||||
data = {}
|
||||
for s in ["pending", "skipped", "errored", "finished"]:
|
||||
for s in ["draft", "pending", "skipped", "errored", "finished"]:
|
||||
data[s] = getattr(actor, "_usage_{}".format(s)) or 0
|
||||
|
||||
data["total"] = sum(data.values())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue