Remove non-used items from imdbapi
This commit is contained in:
1 parent
93eecc614c
commit
bb27d0a18b
1 file changed
+6
@@ -47,6 +47,7 @@ class IMDBAPI(MovieProvider):
|
|||||||
|
|
||||||
if cached:
|
if cached:
|
||||||
result = self.parseMovie(cached)
|
result = self.parseMovie(cached)
|
||||||
|
if result.get('titles') and len(result.get('titles')) > 0:
|
||||||
log.info('Found: %s' % result['titles'][0] + ' (' + str(result['year']) + ')')
|
log.info('Found: %s' % result['titles'][0] + ' (' + str(result['year']) + ')')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -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