See #195: no update track information when fetching track from federation

This commit is contained in:
Eliot Berriot 2018-05-16 18:55:09 +02:00
parent 80783f9a68
commit a28078753b
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 24 additions and 13 deletions

View file

@ -268,6 +268,10 @@ def handle_serve(track_file):
qs = LibraryTrack.objects.select_for_update()
library_track = qs.get(pk=library_track.pk)
library_track.download_audio()
track_file.library_track = library_track
track_file.set_audio_data()
track_file.save(update_fields=['bitrate', 'duration', 'size'])
audio_file = library_track.audio_file
file_path = get_file_path(audio_file)
mt = library_track.audio_mimetype