Adds sanity check to prevent uncontrolled exception from untagged imported tracks (!1382)

1218-smartplaylist_backend
Marcos Peña 2021-10-17 10:41:03 +00:00 zatwierdzone przez JuniorJPDJ
rodzic ae56890fa3
commit b942ed7a62
2 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -357,6 +357,8 @@ class Metadata(Mapping):
self._file = kind(filething)
if self._file is None:
raise ValueError("Cannot parse metadata from {}".format(filething))
if len(self._file) == 0:
raise ValueError("No tags found in {}".format(filething))
self.fallback = self.load_fallback(filething, self._file)
ft = self.get_file_type(self._file)
try:

Wyświetl plik

@ -0,0 +1 @@
Prevents an uncontrolled exception when uploading a file without tags, and prints user friendly message (1275)