From 5e55a46d09532afc89e9516a63519ca3afc562ac Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Sat, 4 Nov 2023 10:24:16 +0100 Subject: [PATCH] Another round of lastgenre logging nitpicks - Printing out album/item in default format could lead to unreadable clutter depending on the user's configured formats. - The album's name and the individual tracks' title should be just sufficient to provide context as well readability. - Log like this while importing as well as in standalone runs. --- beetsplug/lastgenre/__init__.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index 8d9e8e65a0..751e687864 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -419,7 +419,9 @@ def lastgenre_func(lib, opts, args): for album in lib.albums(ui.decargs(args)): album.genre, src = self._get_genre(album) self._log.info( - "genre for album {0} ({1}): {0.genre}", album, src + 'genre for album "{0.album}" ({1}): {0.genre}', + album, + src, ) if "track" in self.sources: album.store(inherit=False) @@ -433,7 +435,7 @@ def lastgenre_func(lib, opts, args): item.genre, src = self._get_genre(item) item.store() self._log.info( - "genre for track {0} ({1}): {0.genre}", + 'genre for track "{0.title}" ({1}): {0.genre}', item, src, ) @@ -447,7 +449,7 @@ def lastgenre_func(lib, opts, args): item.genre, src = self._get_genre(item) item.store() self._log.info( - "genre for track {0} ({1}): {0.genre}", item, src + "genre for track {0.title} ({1}): {0.genre}", item, src ) lastgenre_cmd.func = lastgenre_func @@ -459,7 +461,7 @@ def imported(self, session, task): album = task.album album.genre, src = self._get_genre(album) self._log.debug( - "added last.fm album genre ({0}): {1}", src, album.genre + 'genre for album "{0.album}" ({1}): {0.genre}', album, src ) # If we're using track-level sources, store the album genre only, @@ -469,7 +471,9 @@ def imported(self, session, task): for item in album.items(): item.genre, src = self._get_genre(item) self._log.debug( - "added last.fm item genre ({0}): {1}", src, item.genre + 'genre for track "{0.title}" ({1}): {0.genre}', + item, + src, ) item.store() # Store the album genre and inherit to tracks. @@ -480,7 +484,9 @@ def imported(self, session, task): item = task.item item.genre, src = self._get_genre(item) self._log.debug( - "added last.fm item genre ({0}): {1}", src, item.genre + 'genre for track "{0.title}" ({1}): {0.genre}', + item, + src, ) item.store()