CC-5856: Analyzer metadata exception
* Fixed parsing of metadata when there's empty lists returned (mutagen's API is awful) * Return HTTP 422 if there's any exception in validating the metadata
This commit is contained in:
parent
4548123ad9
commit
a969f8fc44
2 changed files with 31 additions and 24 deletions
|
@ -132,7 +132,10 @@ class MetadataAnalyzer(Analyzer):
|
|||
# Some tags are returned as lists because there could be multiple values.
|
||||
# This is unusual so we're going to always just take the first item in the list.
|
||||
if isinstance(metadata[airtime_tag], list):
|
||||
metadata[airtime_tag] = metadata[airtime_tag][0]
|
||||
if metadata[airtime_tag]:
|
||||
metadata[airtime_tag] = metadata[airtime_tag][0]
|
||||
else: # Handle empty lists
|
||||
metadata[airtime_tag] = ""
|
||||
|
||||
except KeyError:
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue