Improve full database update sanity check
This commit is contained in:
parent
fcf4ba3eb9
commit
246b0d4915
@ -150,18 +150,15 @@ def full_update_db(session):
|
|||||||
if not tag['title']:
|
if not tag['title']:
|
||||||
log(f"track[{track.id}] {track.title=}: No tag title")
|
log(f"track[{track.id}] {track.title=}: No tag title")
|
||||||
continue
|
continue
|
||||||
|
if not tag['artist']:
|
||||||
|
log(f"track[{track.id}] {track.artist=}: No tag artist")
|
||||||
|
continue
|
||||||
|
|
||||||
if track.artist:
|
# Update title and artist
|
||||||
if track.artist != tag['artist']:
|
|
||||||
log(
|
|
||||||
f"track[{track.id}] artist mismatch: "
|
|
||||||
f"{track.artist=} {tag['artist']=}"
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
# Update title
|
|
||||||
if track.title != tag['title']:
|
if track.title != tag['title']:
|
||||||
track.title = tag['title']
|
track.title = tag['title']
|
||||||
|
if track.artist != tag['artist']:
|
||||||
|
track.artist = tag['artist']
|
||||||
|
|
||||||
# Update numbers; log if more than 10% different
|
# Update numbers; log if more than 10% different
|
||||||
duration = int(round(
|
duration = int(round(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user