From bde4972a7f0fb55f684e2b290e0fb67932b7f09d Mon Sep 17 00:00:00 2001 From: grglcy Date: Sat, 12 Jul 2025 15:07:39 +0100 Subject: [PATCH] print pruned albums if artist wasn't pruned --- src/layers/dedupe.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/layers/dedupe.py b/src/layers/dedupe.py index e641dcc..5d855fe 100644 --- a/src/layers/dedupe.py +++ b/src/layers/dedupe.py @@ -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