Fix track length on import

This commit is contained in:
Keith Edmunds 2022-04-08 22:47:50 +01:00
parent 9da5328735
commit a774f148ee

View File

@ -94,12 +94,10 @@ def create_track_from_file(session, path, normalise=None, interactive=False):
track = Tracks.get_or_create(session, path)
track.title = title
track.artist = artist
track.duration = int(round(
t['duration'], Config.MILLISECOND_SIGFIGS) * 1000)
if interactive:
INFO("Parse for start, fade and silence...")
audio = get_audio_segment(path)
track.duration = len(audio)
track.start_gap = leading_silence(audio)
track.fade_at = round(fade_point(audio) / 1000,
Config.MILLISECOND_SIGFIGS) * 1000