sane-tag-music: include the artist in the filename for compilation albums

This commit is contained in:
2024-07-13 02:47:09 +00:00
parent 0e5f01f240
commit e38c2f20e8

View File

@@ -428,8 +428,14 @@ class Tags:
album = clean_fields_for_fs(self.album)
trackno = self.tracknumber and clean_fields_for_fs(self.tracknumber)
trackno = [f"{trackno:>02}"] if trackno else []
if self.artist and self.albumartist == [ "Various Artists" ] \
and self.artist != [ "Various Artists" ] \
and self.artist != self.album:
artist_prefix = self.artist
else:
artist_prefix = []
title = clean_fields_for_fs(self.title)
filename = clean_fields_for_fs(trackno + [ f"{title}.{ext}" ])
filename = clean_fields_for_fs(trackno + artist_prefix + [ f"{title}.{ext}" ])
if is_artist_item:
return os.path.join(artist, filename)