From 2e8c58a53d74460bb9dc2832a42ea928e6e7c79a Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 12 Jul 2024 20:12:27 +0000 Subject: [PATCH] sane-tag-music: allow "info.txt" as an artist-associated item --- .../additional/sane-scripts/src/sane-tag-music | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/additional/sane-scripts/src/sane-tag-music b/pkgs/additional/sane-scripts/src/sane-tag-music index 7e3896859..c4f458b6c 100755 --- a/pkgs/additional/sane-scripts/src/sane-tag-music +++ b/pkgs/additional/sane-scripts/src/sane-tag-music @@ -407,12 +407,20 @@ class Tags: it's tough to distinguish such an item from an incomplete tag, so we special-case them. """ - title = self.title[0].lower() if len(self.title) == 1 else "" - return ext.lower() in IMAGE_EXTENSIONS \ - and not self.producer \ + is_associated_with_artist = \ + not self.producer \ and (self.albumartist or self.artist) \ - and not self.album \ - and title == "artist" + and not self.album + if not is_associated_with_artist: + return False + + title = self.title[0].lower() if len(self.title) == 1 else "" + if ext.lower() in IMAGE_EXTENSIONS and title == "artist": + return True + if ext.lower() in [ "md", "txt" ] and title == "info": + return True + + return False def to_path(self, ext: str) -> str | None: is_artist_item = self.is_artist_item(ext)