print pruned albums if artist wasn't pruned

This commit is contained in:
George Lacey 2025-07-12 15:07:39 +01:00
parent cc9b560484
commit bde4972a7f

View File

@ -16,18 +16,23 @@ class Dedupe(Layer):
for artist in left:
artist_name = artist.name
if artist_name in existing_artists:
self.prune_artist(artist, right[artist_name])
pruned_albums = self.prune_artist(artist, right[artist_name])
if len(artist.contents) == 0:
pruned_artists.append(artist_name)
self.log.info('PRN', f"Pruned artist: {artist_name}")
else:
for album_name in pruned_albums:
self.log.info('PRN', f"Pruned album: {album_name}")
else:
continue # todo: fuzzy matching
[left.prune(artist) for artist in pruned_artists]
def prune_artist(self, left: Artist, right: Artist):
@staticmethod
def prune_artist(left: Artist, right: Artist):
existing_albums = right.by_name()
pruned_albums = list()
for album_name in existing_albums:
if album_name in left.by_name():
left.prune(album_name)
if len(left.by_name()) > len(existing_albums):
self.log.info('PRN', f"Pruned album: {album_name}")
pruned_albums.append(album_name)
return pruned_albums