sane-tag-music: allow "info.txt" as an artist-associated item

This commit is contained in:
2024-07-12 20:12:27 +00:00
parent f6e326869f
commit 2e8c58a53d

View File

@@ -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)