mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Code cleanup
This commit is contained in:
parent
cbc466138f
commit
6967a8faef
@ -47,9 +47,9 @@ class ImageCache:
|
|||||||
|
|
||||||
def poster_path(self, indexer_id):
|
def poster_path(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Builds up the path to a poster cache for a given indexer id
|
Builds up the path to a poster cache for a given Indexer ID
|
||||||
|
|
||||||
returns: a full path to the cached poster file for the given indexer id
|
returns: a full path to the cached poster file for the given Indexer ID
|
||||||
|
|
||||||
indexer_id: ID of the show to use in the file name
|
indexer_id: ID of the show to use in the file name
|
||||||
"""
|
"""
|
||||||
@ -58,9 +58,9 @@ class ImageCache:
|
|||||||
|
|
||||||
def banner_path(self, indexer_id):
|
def banner_path(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Builds up the path to a banner cache for a given indexer id
|
Builds up the path to a banner cache for a given Indexer ID
|
||||||
|
|
||||||
returns: a full path to the cached banner file for the given indexer id
|
returns: a full path to the cached banner file for the given Indexer ID
|
||||||
|
|
||||||
indexer_id: ID of the show to use in the file name
|
indexer_id: ID of the show to use in the file name
|
||||||
"""
|
"""
|
||||||
@ -69,9 +69,9 @@ class ImageCache:
|
|||||||
|
|
||||||
def poster_thumb_path(self, indexer_id):
|
def poster_thumb_path(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Builds up the path to a poster cache for a given indexer id
|
Builds up the path to a poster cache for a given Indexer ID
|
||||||
|
|
||||||
returns: a full path to the cached poster file for the given indexer id
|
returns: a full path to the cached poster file for the given Indexer ID
|
||||||
|
|
||||||
indexer_id: ID of the show to use in the file name
|
indexer_id: ID of the show to use in the file name
|
||||||
"""
|
"""
|
||||||
@ -80,9 +80,9 @@ class ImageCache:
|
|||||||
|
|
||||||
def banner_thumb_path(self, indexer_id):
|
def banner_thumb_path(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Builds up the path to a poster cache for a given indexer id
|
Builds up the path to a poster cache for a given Indexer ID
|
||||||
|
|
||||||
returns: a full path to the cached poster file for the given indexer id
|
returns: a full path to the cached poster file for the given Indexer ID
|
||||||
|
|
||||||
indexer_id: ID of the show to use in the file name
|
indexer_id: ID of the show to use in the file name
|
||||||
"""
|
"""
|
||||||
@ -91,7 +91,7 @@ class ImageCache:
|
|||||||
|
|
||||||
def has_poster(self, indexer_id):
|
def has_poster(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Returns true if a cached poster exists for the given indexer id
|
Returns true if a cached poster exists for the given Indexer ID
|
||||||
"""
|
"""
|
||||||
poster_path = self.poster_path(indexer_id)
|
poster_path = self.poster_path(indexer_id)
|
||||||
logger.log(u"Checking if file " + str(poster_path) + " exists", logger.DEBUG)
|
logger.log(u"Checking if file " + str(poster_path) + " exists", logger.DEBUG)
|
||||||
@ -99,7 +99,7 @@ class ImageCache:
|
|||||||
|
|
||||||
def has_banner(self, indexer_id):
|
def has_banner(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Returns true if a cached banner exists for the given indexer id
|
Returns true if a cached banner exists for the given Indexer ID
|
||||||
"""
|
"""
|
||||||
banner_path = self.banner_path(indexer_id)
|
banner_path = self.banner_path(indexer_id)
|
||||||
logger.log(u"Checking if file " + str(banner_path) + " exists", logger.DEBUG)
|
logger.log(u"Checking if file " + str(banner_path) + " exists", logger.DEBUG)
|
||||||
@ -107,7 +107,7 @@ class ImageCache:
|
|||||||
|
|
||||||
def has_poster_thumbnail(self, indexer_id):
|
def has_poster_thumbnail(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Returns true if a cached poster thumbnail exists for the given indexer id
|
Returns true if a cached poster thumbnail exists for the given Indexer ID
|
||||||
"""
|
"""
|
||||||
poster_thumb_path = self.poster_thumb_path(indexer_id)
|
poster_thumb_path = self.poster_thumb_path(indexer_id)
|
||||||
logger.log(u"Checking if file " + str(poster_thumb_path) + " exists", logger.DEBUG)
|
logger.log(u"Checking if file " + str(poster_thumb_path) + " exists", logger.DEBUG)
|
||||||
@ -115,7 +115,7 @@ class ImageCache:
|
|||||||
|
|
||||||
def has_banner_thumbnail(self, indexer_id):
|
def has_banner_thumbnail(self, indexer_id):
|
||||||
"""
|
"""
|
||||||
Returns true if a cached banner exists for the given indexer id
|
Returns true if a cached banner exists for the given Indexer ID
|
||||||
"""
|
"""
|
||||||
banner_thumb_path = self.banner_thumb_path(indexer_id)
|
banner_thumb_path = self.banner_thumb_path(indexer_id)
|
||||||
logger.log(u"Checking if file " + str(banner_thumb_path) + " exists", logger.DEBUG)
|
logger.log(u"Checking if file " + str(banner_thumb_path) + " exists", logger.DEBUG)
|
||||||
|
@ -917,7 +917,7 @@ class GenericMetadata():
|
|||||||
return empty_return
|
return empty_return
|
||||||
|
|
||||||
if indexer_id is None:
|
if indexer_id is None:
|
||||||
logger.log(u"Invalid indexer ID (" + str(indexer_id) + "), not using metadata file", logger.WARNING)
|
logger.log(u"Invalid Indexer ID (" + str(indexer_id) + "), not using metadata file", logger.WARNING)
|
||||||
return empty_return
|
return empty_return
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
@ -509,7 +509,7 @@ class PostProcessor(object):
|
|||||||
self._log(u"Checking scene exceptions for a match on " + cur_name, logger.DEBUG)
|
self._log(u"Checking scene exceptions for a match on " + cur_name, logger.DEBUG)
|
||||||
scene_id = scene_exceptions.get_scene_exception_by_name(cur_name)
|
scene_id = scene_exceptions.get_scene_exception_by_name(cur_name)
|
||||||
if scene_id:
|
if scene_id:
|
||||||
self._log(u"Scene exception lookup got a indexer id " + str(scene_id) + ", using that", logger.DEBUG)
|
self._log(u"Scene exception lookup got a Indexer ID " + str(scene_id) + ", using that", logger.DEBUG)
|
||||||
_finalize(parse_result)
|
_finalize(parse_result)
|
||||||
return (scene_id, season, episodes)
|
return (scene_id, season, episodes)
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ def get_scene_exception_by_name(show_name):
|
|||||||
|
|
||||||
if show_name.lower() in (
|
if show_name.lower() in (
|
||||||
cur_exception_name.lower(), helpers.sanitizeSceneName(cur_exception_name).lower().replace('.', ' ')):
|
cur_exception_name.lower(), helpers.sanitizeSceneName(cur_exception_name).lower().replace('.', ' ')):
|
||||||
logger.log(u"Scene exception lookup got indexer id " + str(cur_indexer_id) + u", using that", logger.DEBUG)
|
logger.log(u"Scene exception lookup got Indexer ID " + str(cur_indexer_id) + u", using that", logger.DEBUG)
|
||||||
return cur_indexer_id
|
return cur_indexer_id
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
@ -237,7 +237,7 @@ class QueueItemAdd(ShowQueueItem):
|
|||||||
ShowQueueItem.execute(self)
|
ShowQueueItem.execute(self)
|
||||||
|
|
||||||
logger.log(u"Starting to add show " + self.showDir)
|
logger.log(u"Starting to add show " + self.showDir)
|
||||||
# make sure the indexer ids are valid
|
# make sure the Indexer IDs are valid
|
||||||
try:
|
try:
|
||||||
|
|
||||||
lINDEXER_API_PARMS = sickbeard.indexerApi(self.indexer).api_params.copy()
|
lINDEXER_API_PARMS = sickbeard.indexerApi(self.indexer).api_params.copy()
|
||||||
@ -249,7 +249,7 @@ class QueueItemAdd(ShowQueueItem):
|
|||||||
t = sickbeard.indexerApi(self.indexer).indexer(**lINDEXER_API_PARMS)
|
t = sickbeard.indexerApi(self.indexer).indexer(**lINDEXER_API_PARMS)
|
||||||
s = t[self.indexer_id]
|
s = t[self.indexer_id]
|
||||||
|
|
||||||
# this usually only happens if they have an NFO in their show dir which gave us a indexer ID that has no proper english version of the show
|
# this usually only happens if they have an NFO in their show dir which gave us a Indexer ID that has no proper english version of the show
|
||||||
if getattr(s, 'seriesname', None) is None:
|
if getattr(s, 'seriesname', None) is None:
|
||||||
logger.log(u"Show in " + self.showDir + " has no name on " + sickbeard.indexerApi(
|
logger.log(u"Show in " + self.showDir + " has no name on " + sickbeard.indexerApi(
|
||||||
self.indexer).name + ", probably the wrong language used to search with.", logger.ERROR)
|
self.indexer).name + ", probably the wrong language used to search with.", logger.ERROR)
|
||||||
|
@ -222,7 +222,7 @@ class TVCache():
|
|||||||
if not indexer_id:
|
if not indexer_id:
|
||||||
# check the name cache and see if we already know what show this is
|
# check the name cache and see if we already know what show this is
|
||||||
logger.log(
|
logger.log(
|
||||||
u"Checking the cache to see if we already know the indexer id of " + parse_result.series_name,
|
u"Checking the cache to see if we already know the Indexer ID of " + parse_result.series_name,
|
||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
indexer_id = name_cache.retrieveNameFromCache(parse_result.series_name)
|
indexer_id = name_cache.retrieveNameFromCache(parse_result.series_name)
|
||||||
|
|
||||||
|
@ -2164,7 +2164,7 @@ class NewHomeAddShows:
|
|||||||
|
|
||||||
# sanity check on our inputs
|
# sanity check on our inputs
|
||||||
if (not rootDir and not fullShowPath) or not whichSeries:
|
if (not rootDir and not fullShowPath) or not whichSeries:
|
||||||
return "Missing params, no indexer id or folder:" + repr(whichSeries) + " and " + repr(
|
return "Missing params, no Indexer ID or folder:" + repr(whichSeries) + " and " + repr(
|
||||||
rootDir) + "/" + repr(fullShowPath)
|
rootDir) + "/" + repr(fullShowPath)
|
||||||
|
|
||||||
# figure out what show we're adding and where
|
# figure out what show we're adding and where
|
||||||
|
Loading…
Reference in New Issue
Block a user