1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Test fix for home page none type error

This commit is contained in:
echel0n 2014-06-12 11:30:59 -07:00
parent 9e4ee04f57
commit 2546a5199f
6 changed files with 45 additions and 55 deletions

View File

@ -170,7 +170,7 @@
</span> </span>
</div> </div>
#for $curShowlist in $showlists if $varExists('showlists') else $sickbeard.showList #for $curShowlist in $showlists:
#set $curListType = $curShowlist[0] #set $curListType = $curShowlist[0]
#set $myShowList = $list($curShowlist[1]) #set $myShowList = $list($curShowlist[1])
#if $curListType == "Anime": #if $curListType == "Anime":
@ -179,7 +179,7 @@
<table id="showListTable$curListType" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0"> <table id="showListTable$curListType" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0">
<thead><tr><th class="nowrap">Next Ep</th>#if $layout=="poster" then "<th>Poster</th>" else "<th style='display: none;'></th>"#<th>Show</th><th>Network</th><th>Quality</th><th>Downloads</th><th>Active</th><th>Status</th></tr></thead> <thead><tr><th class="nowrap">Next Ep</th>#if $layout=="poster" then "<th>Poster</th>" else "<th style='display: none;'></th>"#<th>$curListType</th><th>Network</th><th>Quality</th><th>Downloads</th><th>Active</th><th>Status</th></tr></thead>
<tfoot> <tfoot>
<tr> <tr>
<th rowspan="1" colspan="1" align="center"><a href="$sbRoot/home/addShows/">&nbsp Add Show</a></th> <th rowspan="1" colspan="1" align="center"><a href="$sbRoot/home/addShows/">&nbsp Add Show</a></th>

View File

@ -85,9 +85,9 @@ versionCheckScheduler = None
showQueueScheduler = None showQueueScheduler = None
searchQueueScheduler = None searchQueueScheduler = None
properFinderScheduler = None properFinderScheduler = None
autoPostProcesserScheduler = None autoPostProcessorScheduler = None
subtitlesFinderScheduler = None subtitlesFinderScheduler = None
traktWatchListCheckerSchedular = None traktWatchListCheckerScheduler = None
showList = None showList = None
loadingShowList = None loadingShowList = None
@ -432,6 +432,7 @@ TMDB_API_KEY = 'edc5f123313769de83a71e157758030b'
__INITIALIZED__ = False __INITIALIZED__ = False
def initialize(consoleLogging=True): def initialize(consoleLogging=True):
with INIT_LOCK: with INIT_LOCK:
@ -442,7 +443,7 @@ def initialize(consoleLogging=True):
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_VERIFY_CERT, \ TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_VERIFY_CERT, \
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \ USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, BACKLOG_FREQUENCY, \ XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, BACKLOG_FREQUENCY, \
USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktWatchListCheckerSchedular, \ USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktWatchListCheckerScheduler, \
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \ USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \ PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \ showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \
@ -458,7 +459,7 @@ def initialize(consoleLogging=True):
KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \ KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \ showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \
NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \ NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \
RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcesserScheduler, \ RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcessorScheduler, \
WOMBLE, OMGWTFNZBS, OMGWTFNZBS_USERNAME, OMGWTFNZBS_APIKEY, providerList, newznabProviderList, torrentRssProviderList, \ WOMBLE, OMGWTFNZBS, OMGWTFNZBS_USERNAME, OMGWTFNZBS_APIKEY, providerList, newznabProviderList, torrentRssProviderList, \
EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, DAILYSEARCH_FREQUENCY, \ EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, DAILYSEARCH_FREQUENCY, \
USE_BOXCAR, BOXCAR_USERNAME, BOXCAR_PASSWORD, BOXCAR_NOTIFY_ONDOWNLOAD, BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD, BOXCAR_NOTIFY_ONSNATCH, \ USE_BOXCAR, BOXCAR_USERNAME, BOXCAR_PASSWORD, BOXCAR_NOTIFY_ONDOWNLOAD, BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD, BOXCAR_NOTIFY_ONSNATCH, \
@ -948,28 +949,28 @@ def initialize(consoleLogging=True):
silent=True, silent=True,
runImmediately=True) runImmediately=True)
versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(),
cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY),
threadName="CHECKVERSION",
runImmediately=True)
dailySearchScheduler = scheduler.Scheduler(dailysearcher.DailySearcher(), dailySearchScheduler = scheduler.Scheduler(dailysearcher.DailySearcher(),
cycleTime=datetime.timedelta(minutes=DAILYSEARCH_FREQUENCY), cycleTime=datetime.timedelta(minutes=DAILYSEARCH_FREQUENCY),
threadName="DAILYSEARCHER", threadName="DAILYSEARCHER",
silent=True, silent=True,
runImmediately=DAILYSEARCH_STARTUP) runImmediately=DAILYSEARCH_STARTUP)
showUpdateScheduler = scheduler.Scheduler(showUpdater.ShowUpdater(),
cycleTime=showUpdater.ShowUpdater().updateInterval,
threadName="SHOWUPDATER",
runImmediately=False)
versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(),
cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY),
threadName="CHECKVERSION",
runImmediately=True)
showQueueScheduler = scheduler.Scheduler(show_queue.ShowQueue(), showQueueScheduler = scheduler.Scheduler(show_queue.ShowQueue(),
cycleTime=datetime.timedelta(seconds=3), cycleTime=datetime.timedelta(seconds=3),
threadName="SHOWQUEUE", threadName="SHOWQUEUE",
silent=True, silent=True,
runImmediately=True) runImmediately=True)
showUpdateScheduler = scheduler.Scheduler(showUpdater.ShowUpdater(),
cycleTime=showUpdater.ShowUpdater().updateInterval,
threadName="SHOWUPDATER",
runImmediately=False)
searchQueueScheduler = scheduler.Scheduler(search_queue.SearchQueue(), searchQueueScheduler = scheduler.Scheduler(search_queue.SearchQueue(),
cycleTime=datetime.timedelta(seconds=3), cycleTime=datetime.timedelta(seconds=3),
threadName="SEARCHQUEUE", threadName="SEARCHQUEUE",
@ -981,14 +982,14 @@ def initialize(consoleLogging=True):
silent=False if DOWNLOAD_PROPERS else True, silent=False if DOWNLOAD_PROPERS else True,
runImmediately=True) runImmediately=True)
autoPostProcesserScheduler = scheduler.Scheduler(autoPostProcesser.PostProcesser(), autoPostProcessorScheduler = scheduler.Scheduler(autoPostProcesser.PostProcesser(),
cycleTime=datetime.timedelta( cycleTime=datetime.timedelta(
minutes=AUTOPOSTPROCESSER_FREQUENCY), minutes=AUTOPOSTPROCESSER_FREQUENCY),
threadName="POSTPROCESSER", threadName="POSTPROCESSER",
silent=False if PROCESS_AUTOMATICALLY else True, silent=False if PROCESS_AUTOMATICALLY else True,
runImmediately=True) runImmediately=True)
traktWatchListCheckerSchedular = scheduler.Scheduler(traktWatchListChecker.TraktChecker(), traktWatchListCheckerScheduler = scheduler.Scheduler(traktWatchListChecker.TraktChecker(),
cycleTime=datetime.timedelta(hours=1), cycleTime=datetime.timedelta(hours=1),
threadName="TRAKTWATCHLIST", threadName="TRAKTWATCHLIST",
silent=False if USE_TRAKT else True, silent=False if USE_TRAKT else True,
@ -1090,18 +1091,6 @@ def initialize(consoleLogging=True):
curNzbProvider.getID() + '_backlog_only', curNzbProvider.getID() + '_backlog_only',
0)) 0))
try:
url = 'http://raw.github.com/echel0n/sickrage-init/master/settings.ini'
clear_cache = ElementTree.XML(helpers.getURL(url)).find('cache/clear').text
CLEAR_CACHE = check_setting_str(CFG, 'General', 'clear_cache', '')
if CLEAR_CACHE != clear_cache:
for curProvider in [x for x in providers.sortedProviderList() if x.isActive()]:
curProvider.cache._clearCache()
CLEAR_CACHE = clear_cache
save_config()
except:
pass
showList = [] showList = []
loadingShowList = {} loadingShowList = {}
@ -1112,8 +1101,8 @@ def initialize(consoleLogging=True):
def start(): def start():
global __INITIALIZED__, maintenanceScheduler, backlogSearchScheduler, \ global __INITIALIZED__, maintenanceScheduler, backlogSearchScheduler, \
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \ showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \ properFinderScheduler, autoPostProcessorScheduler, searchQueueScheduler, \
subtitlesFinderScheduler, USE_SUBTITLES,traktWatchListCheckerSchedular, \ subtitlesFinderScheduler, USE_SUBTITLES, traktWatchListCheckerScheduler, \
dailySearchScheduler, started dailySearchScheduler, started
with INIT_LOCK: with INIT_LOCK:
@ -1148,14 +1137,14 @@ def start():
properFinderScheduler.thread.start() properFinderScheduler.thread.start()
# start the proper finder # start the proper finder
autoPostProcesserScheduler.thread.start() autoPostProcessorScheduler.thread.start()
# start the subtitles finder # start the subtitles finder
if USE_SUBTITLES: if USE_SUBTITLES:
subtitlesFinderScheduler.thread.start() subtitlesFinderScheduler.thread.start()
# start the trakt watchlist # start the trakt watchlist
traktWatchListCheckerSchedular.thread.start() traktWatchListCheckerScheduler.thread.start()
started = True started = True
@ -1163,8 +1152,8 @@ def start():
def halt(): def halt():
global __INITIALIZED__, maintenanceScheduler, backlogSearchScheduler, \ global __INITIALIZED__, maintenanceScheduler, backlogSearchScheduler, \
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \ showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \ properFinderScheduler, autoPostProcessorScheduler, searchQueueScheduler, \
subtitlesFinderScheduler, traktWatchListCheckerSchedular, \ subtitlesFinderScheduler, traktWatchListCheckerScheduler, \
dailySearchScheduler, started dailySearchScheduler, started
with INIT_LOCK: with INIT_LOCK:
@ -1224,17 +1213,17 @@ def halt():
except: except:
pass pass
autoPostProcesserScheduler.abort = True autoPostProcessorScheduler.abort = True
logger.log(u"Waiting for the POSTPROCESSER thread to exit") logger.log(u"Waiting for the POSTPROCESSER thread to exit")
try: try:
autoPostProcesserScheduler.thread.join(10) autoPostProcessorScheduler.thread.join(10)
except: except:
pass pass
traktWatchListCheckerSchedular.abort = True traktWatchListCheckerScheduler.abort = True
logger.log(u"Waiting for the TRAKTWATCHLIST thread to exit") logger.log(u"Waiting for the TRAKTWATCHLIST thread to exit")
try: try:
traktWatchListCheckerSchedular.thread.join(10) traktWatchListCheckerScheduler.thread.join(10)
except: except:
pass pass
@ -1333,6 +1322,7 @@ def saveAndShutdown(restart=False):
os._exit(0) os._exit(0)
def invoke_command(to_call, *args, **kwargs): def invoke_command(to_call, *args, **kwargs):
global invoked_command global invoked_command

View File

@ -164,7 +164,7 @@ def change_AUTOPOSTPROCESSER_FREQUENCY(freq):
if sickbeard.AUTOPOSTPROCESSER_FREQUENCY < sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY: if sickbeard.AUTOPOSTPROCESSER_FREQUENCY < sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY:
sickbeard.AUTOPOSTPROCESSER_FREQUENCY = sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY sickbeard.AUTOPOSTPROCESSER_FREQUENCY = sickbeard.MIN_AUTOPOSTPROCESSER_FREQUENCY
sickbeard.autoPostProcesserScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.AUTOPOSTPROCESSER_FREQUENCY) sickbeard.autoPostProcessorScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.AUTOPOSTPROCESSER_FREQUENCY)
def change_DAILYSEARCH_FREQUENCY(freq): def change_DAILYSEARCH_FREQUENCY(freq):
sickbeard.DAILYSEARCH_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_DAILYSEARCH_FREQUENCY) sickbeard.DAILYSEARCH_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_DAILYSEARCH_FREQUENCY)

View File

@ -386,7 +386,7 @@ class QueueItemAdd(ShowQueueItem):
self.show.flushEpisodes() self.show.flushEpisodes()
# if there are specific episodes that need to be added by trakt # if there are specific episodes that need to be added by trakt
sickbeard.traktWatchListCheckerSchedular.action.manageNewShow(self.show) sickbeard.traktWatchListCheckerScheduler.action.manageNewShow(self.show)
# Load XEM data to DB for show # Load XEM data to DB for show
sickbeard.scene_numbering.xem_refresh(self.show.indexerid, self.show.indexer, force=True) sickbeard.scene_numbering.xem_refresh(self.show.indexerid, self.show.indexer, force=True)

View File

@ -1245,9 +1245,9 @@ class ConfigPostProcessing:
config.change_AUTOPOSTPROCESSER_FREQUENCY(autopostprocesser_frequency) config.change_AUTOPOSTPROCESSER_FREQUENCY(autopostprocesser_frequency)
if sickbeard.PROCESS_AUTOMATICALLY: if sickbeard.PROCESS_AUTOMATICALLY:
sickbeard.autoPostProcesserScheduler.silent = False sickbeard.autoPostProcessorScheduler.silent = False
else: else:
sickbeard.autoPostProcesserScheduler.silent = True sickbeard.autoPostProcessorScheduler.silent = True
if unpack: if unpack:
if self.isRarSupported() != 'not supported': if self.isRarSupported() != 'not supported':
@ -1910,9 +1910,9 @@ class ConfigNotifications:
sickbeard.TRAKT_START_PAUSED = config.checkbox_to_value(trakt_start_paused) sickbeard.TRAKT_START_PAUSED = config.checkbox_to_value(trakt_start_paused)
if sickbeard.USE_TRAKT: if sickbeard.USE_TRAKT:
sickbeard.traktWatchListCheckerSchedular.silent = False sickbeard.traktWatchListCheckerScheduler.silent = False
else: else:
sickbeard.traktWatchListCheckerSchedular.silent = True sickbeard.traktWatchListCheckerScheduler.silent = True
sickbeard.USE_EMAIL = config.checkbox_to_value(use_email) sickbeard.USE_EMAIL = config.checkbox_to_value(use_email)
sickbeard.EMAIL_NOTIFY_ONSNATCH = config.checkbox_to_value(email_notify_onsnatch) sickbeard.EMAIL_NOTIFY_ONSNATCH = config.checkbox_to_value(email_notify_onsnatch)