diff --git a/pkgs/additional/sane-scripts/src/sane-tag-music b/pkgs/additional/sane-scripts/src/sane-tag-music index 0fe593adb..d1ad0cc9f 100755 --- a/pkgs/additional/sane-scripts/src/sane-tag-music +++ b/pkgs/additional/sane-scripts/src/sane-tag-music @@ -82,8 +82,13 @@ def clean_for_fs(a: str, single_field: bool=False) -> str: preserve = 'abcdefghijklmnopqrstuvwxyz0123456789._-' # ampersand, like: PLS&TY; &I a = a.replace("&", "And") - a = a.replace("é", "e") + a = a.replace("かめりあ", "Camellia") # else `unidecode` sets it to kameria a = unidecode(a) + # these diacritic replacements might be unnecessary now that i'm using unidecode? + a = a.replace("é", "e") + a = a.replace("ä", "a") + a = a.replace("ö", "o") + a = a.replace("ü", "u") a = a.strip() a = a.replace(" ", ".") if single_field: @@ -425,16 +430,13 @@ class ImageFile(MediaFile): return ImageFile._exiftool def tags_on_disk(self) -> Tags: - # print(self.exif) - def get_tag(name: str) -> list: - if name in self.exif: - return [ self.exif[name] ] - elif f"EXIF:{name}" in self.exif: - return [ self.exif[f"EXIF:{name}"] ] - elif f"XMP:{name}" in self.exif: - return [ self.exif[f"XMP:{name}"] ] + def get_tag_(name: str) -> list: + if self.exif.get(name) is not None: + return [ str(self.exif[name]) ] else: return [] + def get_tag(name: str) -> list: + return get_tag_(name) + get_tag_(f"EXIF:{name}") + get_tag_(f"XMP:{name}") return Tags( artist=get_tag("Photographer"),