mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Misc fixes and code cleanups.
This commit is contained in:
parent
a9f142184a
commit
08d8beffa4
6 changed files with 59 additions and 51 deletions
|
@ -10,11 +10,11 @@
|
||||||
#set $myDB = $db.DBConnection()
|
#set $myDB = $db.DBConnection()
|
||||||
#set $today = str($datetime.date.today().toordinal())
|
#set $today = str($datetime.date.today().toordinal())
|
||||||
#set $numShows = len($sickbeard.showList)
|
#set $numShows = len($sickbeard.showList)
|
||||||
#set $numGoodShows = len([x for x in $sickbeard.showList if x.paused == 0 and x.status != "Ended"])
|
#set $numGoodShows = len([x for x in $sickbeard.showList if x.paused == 0 and "Ended" not in x.status])
|
||||||
#set $numDLEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE status IN ("+",".join([str(x) for x in $Quality.DOWNLOADED + [$ARCHIVED]])+") AND season != 0 and episode != 0 AND airdate <= "+$today+"")[0][0]
|
#set $numDLEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE status IN ("+",".join([str(x) for x in $Quality.DOWNLOADED + [$ARCHIVED]])+") AND season != 0 and episode != 0 AND airdate <= "+$today+"")[0][0]
|
||||||
#set $numEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE season != 0 and episode != 0 AND (airdate != 1 OR status IN ("+",".join([str(x) for x in ($Quality.DOWNLOADED + $Quality.SNATCHED + $Quality.SNATCHED_PROPER) + [$ARCHIVED]])+")) AND airdate <= "+$today+" AND status != "+str($IGNORED)+"")[0][0]
|
#set $numEpisodes = $myDB.select("SELECT COUNT(*) FROM tv_episodes WHERE season != 0 and episode != 0 AND (airdate != 1 OR status IN ("+",".join([str(x) for x in ($Quality.DOWNLOADED + $Quality.SNATCHED + $Quality.SNATCHED_PROPER) + [$ARCHIVED]])+")) AND airdate <= "+$today+" AND status != "+str($IGNORED)+"")[0][0]
|
||||||
<b>$numShows shows</b> ($numGoodShows active) | <b>$numDLEpisodes/$numEpisodes</b> episodes downloaded |
|
<b>$numShows shows</b> ($numGoodShows active) | <b>$numDLEpisodes/$numEpisodes</b> episodes downloaded |
|
||||||
<b>Daily Search</b>: <%=str(sickbeard.dailySearchScheduler.timeLeft()).split('.')[0]%> |
|
<b>Search</b>: <%=str(sickbeard.dailySearchScheduler.timeLeft()).split('.')[0]%> |
|
||||||
<b>Backlog</b>: $sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())
|
<b>Backlog</b>: $sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())
|
||||||
</div>
|
</div>
|
||||||
<ul style="float:right;">
|
<ul style="float:right;">
|
||||||
|
|
|
@ -29,7 +29,7 @@ class rTorrentAPI(GenericClient):
|
||||||
super(rTorrentAPI, self).__init__('rTorrent', host, username, password)
|
super(rTorrentAPI, self).__init__('rTorrent', host, username, password)
|
||||||
|
|
||||||
def _get_auth(self):
|
def _get_auth(self):
|
||||||
auth = None
|
self.auth = None
|
||||||
|
|
||||||
if self.auth is not None:
|
if self.auth is not None:
|
||||||
return self.auth
|
return self.auth
|
||||||
|
|
|
@ -437,7 +437,7 @@ class ConfigMigrator():
|
||||||
else:
|
else:
|
||||||
logger.log(u"Proceeding with upgrade")
|
logger.log(u"Proceeding with upgrade")
|
||||||
|
|
||||||
# do the migration, expect a method named _migrate_v<num>
|
# do the migration, expect a method named _migrate_v<num>
|
||||||
logger.log(u"Migrating config up to version " + str(next_version) + migration_name)
|
logger.log(u"Migrating config up to version " + str(next_version) + migration_name)
|
||||||
getattr(self, '_migrate_v' + str(next_version))()
|
getattr(self, '_migrate_v' + str(next_version))()
|
||||||
self.config_version = next_version
|
self.config_version = next_version
|
||||||
|
|
|
@ -50,7 +50,7 @@ class DBConnection:
|
||||||
def __init__(self, filename="sickbeard.db", suffix=None, row_type=None):
|
def __init__(self, filename="sickbeard.db", suffix=None, row_type=None):
|
||||||
|
|
||||||
self.filename = filename
|
self.filename = filename
|
||||||
self.connection = sqlite3.connect(dbFilename(filename), 20)
|
self.connection = sqlite3.connect(dbFilename(filename, suffix), 20)
|
||||||
if row_type == "dict":
|
if row_type == "dict":
|
||||||
self.connection.row_factory = self._dict_factory
|
self.connection.row_factory = self._dict_factory
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -99,8 +99,7 @@ def get_scene_absolute_numbering(indexer_id, indexer, absolute_number, fallback_
|
||||||
(so the return values will always be set)
|
(so the return values will always be set)
|
||||||
|
|
||||||
@param indexer_id: int
|
@param indexer_id: int
|
||||||
@param season: int
|
@param absolute_number: int
|
||||||
@param episode: int
|
|
||||||
@param fallback_to_xem: bool If set (the default), check xem for matches if there is no local scene numbering
|
@param fallback_to_xem: bool If set (the default), check xem for matches if there is no local scene numbering
|
||||||
@return: (int, int) a tuple with (season, episode)
|
@return: (int, int) a tuple with (season, episode)
|
||||||
"""
|
"""
|
||||||
|
@ -258,9 +257,8 @@ def find_xem_absolute_numbering(indexer_id, indexer, absolute_number):
|
||||||
Refreshes/Loads as needed.
|
Refreshes/Loads as needed.
|
||||||
|
|
||||||
@param indexer_id: int
|
@param indexer_id: int
|
||||||
@param season: int
|
@param absolute_number: int
|
||||||
@param episode: int
|
@return: int
|
||||||
@return: (int, int) a tuple of scene_season, scene_episode, or None if there is no special mapping.
|
|
||||||
"""
|
"""
|
||||||
if indexer_id is None or absolute_number is None:
|
if indexer_id is None or absolute_number is None:
|
||||||
return absolute_number
|
return absolute_number
|
||||||
|
@ -313,9 +311,8 @@ def get_indexer_absolute_numbering_for_xem(indexer_id, indexer, sceneAbsoluteNum
|
||||||
Reverse of find_xem_numbering: lookup a tvdb season and episode using scene numbering
|
Reverse of find_xem_numbering: lookup a tvdb season and episode using scene numbering
|
||||||
|
|
||||||
@param indexer_id: int
|
@param indexer_id: int
|
||||||
@param sceneSeason: int
|
@param sceneAbsoluteNumber: int
|
||||||
@param sceneEpisode: int
|
@return: int
|
||||||
@return: (int, int) a tuple of (season, episode)
|
|
||||||
"""
|
"""
|
||||||
if indexer_id is None or sceneAbsoluteNumber is None:
|
if indexer_id is None or sceneAbsoluteNumber is None:
|
||||||
return sceneAbsoluteNumber
|
return sceneAbsoluteNumber
|
||||||
|
|
|
@ -28,6 +28,7 @@ import datetime
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from Cheetah.Template import Template
|
from Cheetah.Template import Template
|
||||||
|
from cherrypy.lib.static import serve_fileobj
|
||||||
import cherrypy
|
import cherrypy
|
||||||
import cherrypy.lib
|
import cherrypy.lib
|
||||||
import cherrypy.lib.cptools
|
import cherrypy.lib.cptools
|
||||||
|
@ -78,12 +79,15 @@ except ImportError:
|
||||||
from sickbeard import browser
|
from sickbeard import browser
|
||||||
from lib import adba
|
from lib import adba
|
||||||
|
|
||||||
|
|
||||||
def _handle_reverse_proxy():
|
def _handle_reverse_proxy():
|
||||||
if sickbeard.HANDLE_REVERSE_PROXY:
|
if sickbeard.HANDLE_REVERSE_PROXY:
|
||||||
cherrypy.lib.cptools.proxy()
|
cherrypy.lib.cptools.proxy()
|
||||||
|
|
||||||
|
|
||||||
cherrypy.tools.handle_reverse_proxy = cherrypy.Tool('before_handler', _handle_reverse_proxy)
|
cherrypy.tools.handle_reverse_proxy = cherrypy.Tool('before_handler', _handle_reverse_proxy)
|
||||||
|
|
||||||
|
|
||||||
class PageTemplate(Template):
|
class PageTemplate(Template):
|
||||||
def __init__(self, *args, **KWs):
|
def __init__(self, *args, **KWs):
|
||||||
KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/",
|
KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/",
|
||||||
|
@ -205,7 +209,7 @@ class ManageSearches:
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def index(self):
|
def index(self):
|
||||||
t = PageTemplate(file="manage_manageSearches.tmpl")
|
t = PageTemplate(file="manage_manageSearches.tmpl")
|
||||||
#t.backlogPI = sickbeard.backlogSearchScheduler.action.getProgressIndicator()
|
# t.backlogPI = sickbeard.backlogSearchScheduler.action.getProgressIndicator()
|
||||||
t.backlogPaused = sickbeard.searchQueueScheduler.action.is_backlog_paused() # @UndefinedVariable
|
t.backlogPaused = sickbeard.searchQueueScheduler.action.is_backlog_paused() # @UndefinedVariable
|
||||||
t.backlogRunning = sickbeard.searchQueueScheduler.action.is_backlog_in_progress() # @UndefinedVariable
|
t.backlogRunning = sickbeard.searchQueueScheduler.action.is_backlog_in_progress() # @UndefinedVariable
|
||||||
t.dailySearchStatus = sickbeard.dailySearchScheduler.action.amActive # @UndefinedVariable
|
t.dailySearchStatus = sickbeard.dailySearchScheduler.action.amActive # @UndefinedVariable
|
||||||
|
@ -638,7 +642,8 @@ class Manage:
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def massEditSubmit(self, paused=None, anime=None, scene=None, flatten_folders=None, quality_preset=False, subtitles=None,
|
def massEditSubmit(self, paused=None, anime=None, scene=None, flatten_folders=None, quality_preset=False,
|
||||||
|
subtitles=None,
|
||||||
anyQualities=[], bestQualities=[], toEdit=None, *args, **kwargs):
|
anyQualities=[], bestQualities=[], toEdit=None, *args, **kwargs):
|
||||||
|
|
||||||
dir_map = {}
|
dir_map = {}
|
||||||
|
@ -884,7 +889,7 @@ class History:
|
||||||
|
|
||||||
myDB = db.DBConnection()
|
myDB = db.DBConnection()
|
||||||
|
|
||||||
#sqlResults = myDB.select("SELECT h.*, show_name, name FROM history h, tv_shows s, tv_episodes e WHERE h.showid=s.indexer_id AND h.showid=e.showid AND h.season=e.season AND h.episode=e.episode ORDER BY date DESC LIMIT "+str(numPerPage*(p-1))+", "+str(numPerPage))
|
# sqlResults = myDB.select("SELECT h.*, show_name, name FROM history h, tv_shows s, tv_episodes e WHERE h.showid=s.indexer_id AND h.showid=e.showid AND h.season=e.season AND h.episode=e.episode ORDER BY date DESC LIMIT "+str(numPerPage*(p-1))+", "+str(numPerPage))
|
||||||
if limit == "0":
|
if limit == "0":
|
||||||
sqlResults = myDB.select(
|
sqlResults = myDB.select(
|
||||||
"SELECT h.*, show_name FROM history h, tv_shows s WHERE h.showid=s.indexer_id ORDER BY date DESC")
|
"SELECT h.*, show_name FROM history h, tv_shows s WHERE h.showid=s.indexer_id ORDER BY date DESC")
|
||||||
|
@ -926,9 +931,9 @@ class History:
|
||||||
else:
|
else:
|
||||||
index = [i for i, dict in enumerate(compact) \
|
index = [i for i, dict in enumerate(compact) \
|
||||||
if dict['show_id'] == sql_result['showid'] \
|
if dict['show_id'] == sql_result['showid'] \
|
||||||
and dict['season'] == sql_result['season'] \
|
and dict['season'] == sql_result['season'] \
|
||||||
and dict['episode'] == sql_result['episode']
|
and dict['episode'] == sql_result['episode']
|
||||||
and dict['quality'] == sql_result['quality']][0]
|
and dict['quality'] == sql_result['quality']][0]
|
||||||
|
|
||||||
action = {}
|
action = {}
|
||||||
history = compact[index]
|
history = compact[index]
|
||||||
|
@ -1596,7 +1601,8 @@ class ConfigProviders:
|
||||||
curProvider, curEnabled = curProviderStr.split(':')
|
curProvider, curEnabled = curProviderStr.split(':')
|
||||||
curEnabled = config.to_int(curEnabled)
|
curEnabled = config.to_int(curEnabled)
|
||||||
|
|
||||||
curProvObj = [x for x in sickbeard.providers.sortedProviderList() if x.getID() == curProvider and hasattr(x, 'enabled')]
|
curProvObj = [x for x in sickbeard.providers.sortedProviderList() if
|
||||||
|
x.getID() == curProvider and hasattr(x, 'enabled')]
|
||||||
if curProvObj:
|
if curProvObj:
|
||||||
curProvObj[0].enabled = bool(curEnabled)
|
curProvObj[0].enabled = bool(curEnabled)
|
||||||
|
|
||||||
|
@ -2025,8 +2031,8 @@ class ConfigSubtitles:
|
||||||
|
|
||||||
redirect("/config/subtitles/")
|
redirect("/config/subtitles/")
|
||||||
|
|
||||||
class ConfigAnime:
|
|
||||||
|
|
||||||
|
class ConfigAnime:
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def index(self):
|
def index(self):
|
||||||
|
|
||||||
|
@ -2035,7 +2041,8 @@ class ConfigAnime:
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def saveAnime(self, use_anidb=None, anidb_username=None, anidb_password=None, anidb_use_mylist=None, split_home=None):
|
def saveAnime(self, use_anidb=None, anidb_username=None, anidb_password=None, anidb_use_mylist=None,
|
||||||
|
split_home=None):
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
|
@ -2066,12 +2073,13 @@ class ConfigAnime:
|
||||||
for x in results:
|
for x in results:
|
||||||
logger.log(x, logger.ERROR)
|
logger.log(x, logger.ERROR)
|
||||||
ui.notifications.error('Error(s) Saving Configuration',
|
ui.notifications.error('Error(s) Saving Configuration',
|
||||||
'<br />\n'.join(results))
|
'<br />\n'.join(results))
|
||||||
else:
|
else:
|
||||||
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE) )
|
ui.notifications.message('Configuration Saved', ek.ek(os.path.join, sickbeard.CONFIG_FILE))
|
||||||
|
|
||||||
redirect("/config/anime/")
|
redirect("/config/anime/")
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def index(self):
|
def index(self):
|
||||||
|
@ -2094,6 +2102,7 @@ class Config:
|
||||||
|
|
||||||
anime = ConfigAnime()
|
anime = ConfigAnime()
|
||||||
|
|
||||||
|
|
||||||
def haveXBMC():
|
def haveXBMC():
|
||||||
return sickbeard.USE_XBMC and sickbeard.XBMC_UPDATE_LIBRARY
|
return sickbeard.USE_XBMC and sickbeard.XBMC_UPDATE_LIBRARY
|
||||||
|
|
||||||
|
@ -2192,7 +2201,7 @@ class NewHomeAddShows:
|
||||||
lang = "en"
|
lang = "en"
|
||||||
|
|
||||||
search_term = search_term.encode('utf-8')
|
search_term = search_term.encode('utf-8')
|
||||||
|
|
||||||
results = {}
|
results = {}
|
||||||
final_results = []
|
final_results = []
|
||||||
|
|
||||||
|
@ -2204,7 +2213,7 @@ class NewHomeAddShows:
|
||||||
t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)
|
t = sickbeard.indexerApi(indexer).indexer(**lINDEXER_API_PARMS)
|
||||||
|
|
||||||
logger.log("Searching for Show with searchterm: %s on Indexer: %s" % (
|
logger.log("Searching for Show with searchterm: %s on Indexer: %s" % (
|
||||||
search_term, sickbeard.indexerApi(indexer).name), logger.DEBUG)
|
search_term, sickbeard.indexerApi(indexer).name), logger.DEBUG)
|
||||||
try:
|
try:
|
||||||
# add search results
|
# add search results
|
||||||
results.setdefault(indexer, []).extend(t[search_term])
|
results.setdefault(indexer, []).extend(t[search_term])
|
||||||
|
@ -2213,8 +2222,7 @@ class NewHomeAddShows:
|
||||||
|
|
||||||
map(final_results.extend,
|
map(final_results.extend,
|
||||||
([[sickbeard.indexerApi(id).name, id, sickbeard.indexerApi(id).config["show_url"], int(show['id']),
|
([[sickbeard.indexerApi(id).name, id, sickbeard.indexerApi(id).config["show_url"], int(show['id']),
|
||||||
show['seriesname'], show['firstaired']] for show in shows] for id, shows in
|
show['seriesname'], show['firstaired']] for show in shows] for id, shows in results.items()))
|
||||||
results.items()))
|
|
||||||
|
|
||||||
lang_id = sickbeard.indexerApi().config['langabbv_to_id'][lang]
|
lang_id = sickbeard.indexerApi().config['langabbv_to_id'][lang]
|
||||||
return json.dumps({'results': final_results, 'langid': lang_id})
|
return json.dumps({'results': final_results, 'langid': lang_id})
|
||||||
|
@ -2454,7 +2462,8 @@ class NewHomeAddShows:
|
||||||
|
|
||||||
# add the show
|
# add the show
|
||||||
sickbeard.showQueueScheduler.action.addShow(indexer, indexer_id, show_dir, int(defaultStatus), newQuality,
|
sickbeard.showQueueScheduler.action.addShow(indexer, indexer_id, show_dir, int(defaultStatus), newQuality,
|
||||||
flatten_folders, subtitles, indexerLang, anime, scene) # @UndefinedVariable
|
flatten_folders, subtitles, indexerLang, anime,
|
||||||
|
scene) # @UndefinedVariable
|
||||||
ui.notifications.message('Show added', 'Adding the specified show into ' + show_dir)
|
ui.notifications.message('Show added', 'Adding the specified show into ' + show_dir)
|
||||||
|
|
||||||
return finishAddShow()
|
return finishAddShow()
|
||||||
|
@ -2544,7 +2553,7 @@ class NewHomeAddShows:
|
||||||
|
|
||||||
ErrorLogsMenu = [
|
ErrorLogsMenu = [
|
||||||
{'title': 'Clear Errors', 'path': 'errorlogs/clearerrors/'},
|
{'title': 'Clear Errors', 'path': 'errorlogs/clearerrors/'},
|
||||||
#{ 'title': 'View Log', 'path': 'errorlogs/viewlog' },
|
# { 'title': 'View Log', 'path': 'errorlogs/viewlog' },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -2639,7 +2648,6 @@ class Home:
|
||||||
def index(self):
|
def index(self):
|
||||||
|
|
||||||
t = PageTemplate(file="home.tmpl")
|
t = PageTemplate(file="home.tmpl")
|
||||||
|
|
||||||
if sickbeard.ANIME_SPLIT_HOME:
|
if sickbeard.ANIME_SPLIT_HOME:
|
||||||
shows = []
|
shows = []
|
||||||
anime = []
|
anime = []
|
||||||
|
@ -2648,10 +2656,10 @@ class Home:
|
||||||
anime.append(show)
|
anime.append(show)
|
||||||
else:
|
else:
|
||||||
shows.append(show)
|
shows.append(show)
|
||||||
t.showlists = [["Shows",shows],
|
t.showlists = [["Shows", shows],
|
||||||
["Anime",anime]]
|
["Anime", anime]]
|
||||||
else:
|
else:
|
||||||
t.showlists = [["Shows",sickbeard.showList]]
|
t.showlists = [["Shows", sickbeard.showList]]
|
||||||
|
|
||||||
t.submenu = HomeMenu()
|
t.submenu = HomeMenu()
|
||||||
return _munge(t)
|
return _munge(t)
|
||||||
|
@ -2666,7 +2674,7 @@ class Home:
|
||||||
|
|
||||||
connection, accesMsg = sab.getSabAccesMethod(host, username, password, apikey)
|
connection, accesMsg = sab.getSabAccesMethod(host, username, password, apikey)
|
||||||
if connection:
|
if connection:
|
||||||
authed, authMsg = sab.testAuthentication(host, username, password, apikey) #@UnusedVariable
|
authed, authMsg = sab.testAuthentication(host, username, password, apikey) # @UnusedVariable
|
||||||
if authed:
|
if authed:
|
||||||
return "Success. Connected and authenticated"
|
return "Success. Connected and authenticated"
|
||||||
else:
|
else:
|
||||||
|
@ -3085,10 +3093,11 @@ class Home:
|
||||||
anime.append(show)
|
anime.append(show)
|
||||||
else:
|
else:
|
||||||
shows.append(show)
|
shows.append(show)
|
||||||
t.sortedShowLists = [["Shows",sorted(shows, lambda x, y: cmp(titler(x.name), titler(y.name)))],
|
t.sortedShowLists = [["Shows", sorted(shows, lambda x, y: cmp(titler(x.name), titler(y.name)))],
|
||||||
["Anime",sorted(anime, lambda x, y: cmp(titler(x.name), titler(y.name)))]]
|
["Anime", sorted(anime, lambda x, y: cmp(titler(x.name), titler(y.name)))]]
|
||||||
else:
|
else:
|
||||||
t.sortedShowLists = [["Shows",sorted(sickbeard.showList, lambda x, y: cmp(titler(x.name), titler(y.name)))]]
|
t.sortedShowLists = [
|
||||||
|
["Shows", sorted(sickbeard.showList, lambda x, y: cmp(titler(x.name), titler(y.name)))]]
|
||||||
|
|
||||||
t.bwl = BlackAndWhiteList(showObj.indexerid)
|
t.bwl = BlackAndWhiteList(showObj.indexerid)
|
||||||
|
|
||||||
|
@ -3223,7 +3232,7 @@ class Home:
|
||||||
if type(exceptions_list) != list:
|
if type(exceptions_list) != list:
|
||||||
exceptions_list = [exceptions_list]
|
exceptions_list = [exceptions_list]
|
||||||
|
|
||||||
#If directCall from mass_edit_update no scene exceptions handling
|
# If directCall from mass_edit_update no scene exceptions handling
|
||||||
if directCall:
|
if directCall:
|
||||||
do_update_exceptions = False
|
do_update_exceptions = False
|
||||||
else:
|
else:
|
||||||
|
@ -3343,7 +3352,7 @@ class Home:
|
||||||
except exceptions.CantRefreshException, e:
|
except exceptions.CantRefreshException, e:
|
||||||
errors.append("Unable to refresh this show:" + ex(e))
|
errors.append("Unable to refresh this show:" + ex(e))
|
||||||
# grab updated info from TVDB
|
# grab updated info from TVDB
|
||||||
#showObj.loadEpisodesFromIndexer()
|
# showObj.loadEpisodesFromIndexer()
|
||||||
# rescan the episodes in the new folder
|
# rescan the episodes in the new folder
|
||||||
except exceptions.NoNFOException:
|
except exceptions.NoNFOException:
|
||||||
errors.append(
|
errors.append(
|
||||||
|
@ -3618,7 +3627,7 @@ class Home:
|
||||||
return _genericMessage("Error", "Show not in show list")
|
return _genericMessage("Error", "Show not in show list")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
show_loc = showObj.location #@UnusedVariable
|
show_loc = showObj.location # @UnusedVariable
|
||||||
except exceptions.ShowDirNotFoundException:
|
except exceptions.ShowDirNotFoundException:
|
||||||
return _genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
return _genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
||||||
|
|
||||||
|
@ -3666,7 +3675,7 @@ class Home:
|
||||||
return _genericMessage("Error", errMsg)
|
return _genericMessage("Error", errMsg)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
show_loc = show_obj.location #@UnusedVariable
|
show_loc = show_obj.location # @UnusedVariable
|
||||||
except exceptions.ShowDirNotFoundException:
|
except exceptions.ShowDirNotFoundException:
|
||||||
return _genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
return _genericMessage("Error", "Can't rename episodes when the show dir is missing.")
|
||||||
|
|
||||||
|
@ -3719,7 +3728,7 @@ class Home:
|
||||||
|
|
||||||
# return the correct json value
|
# return the correct json value
|
||||||
if ep_queue_item.success:
|
if ep_queue_item.success:
|
||||||
#Find the quality class for the episode
|
# Find the quality class for the episode
|
||||||
quality_class = Quality.qualityStrings[Quality.UNKNOWN]
|
quality_class = Quality.qualityStrings[Quality.UNKNOWN]
|
||||||
ep_status, ep_quality = Quality.splitCompositeStatus(ep_obj.status)
|
ep_status, ep_quality = Quality.splitCompositeStatus(ep_obj.status)
|
||||||
for x in (SD, HD720p, HD1080p):
|
for x in (SD, HD720p, HD1080p):
|
||||||
|
@ -3760,7 +3769,8 @@ class Home:
|
||||||
return json.dumps({'result': status, 'subtitles': ','.join([x for x in ep_obj.subtitles])})
|
return json.dumps({'result': status, 'subtitles': ','.join([x for x in ep_obj.subtitles])})
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def setSceneNumbering(self, show, indexer, forSeason=None, forEpisode=None, forAbsolute=None, sceneSeason=None, sceneEpisode=None, sceneAbsolute=None):
|
def setSceneNumbering(self, show, indexer, forSeason=None, forEpisode=None, forAbsolute=None, sceneSeason=None,
|
||||||
|
sceneEpisode=None, sceneAbsolute=None):
|
||||||
|
|
||||||
# sanitize:
|
# sanitize:
|
||||||
if forSeason in ['null', '']: forSeason = None
|
if forSeason in ['null', '']: forSeason = None
|
||||||
|
@ -3814,7 +3824,8 @@ class Home:
|
||||||
if sceneSeason is not None: sceneSeason = int(sceneSeason)
|
if sceneSeason is not None: sceneSeason = int(sceneSeason)
|
||||||
if sceneEpisode is not None: sceneEpisode = int(sceneEpisode)
|
if sceneEpisode is not None: sceneEpisode = int(sceneEpisode)
|
||||||
|
|
||||||
set_scene_numbering(show, indexer, season=forSeason, episode=forEpisode, sceneSeason=sceneSeason, sceneEpisode=sceneEpisode)
|
set_scene_numbering(show, indexer, season=forSeason, episode=forEpisode, sceneSeason=sceneSeason,
|
||||||
|
sceneEpisode=sceneEpisode)
|
||||||
|
|
||||||
if showObj.is_anime:
|
if showObj.is_anime:
|
||||||
sn = get_scene_absolute_numbering(show, indexer, forAbsolute)
|
sn = get_scene_absolute_numbering(show, indexer, forAbsolute)
|
||||||
|
@ -3840,8 +3851,8 @@ class Home:
|
||||||
return json.dumps({'result': 'failure'})
|
return json.dumps({'result': 'failure'})
|
||||||
|
|
||||||
# create failed segment
|
# create failed segment
|
||||||
segment = {season:[ep_obj]}
|
segment = {season: [ep_obj]}
|
||||||
|
|
||||||
# make a queue item for it and put it on the queue
|
# make a queue item for it and put it on the queue
|
||||||
ep_queue_item = search_queue.FailedQueueItem(ep_obj.show, segment)
|
ep_queue_item = search_queue.FailedQueueItem(ep_obj.show, segment)
|
||||||
sickbeard.searchQueueScheduler.action.add_item(ep_queue_item) # @UndefinedVariable
|
sickbeard.searchQueueScheduler.action.add_item(ep_queue_item) # @UndefinedVariable
|
||||||
|
@ -3852,7 +3863,7 @@ class Home:
|
||||||
|
|
||||||
# return the correct json value
|
# return the correct json value
|
||||||
if ep_queue_item.success:
|
if ep_queue_item.success:
|
||||||
#Find the quality class for the episode
|
# Find the quality class for the episode
|
||||||
quality_class = Quality.qualityStrings[Quality.UNKNOWN]
|
quality_class = Quality.qualityStrings[Quality.UNKNOWN]
|
||||||
ep_status, ep_quality = Quality.splitCompositeStatus(ep_obj.status)
|
ep_status, ep_quality = Quality.splitCompositeStatus(ep_obj.status)
|
||||||
for x in (SD, HD720p, HD1080p):
|
for x in (SD, HD720p, HD1080p):
|
||||||
|
@ -3903,7 +3914,7 @@ class WebInterface:
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def showPoster(self, show=None, which=None):
|
def showPoster(self, show=None, which=None):
|
||||||
|
|
||||||
#Redirect initial poster/banner thumb to default images
|
# Redirect initial poster/banner thumb to default images
|
||||||
if which[0:6] == 'poster':
|
if which[0:6] == 'poster':
|
||||||
default_image_name = 'poster.png'
|
default_image_name = 'poster.png'
|
||||||
else:
|
else:
|
||||||
|
@ -4037,8 +4048,8 @@ class WebInterface:
|
||||||
sql_results.sort(sorts[sickbeard.COMING_EPS_SORT])
|
sql_results.sort(sorts[sickbeard.COMING_EPS_SORT])
|
||||||
|
|
||||||
t = PageTemplate(file="comingEpisodes.tmpl")
|
t = PageTemplate(file="comingEpisodes.tmpl")
|
||||||
# paused_item = { 'title': '', 'path': 'toggleComingEpsDisplayPaused' }
|
# paused_item = { 'title': '', 'path': 'toggleComingEpsDisplayPaused' }
|
||||||
# paused_item['title'] = 'Hide Paused' if sickbeard.COMING_EPS_DISPLAY_PAUSED else 'Show Paused'
|
# paused_item['title'] = 'Hide Paused' if sickbeard.COMING_EPS_DISPLAY_PAUSED else 'Show Paused'
|
||||||
paused_item = {'title': 'View Paused:', 'path': {'': ''}}
|
paused_item = {'title': 'View Paused:', 'path': {'': ''}}
|
||||||
paused_item['path'] = {'Hide': 'toggleComingEpsDisplayPaused'} if sickbeard.COMING_EPS_DISPLAY_PAUSED else {
|
paused_item['path'] = {'Hide': 'toggleComingEpsDisplayPaused'} if sickbeard.COMING_EPS_DISPLAY_PAUSED else {
|
||||||
'Show': 'toggleComingEpsDisplayPaused'}
|
'Show': 'toggleComingEpsDisplayPaused'}
|
||||||
|
|
Loading…
Reference in a new issue