Can now import library tracks from front-end

This commit is contained in:
Eliot Berriot 2018-04-12 23:03:26 +02:00
parent 2cef58e6c1
commit 3a31248a3d
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
7 changed files with 249 additions and 4 deletions

View file

@ -163,3 +163,10 @@ class LibraryTrack(models.Model):
title = models.CharField(max_length=500)
metadata = JSONField(
default={}, max_length=10000, encoder=DjangoJSONEncoder)
@property
def mbid(self):
try:
return self.metadata['recording']['musicbrainz_id']
except KeyError:
pass