mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 22:58:28 +02:00
See #195: set bitrate, duration and size when importing file
This commit is contained in:
parent
7425a8ea4d
commit
1bc4ceab9e
9 changed files with 126 additions and 7 deletions
|
@ -27,6 +27,7 @@ class SimpleArtistSerializer(serializers.ModelSerializer):
|
|||
|
||||
class ArtistSerializer(serializers.ModelSerializer):
|
||||
tags = TagSerializer(many=True, read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = models.Artist
|
||||
fields = ('id', 'mbid', 'name', 'tags', 'creation_date')
|
||||
|
@ -40,11 +41,21 @@ class TrackFileSerializer(serializers.ModelSerializer):
|
|||
fields = (
|
||||
'id',
|
||||
'path',
|
||||
'duration',
|
||||
'source',
|
||||
'filename',
|
||||
'mimetype',
|
||||
'track')
|
||||
'track',
|
||||
'duration',
|
||||
'mimetype',
|
||||
'bitrate',
|
||||
'size',
|
||||
)
|
||||
read_only_fields = [
|
||||
'duration',
|
||||
'mimetype',
|
||||
'bitrate',
|
||||
'size',
|
||||
]
|
||||
|
||||
def get_path(self, o):
|
||||
url = o.path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue