Started work on library scanning

This commit is contained in:
Eliot Berriot 2018-04-11 23:13:33 +02:00
parent 472cc7e26a
commit 520fb9d078
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
9 changed files with 157 additions and 4 deletions

View file

@ -4,6 +4,7 @@ from django.core.exceptions import ValidationError
from django.contrib.postgres.fields import JSONField
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.serializers.json import DjangoJSONEncoder
from funkwhale_api.music.models import Track
@ -23,7 +24,7 @@ class Radio(models.Model):
creation_date = models.DateTimeField(default=timezone.now)
is_public = models.BooleanField(default=False)
version = models.PositiveIntegerField(default=0)
config = JSONField()
config = JSONField(encoder=DjangoJSONEncoder)
def get_candidates(self):
return filters.run(self.config)