sane-tag-music: allow clearing any tag

This commit is contained in:
2024-07-11 02:53:00 +00:00
parent e47bc4c04d
commit 672de68e56

View File

@@ -642,11 +642,19 @@ class Tagger:
# manual_tags > old_tags > path_tags
# old_tags overrule path_tags
new_tags = self.manual_tags.union(old_tags).union(path_tags)
if self.manual_tags.tracknumber == [""]:
# special case that `--trackno ""` can be used to delete the track number without `--force`ing all fields
new_tags.tracknumber = []
# special case that explicitly supplying empty tags should delete the existing
if self.manual_tags.album == [""]:
new_tags.album = []
if self.manual_tags.albumartist == [""]:
new_tags.albumartist = []
if self.manual_tags.artist == [""]:
new_tags.artist = []
if self.manual_tags.producer == [""]:
new_tags.producer = []
if self.manual_tags.title == [""]:
new_tags.title = []
if self.manual_tags.tracknumber == [""]:
new_tags.tracknumber = []
new_tags.trim_fields()
new_tags.cleanup_trackno()
new_tags.expand_shorthands()