Don't save BPM to tags if not found

This commit is contained in:
RemixDev 2021-09-30 19:40:46 +02:00
parent d2e0450ace
commit ce98393683
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
1 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ def tagID3(path, track, save):
tag.add(TDAT(text=str(track.date.day) + str(track.date.month))) tag.add(TDAT(text=str(track.date.day) + str(track.date.month)))
if save['length']: if save['length']:
tag.add(TLEN(text=str(int(track.duration)*1000))) tag.add(TLEN(text=str(int(track.duration)*1000)))
if save['bpm']: if save['bpm'] and track.bpm:
tag.add(TBPM(text=str(track.bpm))) tag.add(TBPM(text=str(track.bpm)))
if save['label']: if save['label']:
tag.add(TPUB(text=track.album.label)) tag.add(TPUB(text=track.album.label))
@ -177,7 +177,7 @@ def tagFLAC(path, track, save):
if save['length']: if save['length']:
tag["LENGTH"] = str(int(track.duration)*1000) tag["LENGTH"] = str(int(track.duration)*1000)
if save['bpm']: if save['bpm'] and track.bpm:
tag["BPM"] = str(track.bpm) tag["BPM"] = str(track.bpm)
if save['label']: if save['label']:
tag["PUBLISHER"] = track.album.label tag["PUBLISHER"] = track.album.label