addrelease.py: Use approximated "~length" for Recordings.

Recordings don't support sub-second time precision, so the
track.metadata.length used for the two Add...AsRelease classes will
cause an error on /recording/create's "length" field.
track.metadata["~length"] contains the time converted to mm:ss format
and will not cause the error on /recording/create, so this commit
changes AddFileAsRecording to use that.
This commit is contained in:
Frederik "Freso" S. Olesen
2014-04-08 21:55:12 +02:00
parent b765452aac
commit 8bca1ecfbb

View File

@@ -152,7 +152,7 @@ class AddFileAsRecording(AddObjectAsEntity):
nv = self.add_form_value
nv("edit-recording.name", track.metadata["title"])
nv("edit-recording.artist_credit.names.0.artist.name", track.metadata["artist"])
nv("edit-recording.length", str(track.metadata.length))
nv("edit-recording.length", track.metadata["~length"])
class AddFileAsRelease(AddObjectAsEntity):