handle error when reading using mutagen

This commit is contained in:
bkfox 2023-01-29 12:42:01 +01:00
parent c2cd3b0301
commit e9e363a13a

View File

@ -149,7 +149,12 @@ class SoundFile:
def read_file_info(self):
""" Read file information and metadata. """
return mutagen.File(self.path) if os.path.exists(self.path) else None
try:
if os.path.exists(self.path):
return mutagen.File(self.path)
except Exception:
pass
return None
def find_episode(self, sound, path_info):
"""