Merge branch 'refs/heads/develop' into tv
Conflicts: couchpotato/core/media/movie/_base/main.py couchpotato/core/providers/torrent/bitsoup/main.py couchpotato/core/providers/torrent/iptorrents/main.py couchpotato/core/providers/torrent/sceneaccess/main.py couchpotato/core/providers/torrent/torrentleech/main.py couchpotato/core/providers/torrent/torrentshack/main.py
This commit is contained in:
commit
2a2fe448e7
99 files changed
+7125
-3838
No files matched your search
@@ -32,14 +32,17 @@ class Movie(ModifierBase):
|
||||
'poster': [],
|
||||
'backdrop': [],
|
||||
'poster_original': [],
|
||||
'backdrop_original': []
|
||||
'backdrop_original': [],
|
||||
'actors': {}
|
||||
},
|
||||
'runtime': 0,
|
||||
'plot': '',
|
||||
'tagline': '',
|
||||
'imdb': '',
|
||||
'genres': [],
|
||||
'mpaa': None
|
||||
'mpaa': None,
|
||||
'actors': [],
|
||||
'actor_roles': {}
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -74,7 +74,7 @@ class CouchPotatoApi(MovieProvider):
|
||||
|
||||
return True
|
||||
|
||||
def getInfo(self, identifier = None):
|
||||
def getInfo(self, identifier = None, **kwargs):
|
||||
|
||||
if not identifier:
|
||||
return
|
||||
@@ -97,7 +97,7 @@ class CouchPotatoApi(MovieProvider):
|
||||
if not ignore: ignore = []
|
||||
if not movies: movies = []
|
||||
|
||||
suggestions = self.getJsonData(self.urls['suggest'], params = {
|
||||
suggestions = self.getJsonData(self.urls['suggest'], data = {
|
||||
'movies': ','.join(movies),
|
||||
'ignore': ','.join(ignore),
|
||||
}, headers = self.getRequestHeaders())
|
||||
|
||||
@@ -46,7 +46,7 @@ class OMDBAPI(MovieProvider):
|
||||
|
||||
return []
|
||||
|
||||
def getInfo(self, identifier = None):
|
||||
def getInfo(self, identifier = None, **kwargs):
|
||||
|
||||
if not identifier:
|
||||
return {}
|
||||
@@ -88,10 +88,6 @@ class OMDBAPI(MovieProvider):
|
||||
|
||||
year = tryInt(movie.get('Year', ''))
|
||||
|
||||
actors = {}
|
||||
for actor in splitString(movie.get('Actors', '')):
|
||||
actors[actor] = '' #omdb does not return actor roles
|
||||
|
||||
movie_data = {
|
||||
'type': 'movie',
|
||||
'via_imdb': True,
|
||||
@@ -113,7 +109,7 @@ class OMDBAPI(MovieProvider):
|
||||
'genres': splitString(movie.get('Genre', '')),
|
||||
'directors': splitString(movie.get('Director', '')),
|
||||
'writers': splitString(movie.get('Writer', '')),
|
||||
'actor_roles': actors,
|
||||
'actors': splitString(movie.get('Actors', '')),
|
||||
}
|
||||
movie_data = dict((k, v) for k, v in movie_data.iteritems() if v)
|
||||
except:
|
||||
|
||||
@@ -11,8 +11,8 @@ log = CPLog(__name__)
|
||||
class TheMovieDb(MovieProvider):
|
||||
|
||||
def __init__(self):
|
||||
addEvent('info.search', self.search, priority = 2)
|
||||
addEvent('movie.search', self.search, priority = 2)
|
||||
#addEvent('info.search', self.search, priority = 2)
|
||||
#addEvent('movie.search', self.search, priority = 2)
|
||||
addEvent('movie.info', self.getInfo, priority = 2)
|
||||
addEvent('movie.info_by_tmdb', self.getInfo)
|
||||
|
||||
@@ -45,7 +45,7 @@ class TheMovieDb(MovieProvider):
|
||||
nr = 0
|
||||
|
||||
for movie in raw:
|
||||
results.append(self.parseMovie(movie, with_titles = False))
|
||||
results.append(self.parseMovie(movie, extended = False))
|
||||
|
||||
nr += 1
|
||||
if nr == limit:
|
||||
@@ -61,7 +61,7 @@ class TheMovieDb(MovieProvider):
|
||||
|
||||
return results
|
||||
|
||||
def getInfo(self, identifier = None):
|
||||
def getInfo(self, identifier = None, extended = True):
|
||||
|
||||
if not identifier:
|
||||
return {}
|
||||
@@ -73,14 +73,14 @@ class TheMovieDb(MovieProvider):
|
||||
try:
|
||||
log.debug('Getting info: %s', cache_key)
|
||||
movie = tmdb3.Movie(identifier)
|
||||
result = self.parseMovie(movie)
|
||||
result = self.parseMovie(movie, extended = extended)
|
||||
self.setCache(cache_key, result)
|
||||
except:
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
def parseMovie(self, movie, with_titles = True):
|
||||
def parseMovie(self, movie, extended = True):
|
||||
|
||||
cache_key = 'tmdb.cache.%s' % movie.id
|
||||
movie_data = self.getCache(cache_key)
|
||||
@@ -97,6 +97,7 @@ class TheMovieDb(MovieProvider):
|
||||
#'backdrop': [backdrop] if backdrop else [],
|
||||
'poster_original': [poster_original] if poster_original else [],
|
||||
'backdrop_original': [backdrop_original] if backdrop_original else [],
|
||||
'actors': {}
|
||||
}
|
||||
|
||||
# Genres
|
||||
@@ -112,12 +113,13 @@ class TheMovieDb(MovieProvider):
|
||||
|
||||
# Gather actors data
|
||||
actors = {}
|
||||
for cast_item in movie.cast:
|
||||
try:
|
||||
actors[toUnicode(cast_item.name)] = toUnicode(cast_item.character)
|
||||
images['actor %s' % toUnicode(cast_item.name)] = self.getImage(cast_item, type = 'profile', size = 'original')
|
||||
except:
|
||||
log.debug('Error getting cast info for %s: %s', (cast_item, traceback.format_exc()))
|
||||
if extended:
|
||||
for cast_item in movie.cast:
|
||||
try:
|
||||
actors[toUnicode(cast_item.name)] = toUnicode(cast_item.character)
|
||||
images['actors'][toUnicode(cast_item.name)] = self.getImage(cast_item, type = 'profile', size = 'original')
|
||||
except:
|
||||
log.debug('Error getting cast info for %s: %s', (cast_item, traceback.format_exc()))
|
||||
|
||||
movie_data = {
|
||||
'type': 'movie',
|
||||
@@ -139,7 +141,7 @@ class TheMovieDb(MovieProvider):
|
||||
movie_data = dict((k, v) for k, v in movie_data.iteritems() if v)
|
||||
|
||||
# Add alternative names
|
||||
if with_titles:
|
||||
if extended:
|
||||
movie_data['titles'].append(movie.originaltitle)
|
||||
for alt in movie.alternate_titles:
|
||||
alt_name = alt.title
|
||||
|
||||
Reference in new issue
Block a user