Remove non-used items from imdbapi
This commit is contained in:
@@ -47,8 +47,9 @@ class IMDBAPI(MovieProvider):
|
|||||||
|
|
||||||
if cached:
|
if cached:
|
||||||
result = self.parseMovie(cached)
|
result = self.parseMovie(cached)
|
||||||
log.info('Found: %s' % result['titles'][0] + ' (' + str(result['year']) + ')')
|
if result.get('titles') and len(result.get('titles')) > 0:
|
||||||
return result
|
log.info('Found: %s' % result['titles'][0] + ' (' + str(result['year']) + ')')
|
||||||
|
return result
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
@@ -60,6 +61,11 @@ class IMDBAPI(MovieProvider):
|
|||||||
if isinstance(movie, (str, unicode)):
|
if isinstance(movie, (str, unicode)):
|
||||||
movie = json.loads(movie)
|
movie = json.loads(movie)
|
||||||
|
|
||||||
|
tmp_movie = movie.copy()
|
||||||
|
for key in tmp_movie:
|
||||||
|
if tmp_movie.get(key).lower() == 'n/a':
|
||||||
|
del movie[key]
|
||||||
|
|
||||||
movie_data = {
|
movie_data = {
|
||||||
'titles': [movie.get('Title', '')],
|
'titles': [movie.get('Title', '')],
|
||||||
'original_title': movie.get('Title', ''),
|
'original_title': movie.get('Title', ''),
|
||||||
|
|||||||
Reference in New Issue
Block a user