From f3e7edb21ed0c710768908ab8f514b6067aaf5f2 Mon Sep 17 00:00:00 2001 From: Adam Tygart Date: Sat, 27 Feb 2021 15:23:35 -0600 Subject: [PATCH] Attempt to address the comments from sampsyo Undoes the changes to autotag/hooks.py If trackdisambig is not set to None at some point in time, the test case for a non-existent trackdisambig fails. as such, try to get the disambiguation with a default of None when setting trackdisambig. Not sure if this is reasonable. --- beets/autotag/hooks.py | 3 +-- beets/autotag/mb.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py index c86579322..065d88170 100644 --- a/beets/autotag/hooks.py +++ b/beets/autotag/hooks.py @@ -163,7 +163,7 @@ class TrackInfo(AttrDict): composer=None, composer_sort=None, arranger=None, track_alt=None, work=None, mb_workid=None, work_disambig=None, bpm=None, initial_key=None, genre=None, - trackdisambig=None, **kwargs): + **kwargs): self.title = title self.track_id = track_id self.release_track_id = release_track_id @@ -191,7 +191,6 @@ class TrackInfo(AttrDict): self.bpm = bpm self.initial_key = initial_key self.genre = genre - self.trackdisambig = trackdisambig self.update(kwargs) # As above, work around a bug in python-musicbrainz-ngs. diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index bdfc0d0c9..740f0fcae 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -223,8 +223,7 @@ def track_info(recording, index=None, medium=None, medium_index=None, if recording.get('length'): info.length = int(recording['length']) / (1000.0) - if recording.get('disambiguation'): - info.trackdisambig = recording.get('disambiguation') + info.trackdisambig = recording.get('disambiguation', None) lyricist = [] composer = []