flatten list of lists

This commit is contained in:
j 2018-01-14 18:42:01 +01:00
parent 2a03726c39
commit 48cc9aa541

View file

@ -289,7 +289,7 @@ class Imdb(SiteParser):
isinstance(self['alternativeTitles'][0], string_types): isinstance(self['alternativeTitles'][0], string_types):
self['alternativeTitles'] = [self['alternativeTitles']] self['alternativeTitles'] = [self['alternativeTitles']]
for key in ('country', 'genre'): for key in ('country', 'genre', 'language'):
if key in self: if key in self:
self[key] = [x[0] if len(x) == 1 and isinstance(x, list) else x for x in self[key]] self[key] = [x[0] if len(x) == 1 and isinstance(x, list) else x for x in self[key]]
self[key] = list(filter(lambda x: x.lower() != 'home', self[key])) self[key] = list(filter(lambda x: x.lower() != 'home', self[key]))