mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 11:39: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
|
@ -11,6 +11,7 @@ import pydub
|
|||
from django.conf import settings
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.files.base import ContentFile
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models, transaction
|
||||
|
@ -643,6 +644,7 @@ class UploadQuerySet(common_models.NullsLastQuerySet):
|
|||
|
||||
|
||||
TRACK_FILE_IMPORT_STATUS_CHOICES = (
|
||||
("draft", "Draft"),
|
||||
("pending", "Pending"),
|
||||
("finished", "Finished"),
|
||||
("errored", "Errored"),
|
||||
|
@ -1139,6 +1141,12 @@ class Library(federation_models.FederationMixin):
|
|||
common_utils.on_commit(tasks.start_library_scan.delay, library_scan_id=scan.pk)
|
||||
return scan
|
||||
|
||||
def get_channel(self):
|
||||
try:
|
||||
return self.channel
|
||||
except ObjectDoesNotExist:
|
||||
return None
|
||||
|
||||
|
||||
SCAN_STATUS = [
|
||||
("pending", "pending"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue