sane-tag-music: special-case some romanizations
This commit is contained in:
@@ -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"),
|
||||
|
Reference in New Issue
Block a user