mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Merge branch 'origin/dev'
This commit is contained in:
commit
e7793057ab
@ -44,11 +44,22 @@
|
||||
<span class="component-desc">Replace original download with "Proper/Repack" if nuked?</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field-pair">
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title">Search Frequency</span>
|
||||
<input type="text" name="search_frequency" value="$sickbeard.SEARCH_FREQUENCY" size="5" />
|
||||
<span class="component-title">Backlog Search Frequency</span>
|
||||
<input type="text" name="backlog_frequency" value="$sickbeard.BACKLOG_FREQUENCY" size="5" />
|
||||
</label>
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title"> </span>
|
||||
<span class="component-desc">Time in minutes between searches (eg. 60)</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field-pair">
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title">RSS Cache Update Frequency</span>
|
||||
<input type="text" name="rssupdate_frequency" value="$sickbeard.RSSUPDATE_FREQUENCY" size="5" />
|
||||
</label>
|
||||
<label class="nocheck clearfix">
|
||||
<span class="component-title"> </span>
|
||||
|
@ -58,7 +58,9 @@
|
||||
<img src="$sbRoot/images/flags/${$country}.png" width="16" height="11" style="margin-top: 3px; margin-left: 3px" />
|
||||
#end for
|
||||
#end if
|
||||
($show.imdb_info['year']) - $show.imdb_info['runtimes'] min - $show.imdb_info['genres'].replace('|',' | ')
|
||||
#if 'year' in $show.imdb_info:
|
||||
($show.imdb_info['year']) - $show.imdb_info['runtimes'] min - $show.imdb_info['genres'].replace('|',' | ')
|
||||
#end if
|
||||
<span class="tvshowLink" style="vertical-align: text-top">
|
||||
<a href="http://www.imdb.com/title/$show.imdbid" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="http://www.imdb.com/title/$show.imdbid"><img alt="[imdb]" height="16" width="16" src="$sbRoot/images/imdb.png" style="margin-top: -1px;"/>
|
||||
<a href="$sickbeard.indexerApi($show.indexer).config["show_url"]$show.indexerid" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="$sickbeard.indexerApi($show.indexer).config["show_url"]$show.indexerid"><img alt="$sickbeard.indexerApi($show.indexer).name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($show.indexer).config["icon"] "style="margin-top: -1px;"/></a>
|
||||
|
@ -38,6 +38,7 @@ from sickbeard import searchBacklog, showUpdater, versionChecker, properFinder,
|
||||
from sickbeard import helpers, db, exceptions, show_queue, search_queue, scheduler, show_name_helpers
|
||||
from sickbeard import logger
|
||||
from sickbeard import naming
|
||||
from sickbeard import rssupdater
|
||||
from sickbeard import scene_numbering, scene_exceptions, name_cache
|
||||
from indexers.indexer_api import indexerApi
|
||||
from indexers.indexer_exceptions import indexer_shownotfound, indexer_exception, indexer_error, indexer_episodenotfound, \
|
||||
@ -82,6 +83,7 @@ properFinderScheduler = None
|
||||
autoPostProcesserScheduler = None
|
||||
subtitlesFinderScheduler = None
|
||||
traktWatchListCheckerSchedular = None
|
||||
updateRSSScheduler = None
|
||||
|
||||
showList = None
|
||||
loadingShowList = None
|
||||
@ -133,7 +135,6 @@ ROOT_DIRS = None
|
||||
UPDATE_SHOWS_ON_START = None
|
||||
SORT_ARTICLE = None
|
||||
DEBUG = False
|
||||
NUM_OF_THREADS = None
|
||||
|
||||
USE_LISTVIEW = None
|
||||
METADATA_XBMC = None
|
||||
@ -142,6 +143,7 @@ METADATA_MEDIABROWSER = None
|
||||
METADATA_PS3 = None
|
||||
METADATA_WDTV = None
|
||||
METADATA_TIVO = None
|
||||
METADATA_MEDE8ER = None
|
||||
|
||||
QUALITY_DEFAULT = None
|
||||
STATUS_DEFAULT = None
|
||||
@ -171,9 +173,9 @@ DOWNLOAD_PROPERS = None
|
||||
PREFER_EPISODE_RELEASES = None
|
||||
ALLOW_HIGH_PRIORITY = None
|
||||
|
||||
SEARCH_FREQUENCY = None
|
||||
RSSUPDATE_FREQUENCY = None
|
||||
UPDATE_FREQUENCY = None
|
||||
BACKLOG_SEARCH_FREQUENCY = 21
|
||||
BACKLOG_FREQUENCY = 21
|
||||
BACKLOG_STARTUP = None
|
||||
|
||||
MIN_SEARCH_FREQUENCY = 10
|
||||
@ -182,21 +184,21 @@ DEFAULT_SEARCH_FREQUENCY = 40
|
||||
DEFAULT_UPDATE_FREQUENCY = 12
|
||||
|
||||
EZRSS = False
|
||||
EZRSS_RATIO = ''
|
||||
EZRSS_RATIO = None
|
||||
|
||||
TVTORRENTS = False
|
||||
TVTORRENTS_DIGEST = None
|
||||
TVTORRENTS_HASH = None
|
||||
TVTORRENTS_RATIO = ''
|
||||
TVTORRENTS_RATIO = None
|
||||
|
||||
BTN = False
|
||||
BTN_API_KEY = None
|
||||
BTN_RATIO = ''
|
||||
BTN_RATIO = None
|
||||
|
||||
NEWZNAB_DATA = None
|
||||
|
||||
THEPIRATEBAY = False
|
||||
THEPIRATEBAY_RATIO = ''
|
||||
THEPIRATEBAY_RATIO = None
|
||||
THEPIRATEBAY_TRUSTED = False
|
||||
THEPIRATEBAY_PROXY = False
|
||||
THEPIRATEBAY_PROXY_URL = None
|
||||
@ -206,43 +208,43 @@ TORRENTLEECH = False
|
||||
TORRENTLEECH_KEY = None
|
||||
TORRENTLEECH_USERNAME = None
|
||||
TORRENTLEECH_PASSWORD = None
|
||||
TORRENTLEECH_RATIO = ''
|
||||
TORRENTLEECH_RATIO = None
|
||||
|
||||
IPTORRENTS = False
|
||||
IPTORRENTS_USERNAME = None
|
||||
IPTORRENTS_PASSWORD = None
|
||||
IPTORRENTS_RATIO = ''
|
||||
IPTORRENTS_RATIO = None
|
||||
IPTORRENTS_FREELEECH = False
|
||||
|
||||
NEXTGEN = False
|
||||
NEXTGEN_USERNAME = None
|
||||
NEXTGEN_PASSWORD = None
|
||||
NEXTGEN_RATIO = ''
|
||||
NEXTGEN_RATIO = None
|
||||
NEXTGEN_FREELEECH = False
|
||||
|
||||
KAT = None
|
||||
KAT_RATIO = ''
|
||||
KAT_RATIO = None
|
||||
KAT_VERIFIED = False
|
||||
|
||||
PUBLICHD = None
|
||||
PUBLICHD_RATIO = ''
|
||||
PUBLICHD_RATIO = None
|
||||
|
||||
SCC = False
|
||||
SCC_USERNAME = None
|
||||
SCC_PASSWORD = None
|
||||
SCC_RATIO = ''
|
||||
SCC_RATIO = None
|
||||
|
||||
HDTORRENTS = False
|
||||
HDTORRENTS_USERNAME = None
|
||||
HDTORRENTS_PASSWORD = None
|
||||
HDTORRENTS_RATIO = ''
|
||||
HDTORRENTS_RATIO = None
|
||||
HDTORRENTS_UID = None
|
||||
HDTORRENTS_HASH = None
|
||||
|
||||
TORRENTDAY = None
|
||||
TORRENTDAY_USERNAME = None
|
||||
TORRENTDAY_PASSWORD = None
|
||||
TORRENTDAY_RATIO = ''
|
||||
TORRENTDAY_RATIO = None
|
||||
TORRENTDAY_UID = None
|
||||
TORRENTDAY_HASH = None
|
||||
TORRENTDAY_FREELEECH = None
|
||||
@ -250,12 +252,12 @@ TORRENTDAY_FREELEECH = None
|
||||
HDBITS = False
|
||||
HDBITS_USERNAME = None
|
||||
HDBITS_PASSKEY = None
|
||||
HDBITS_RATIO = ''
|
||||
HDBITS_RATIO = None
|
||||
|
||||
SPEEDCD = False
|
||||
SPEEDCD_USERNAME = None
|
||||
SPEEDCD_PASSWORD = None
|
||||
SPEEDCD_RATIO = ''
|
||||
SPEEDCD_RATIO = None
|
||||
SPEEDCD_FREELEECH = None
|
||||
|
||||
ADD_SHOWS_WO_DIR = None
|
||||
@ -298,8 +300,8 @@ TORRENT_USERNAME = None
|
||||
TORRENT_PASSWORD = None
|
||||
TORRENT_HOST = ''
|
||||
TORRENT_PATH = ''
|
||||
TORRENT_RATIO = ''
|
||||
TORRENT_SEED_TIME = ''
|
||||
TORRENT_RATIO = None
|
||||
TORRENT_SEED_TIME = None
|
||||
TORRENT_PAUSED = False
|
||||
TORRENT_HIGH_BANDWIDTH = False
|
||||
TORRENT_LABEL = ''
|
||||
@ -477,11 +479,6 @@ TMDB_API_KEY = 'edc5f123313769de83a71e157758030b'
|
||||
__INITIALIZED__ = False
|
||||
|
||||
|
||||
def get_backlog_cycle_time():
|
||||
cycletime = SEARCH_FREQUENCY * 2 + 7
|
||||
return max([cycletime, 720])
|
||||
|
||||
|
||||
def initialize(consoleLogging=True):
|
||||
with INIT_LOCK:
|
||||
|
||||
@ -499,7 +496,7 @@ def initialize(consoleLogging=True):
|
||||
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, EZRSS, TVTORRENTS, TVTORRENTS_DIGEST, TVTORRENTS_HASH, TVTORRENTS_OPTIONS, BTN, BTN_API_KEY, BTN_OPTIONS, \
|
||||
THEPIRATEBAY, THEPIRATEBAY_TRUSTED, THEPIRATEBAY_PROXY, THEPIRATEBAY_PROXY_URL, THEPIRATEBAY_BLACKLIST, THEPIRATEBAY_OPTIONS, TORRENTLEECH, TORRENTLEECH_USERNAME, TORRENTLEECH_PASSWORD, TORRENTLEECH_OPTIONS, \
|
||||
IPTORRENTS, IPTORRENTS_USERNAME, IPTORRENTS_PASSWORD, IPTORRENTS_FREELEECH, IPTORRENTS_OPTIONS, KAT, KAT_VERIFIED, KAT_OPTIONS, PUBLICHD, PUBLICHD_OPTIONS, SCC, SCC_USERNAME, SCC_PASSWORD, SCC_OPTIONS, HDTORRENTS, HDTORRENTS_USERNAME, HDTORRENTS_PASSWORD, HDTORRENTS_UID, HDTORRENTS_HASH, HDTORRENTS_OPTIONS, TORRENTDAY, TORRENTDAY_USERNAME, TORRENTDAY_PASSWORD, TORRENTDAY_UID, TORRENTDAY_HASH, TORRENTDAY_FREELEECH, TORRENTDAY_OPTIONS, \
|
||||
HDBITS, HDBITS_USERNAME, HDBITS_PASSKEY, HDBITS_OPTIONS, TORRENT_DIR, USENET_RETENTION, SOCKET_TIMEOUT, SEARCH_FREQUENCY, DEFAULT_SEARCH_FREQUENCY, BACKLOG_SEARCH_FREQUENCY, BACKLOG_STARTUP, INDEXER_DEFAULT, \
|
||||
HDBITS, HDBITS_USERNAME, HDBITS_PASSKEY, HDBITS_OPTIONS, TORRENT_DIR, USENET_RETENTION, SOCKET_TIMEOUT, RSSUPDATE_FREQUENCY, DEFAULT_SEARCH_FREQUENCY, BACKLOG_FREQUENCY, BACKLOG_STARTUP, INDEXER_DEFAULT, \
|
||||
NEXTGEN, NEXTGEN_USERNAME, NEXTGEN_PASSWORD, NEXTGEN_FREELEECH, NEXTGEN_OPTIONS, SPEEDCD, SPEEDCD_USERNAME, SPEEDCD_PASSWORD, SPEEDCD_FREELEECH,\
|
||||
EZRSS_RATIO, TVTORRENTS_RATIO, BTN_RATIO, THEPIRATEBAY_RATIO, TORRENTLEECH_RATIO, IPTORRENTS_RATIO, KAT_RATIO, PUBLICHD_RATIO, TORRENTDAY_RATIO, SCC_RATIO, HDTORRENTS_RATIO, HDBITS_RATIO, NEXTGEN_RATIO, SPEEDCD_RATIO, \
|
||||
QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, \
|
||||
@ -525,9 +522,9 @@ def initialize(consoleLogging=True):
|
||||
USE_LISTVIEW, METADATA_XBMC, METADATA_XBMC_12PLUS, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
|
||||
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, \
|
||||
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, \
|
||||
METADATA_WDTV, METADATA_TIVO, IGNORE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \
|
||||
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \
|
||||
ADD_SHOWS_WO_DIR, USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, subtitlesFinderScheduler, \
|
||||
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, NUM_OF_THREADS
|
||||
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, updateRSSScheduler
|
||||
|
||||
if __INITIALIZED__:
|
||||
return False
|
||||
@ -596,8 +593,6 @@ def initialize(consoleLogging=True):
|
||||
|
||||
DEBUG = bool(check_setting_int(CFG, 'General', 'debug', 0))
|
||||
|
||||
NUM_OF_THREADS = check_setting_int(CFG, 'General', 'num_of_threads', 1)
|
||||
|
||||
ENABLE_HTTPS = bool(check_setting_int(CFG, 'General', 'enable_https', 0))
|
||||
|
||||
HTTPS_CERT = check_setting_str(CFG, 'General', 'https_cert', 'server.crt')
|
||||
@ -670,9 +665,13 @@ def initialize(consoleLogging=True):
|
||||
|
||||
USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500)
|
||||
|
||||
SEARCH_FREQUENCY = check_setting_int(CFG, 'General', 'search_frequency', 40)
|
||||
if SEARCH_FREQUENCY < MIN_SEARCH_FREQUENCY:
|
||||
SEARCH_FREQUENCY = MIN_SEARCH_FREQUENCY
|
||||
RSSUPDATE_FREQUENCY = check_setting_int(CFG, 'General', 'rssupdate_frequency', 40)
|
||||
if RSSUPDATE_FREQUENCY < MIN_SEARCH_FREQUENCY:
|
||||
RSSUPDATE_FREQUENCY = MIN_SEARCH_FREQUENCY
|
||||
|
||||
BACKLOG_FREQUENCY = check_setting_int(CFG, 'General', 'backlog_frequency', 40)
|
||||
if BACKLOG_FREQUENCY < MIN_SEARCH_FREQUENCY:
|
||||
BACKLOG_FREQUENCY = MIN_SEARCH_FREQUENCY
|
||||
|
||||
UPDATE_FREQUENCY = check_setting_int(CFG, 'General', 'update_frequency', 12)
|
||||
if UPDATE_FREQUENCY < MIN_UPDATE_FREQUENCY:
|
||||
@ -694,21 +693,21 @@ def initialize(consoleLogging=True):
|
||||
EZRSS = bool(check_setting_int(CFG, 'General', 'use_torrent', 0))
|
||||
if not EZRSS:
|
||||
EZRSS = bool(check_setting_int(CFG, 'EZRSS', 'ezrss', 0))
|
||||
EZRSS_RATIO = check_setting_str(CFG, 'EZRSS', 'ezrss_ratio', '')
|
||||
EZRSS_RATIO = check_setting_int(CFG, 'EZRSS', 'ezrss_ratio', 0)
|
||||
|
||||
TVTORRENTS = bool(check_setting_int(CFG, 'TVTORRENTS', 'tvtorrents', 0))
|
||||
TVTORRENTS_DIGEST = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_digest', '')
|
||||
TVTORRENTS_HASH = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_hash', '')
|
||||
TVTORRENTS_RATIO = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_ratio', '')
|
||||
TVTORRENTS_RATIO = check_setting_int(CFG, 'TVTORRENTS', 'tvtorrents_ratio', 0)
|
||||
TVTORRENTS_OPTIONS = check_setting_str(CFG, 'TVTORRENTS', 'tvtorrents_options', '')
|
||||
|
||||
BTN = bool(check_setting_int(CFG, 'BTN', 'btn', 0))
|
||||
BTN_API_KEY = check_setting_str(CFG, 'BTN', 'btn_api_key', '')
|
||||
BTN_RATIO = check_setting_str(CFG, 'BTN', 'btn_ratio', '')
|
||||
BTN_RATIO = check_setting_int(CFG, 'BTN', 'btn_ratio', 0)
|
||||
BTN_OPTIONS = check_setting_str(CFG, 'BTN', 'btn_options', '')
|
||||
|
||||
THEPIRATEBAY = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay', 1))
|
||||
THEPIRATEBAY_RATIO = check_setting_str(CFG, 'THEPIRATEBAY', 'thepiratebay_ratio', '')
|
||||
THEPIRATEBAY_RATIO = check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay_ratio', 0)
|
||||
THEPIRATEBAY_TRUSTED = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay_trusted', 1))
|
||||
THEPIRATEBAY_PROXY = bool(check_setting_int(CFG, 'THEPIRATEBAY', 'thepiratebay_proxy', 0))
|
||||
THEPIRATEBAY_PROXY_URL = check_setting_str(CFG, 'THEPIRATEBAY', 'thepiratebay_proxy_url', '')
|
||||
@ -718,60 +717,60 @@ def initialize(consoleLogging=True):
|
||||
TORRENTLEECH = bool(check_setting_int(CFG, 'TORRENTLEECH', 'torrentleech', 0))
|
||||
TORRENTLEECH_USERNAME = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_username', '')
|
||||
TORRENTLEECH_PASSWORD = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_password', '')
|
||||
TORRENTLEECH_RATIO = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_ratio', '')
|
||||
TORRENTLEECH_RATIO = check_setting_int(CFG, 'TORRENTLEECH', 'torrentleech_ratio', 0)
|
||||
TORRENTLEECH_OPTIONS = check_setting_str(CFG, 'TORRENTLEECH', 'torrentleech_options', '')
|
||||
|
||||
IPTORRENTS = bool(check_setting_int(CFG, 'IPTORRENTS', 'iptorrents', 0))
|
||||
IPTORRENTS_USERNAME = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_username', '')
|
||||
IPTORRENTS_PASSWORD = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_password', '')
|
||||
IPTORRENTS_RATIO = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_ratio', '')
|
||||
IPTORRENTS_RATIO = check_setting_int(CFG, 'IPTORRENTS', 'iptorrents_ratio', 0)
|
||||
IPTORRENTS_FREELEECH = bool(check_setting_int(CFG, 'IPTORRENTS', 'iptorrents_freeleech', 0))
|
||||
IPTORRENTS_OPTIONS = check_setting_str(CFG, 'IPTORRENTS', 'iptorrents_options', '')
|
||||
|
||||
NEXTGEN = bool(check_setting_int(CFG, 'NEXTGEN', 'nextgen', 0))
|
||||
NEXTGEN_USERNAME = check_setting_str(CFG, 'NEXTGEN', 'nextgen_username', '')
|
||||
NEXTGEN_PASSWORD = check_setting_str(CFG, 'NEXTGEN', 'nextgen_password', '')
|
||||
NEXTGEN_RATIO = check_setting_str(CFG, 'NEXTGEN', 'nextgen_ratio', '')
|
||||
NEXTGEN_RATIO = check_setting_int(CFG, 'NEXTGEN', 'nextgen_ratio', 0)
|
||||
NEXTGEN_OPTIONS = check_setting_str(CFG, 'NEXTGEN', 'nextgen_options', '')
|
||||
|
||||
KAT = bool(check_setting_int(CFG, 'KAT', 'kat', 0))
|
||||
KAT_RATIO = check_setting_str(CFG, 'KAT', 'kat_ratio', '')
|
||||
KAT_RATIO = check_setting_int(CFG, 'KAT', 'kat_ratio', 0)
|
||||
KAT_VERIFIED = bool(check_setting_int(CFG, 'KAT', 'kat_verified', 1))
|
||||
KAT_OPTIONS = check_setting_str(CFG, 'KAT', 'kat_options', '')
|
||||
|
||||
PUBLICHD = bool(check_setting_int(CFG, 'PUBLICHD', 'publichd', 0))
|
||||
PUBLICHD_RATIO = check_setting_str(CFG, 'PUBLICHD', 'publichd_ratio', '')
|
||||
PUBLICHD_RATIO = check_setting_int(CFG, 'PUBLICHD', 'publichd_ratio', 0)
|
||||
PUBLICHD_OPTIONS = check_setting_str(CFG, 'PUBLICHD', 'publichd_options', '')
|
||||
|
||||
SCC = bool(check_setting_int(CFG, 'SCC', 'scc', 0))
|
||||
SCC_USERNAME = check_setting_str(CFG, 'SCC', 'scc_username', '')
|
||||
SCC_PASSWORD = check_setting_str(CFG, 'SCC', 'scc_password', '')
|
||||
SCC_RATIO = check_setting_str(CFG, 'SCC', 'scc_ratio', '')
|
||||
SCC_RATIO = check_setting_int(CFG, 'SCC', 'scc_ratio', 0)
|
||||
SCC_OPTIONS = check_setting_str(CFG, 'SCC', 'scc_options', '')
|
||||
|
||||
HDTORRENTS = bool(check_setting_int(CFG, 'HDTORRENTS', 'hdtorrents', 0))
|
||||
HDTORRENTS_USERNAME = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_username', '')
|
||||
HDTORRENTS_PASSWORD = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_password', '')
|
||||
HDTORRENTS_RATIO = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_ratio', '')
|
||||
HDTORRENTS_RATIO = check_setting_int(CFG, 'HDTORRENTS', 'hdtorrents_ratio', 0)
|
||||
HDTORRENTS_OPTIONS = check_setting_str(CFG, 'HDTORRENTS', 'hdtorrents_options', '')
|
||||
|
||||
TORRENTDAY = bool(check_setting_int(CFG, 'TORRENTDAY', 'torrentday', 0))
|
||||
TORRENTDAY_USERNAME = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_username', '')
|
||||
TORRENTDAY_PASSWORD = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_password', '')
|
||||
TORRENTDAY_RATIO = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_ratio', '')
|
||||
TORRENTDAY_RATIO = check_setting_int(CFG, 'TORRENTDAY', 'torrentday_ratio', 0)
|
||||
TORRENTDAY_FREELEECH = bool(check_setting_int(CFG, 'TORRENTDAY', 'torrentday_freeleech', 0))
|
||||
TORRENTDAY_OPTIONS = check_setting_str(CFG, 'TORRENTDAY', 'torrentday_options', '')
|
||||
|
||||
HDBITS = bool(check_setting_int(CFG, 'HDBITS', 'hdbits', 0))
|
||||
HDBITS_USERNAME = check_setting_str(CFG, 'HDBITS', 'hdbits_username', '')
|
||||
HDBITS_PASSKEY = check_setting_str(CFG, 'HDBITS', 'hdbits_passkey', '')
|
||||
HDBITS_RATIO = check_setting_str(CFG, 'HDBITS', 'hdbits_ratio', '')
|
||||
HDBITS_RATIO = check_setting_int(CFG, 'HDBITS', 'hdbits_ratio', 0)
|
||||
HDBITS_OPTIONS = check_setting_str(CFG, 'HDBITS', 'hdbits_options', '')
|
||||
|
||||
SPEEDCD = bool(check_setting_int(CFG, 'SPEEDCD', 'speedcd', 0))
|
||||
SPEEDCD_USERNAME = check_setting_str(CFG, 'SPEEDCD', 'speedcd_username', '')
|
||||
SPEEDCD_PASSWORD = check_setting_str(CFG, 'SPEEDCD', 'speedcd_password', '')
|
||||
SPEEDCD_RATIO = check_setting_str(CFG, 'SPEEDCD', 'speedcd_ratio', '')
|
||||
SPEEDCD_RATIO = check_setting_int(CFG, 'SPEEDCD', 'speedcd_ratio', 0)
|
||||
SPEEDCD_FREELEECH = bool(check_setting_int(CFG, 'SPEEDCD', 'speedcd_freeleech', 0))
|
||||
|
||||
NZBS = bool(check_setting_int(CFG, 'NZBs', 'nzbs', 0))
|
||||
@ -804,8 +803,8 @@ def initialize(consoleLogging=True):
|
||||
TORRENT_PASSWORD = check_setting_str(CFG, 'TORRENT', 'torrent_password', '')
|
||||
TORRENT_HOST = check_setting_str(CFG, 'TORRENT', 'torrent_host', '')
|
||||
TORRENT_PATH = check_setting_str(CFG, 'TORRENT', 'torrent_path', '')
|
||||
TORRENT_RATIO = check_setting_str(CFG, 'TORRENT', 'torrent_ratio', '')
|
||||
TORRENT_SEED_TIME = check_setting_str(CFG, 'TORRENT', 'torrent_seed_time', '')
|
||||
TORRENT_RATIO = check_setting_int(CFG, 'TORRENT', 'torrent_ratio', 0)
|
||||
TORRENT_SEED_TIME = check_setting_int(CFG, 'TORRENT', 'torrent_seed_time', 0)
|
||||
TORRENT_PAUSED = bool(check_setting_int(CFG, 'TORRENT', 'torrent_paused', 0))
|
||||
TORRENT_HIGH_BANDWIDTH = bool(check_setting_int(CFG, 'TORRENT', 'torrent_high_bandwidth', 0))
|
||||
TORRENT_LABEL = check_setting_str(CFG, 'TORRENT', 'torrent_label', '')
|
||||
@ -987,6 +986,7 @@ def initialize(consoleLogging=True):
|
||||
METADATA_PS3 = check_setting_str(CFG, 'General', 'metadata_ps3', '0|0|0|0|0|0|0|0|0|0')
|
||||
METADATA_WDTV = check_setting_str(CFG, 'General', 'metadata_wdtv', '0|0|0|0|0|0|0|0|0|0')
|
||||
METADATA_TIVO = check_setting_str(CFG, 'General', 'metadata_tivo', '0|0|0|0|0|0|0|0|0|0')
|
||||
METADATA_MEDE8ER = check_setting_str(CFG, 'General', 'metadata_mede8er', '0|0|0|0|0|0|0|0|0|0')
|
||||
|
||||
GUI_NAME = check_setting_str(CFG, 'GUI', 'gui_name', 'slick')
|
||||
|
||||
@ -1038,6 +1038,7 @@ def initialize(consoleLogging=True):
|
||||
(METADATA_PS3, metadata.ps3),
|
||||
(METADATA_WDTV, metadata.wdtv),
|
||||
(METADATA_TIVO, metadata.tivo),
|
||||
(METADATA_MEDE8ER, metadata.mede8er),
|
||||
]:
|
||||
(cur_metadata_config, cur_metadata_class) = cur_metadata_tuple
|
||||
tmp_provider = cur_metadata_class.metadata_class()
|
||||
@ -1060,6 +1061,12 @@ def initialize(consoleLogging=True):
|
||||
threadName="CHECKVERSION",
|
||||
runImmediately=True)
|
||||
|
||||
updateRSSScheduler = scheduler.Scheduler(rssupdater.RSSUpdater(),
|
||||
cycleTime=datetime.timedelta(minutes=RSSUPDATE_FREQUENCY),
|
||||
threadName="RSSUPDATER",
|
||||
silent=True,
|
||||
runImmediately=True)
|
||||
|
||||
showQueueScheduler = scheduler.Scheduler(show_queue.ShowQueue(),
|
||||
cycleTime=datetime.timedelta(seconds=3),
|
||||
threadName="SHOWQUEUE",
|
||||
@ -1096,10 +1103,9 @@ def initialize(consoleLogging=True):
|
||||
|
||||
backlogSearchScheduler = searchBacklog.BacklogSearchScheduler(searchBacklog.BacklogSearcher(),
|
||||
cycleTime=datetime.timedelta(
|
||||
minutes=get_backlog_cycle_time()),
|
||||
minutes=BACKLOG_FREQUENCY),
|
||||
threadName="BACKLOG",
|
||||
runImmediately=True)
|
||||
backlogSearchScheduler.action.cycleTime = BACKLOG_SEARCH_FREQUENCY
|
||||
if not BACKLOG_STARTUP:
|
||||
backlogSearchScheduler.silent = True
|
||||
|
||||
@ -1123,30 +1129,33 @@ def start():
|
||||
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
|
||||
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
|
||||
subtitlesFinderScheduler, started, USE_SUBTITLES, \
|
||||
traktWatchListCheckerSchedular, started
|
||||
traktWatchListCheckerSchedular, updateRSSScheduler, started
|
||||
|
||||
with INIT_LOCK:
|
||||
|
||||
if __INITIALIZED__:
|
||||
|
||||
# start the queue checker
|
||||
showQueueScheduler.thread.start()
|
||||
|
||||
# start the version checker
|
||||
versionCheckScheduler.thread.start()
|
||||
|
||||
# start the RSS cache updater
|
||||
updateRSSScheduler.thread.start()
|
||||
|
||||
# start the backlog scheduler
|
||||
backlogSearchScheduler.thread.start()
|
||||
|
||||
# start the show updater
|
||||
showUpdateScheduler.thread.start()
|
||||
|
||||
# start the search queue checker
|
||||
searchQueueScheduler.thread.start()
|
||||
|
||||
# start the queue checker
|
||||
properFinderScheduler.thread.start()
|
||||
|
||||
# start the queue checker
|
||||
showQueueScheduler.thread.start()
|
||||
|
||||
# start the show updater
|
||||
showUpdateScheduler.thread.start()
|
||||
|
||||
# start the proper finder
|
||||
autoPostProcesserScheduler.thread.start()
|
||||
|
||||
@ -1163,7 +1172,7 @@ def start():
|
||||
def halt():
|
||||
global __INITIALIZED__, backlogSearchScheduler, showUpdateScheduler, \
|
||||
showQueueScheduler, properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
|
||||
subtitlesFinderScheduler, started, \
|
||||
subtitlesFinderScheduler, updateRSSScheduler, started, \
|
||||
traktWatchListCheckerSchedular
|
||||
|
||||
with INIT_LOCK:
|
||||
@ -1237,6 +1246,13 @@ def halt():
|
||||
except:
|
||||
pass
|
||||
|
||||
updateRSSScheduler.abort = True
|
||||
logger.log(u"Waiting for the RSSUPDATER thread to exit")
|
||||
try:
|
||||
updateRSSScheduler.thread.join(10)
|
||||
except:
|
||||
pass
|
||||
|
||||
__INITIALIZED__ = False
|
||||
|
||||
|
||||
@ -1352,7 +1368,6 @@ def save_config():
|
||||
new_config['General']['use_api'] = int(USE_API)
|
||||
new_config['General']['api_key'] = API_KEY
|
||||
new_config['General']['debug'] = int(DEBUG)
|
||||
new_config['General']['num_of_threads'] = int(NUM_OF_THREADS)
|
||||
new_config['General']['enable_https'] = int(ENABLE_HTTPS)
|
||||
new_config['General']['https_cert'] = HTTPS_CERT
|
||||
new_config['General']['https_key'] = HTTPS_KEY
|
||||
@ -1362,7 +1377,8 @@ def save_config():
|
||||
new_config['General']['nzb_method'] = NZB_METHOD
|
||||
new_config['General']['torrent_method'] = TORRENT_METHOD
|
||||
new_config['General']['usenet_retention'] = int(USENET_RETENTION)
|
||||
new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY)
|
||||
new_config['General']['rssupdate_frequency'] = int(RSSUPDATE_FREQUENCY)
|
||||
new_config['General']['backlog_frequency'] = int(BACKLOG_FREQUENCY)
|
||||
new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY)
|
||||
new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS)
|
||||
new_config['General']['prefer_episode_releases'] = int(PREFER_EPISODE_RELEASES)
|
||||
@ -1394,6 +1410,7 @@ def save_config():
|
||||
new_config['General']['metadata_ps3'] = METADATA_PS3
|
||||
new_config['General']['metadata_wdtv'] = METADATA_WDTV
|
||||
new_config['General']['metadata_tivo'] = METADATA_TIVO
|
||||
new_config['General']['metadata_mede8er'] = METADATA_MEDE8ER
|
||||
|
||||
new_config['General']['cache_dir'] = ACTUAL_CACHE_DIR if ACTUAL_CACHE_DIR else 'cache'
|
||||
new_config['General']['root_dirs'] = ROOT_DIRS if ROOT_DIRS else ''
|
||||
@ -1418,24 +1435,24 @@ def save_config():
|
||||
|
||||
new_config['EZRSS'] = {}
|
||||
new_config['EZRSS']['ezrss'] = int(EZRSS)
|
||||
new_config['EZRSS']['ezrss_ratio'] = EZRSS_RATIO
|
||||
new_config['EZRSS']['ezrss_ratio'] = int(EZRSS_RATIO)
|
||||
|
||||
new_config['TVTORRENTS'] = {}
|
||||
new_config['TVTORRENTS']['tvtorrents'] = int(TVTORRENTS)
|
||||
new_config['TVTORRENTS']['tvtorrents_digest'] = TVTORRENTS_DIGEST
|
||||
new_config['TVTORRENTS']['tvtorrents_hash'] = TVTORRENTS_HASH
|
||||
new_config['TVTORRENTS']['tvtorrents_ratio'] = TVTORRENTS_RATIO
|
||||
new_config['TVTORRENTS']['tvtorrents_ratio'] = int(TVTORRENTS_RATIO)
|
||||
new_config['TVTORRENTS']['tvtorrents_options'] = TVTORRENTS_OPTIONS
|
||||
|
||||
new_config['BTN'] = {}
|
||||
new_config['BTN']['btn'] = int(BTN)
|
||||
new_config['BTN']['btn_api_key'] = BTN_API_KEY
|
||||
new_config['BTN']['btn_ratio'] = BTN_RATIO
|
||||
new_config['BTN']['btn_ratio'] = int(BTN_RATIO)
|
||||
new_config['BTN']['btn_options'] = BTN_OPTIONS
|
||||
|
||||
new_config['THEPIRATEBAY'] = {}
|
||||
new_config['THEPIRATEBAY']['thepiratebay'] = int(THEPIRATEBAY)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_ratio'] = THEPIRATEBAY_RATIO
|
||||
new_config['THEPIRATEBAY']['thepiratebay_ratio'] = int(THEPIRATEBAY_RATIO)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_trusted'] = int(THEPIRATEBAY_TRUSTED)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_proxy'] = int(THEPIRATEBAY_PROXY)
|
||||
new_config['THEPIRATEBAY']['thepiratebay_proxy_url'] = THEPIRATEBAY_PROXY_URL
|
||||
@ -1446,14 +1463,14 @@ def save_config():
|
||||
new_config['TORRENTLEECH']['torrentleech'] = int(TORRENTLEECH)
|
||||
new_config['TORRENTLEECH']['torrentleech_username'] = TORRENTLEECH_USERNAME
|
||||
new_config['TORRENTLEECH']['torrentleech_password'] = helpers.encrypt(TORRENTLEECH_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['TORRENTLEECH']['torrentleech_ratio'] = TORRENTLEECH_RATIO
|
||||
new_config['TORRENTLEECH']['torrentleech_ratio'] = int(TORRENTLEECH_RATIO)
|
||||
new_config['TORRENTLEECH']['torrentleech_options'] = TORRENTLEECH_OPTIONS
|
||||
|
||||
new_config['IPTORRENTS'] = {}
|
||||
new_config['IPTORRENTS']['iptorrents'] = int(IPTORRENTS)
|
||||
new_config['IPTORRENTS']['iptorrents_username'] = IPTORRENTS_USERNAME
|
||||
new_config['IPTORRENTS']['iptorrents_password'] = helpers.encrypt(IPTORRENTS_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['IPTORRENTS']['iptorrents_ratio'] = IPTORRENTS_RATIO
|
||||
new_config['IPTORRENTS']['iptorrents_ratio'] = int(IPTORRENTS_RATIO)
|
||||
new_config['IPTORRENTS']['iptorrents_freeleech'] = int(IPTORRENTS_FREELEECH)
|
||||
new_config['IPTORRENTS']['iptorrents_options'] = IPTORRENTS_OPTIONS
|
||||
|
||||
@ -1461,39 +1478,39 @@ def save_config():
|
||||
new_config['NEXTGEN']['nextgen'] = int(NEXTGEN)
|
||||
new_config['NEXTGEN']['nextgen_username'] = NEXTGEN_USERNAME
|
||||
new_config['NEXTGEN']['nextgen_password'] = helpers.encrypt(NEXTGEN_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['NEXTGEN']['nextgen_ratio'] = NEXTGEN_RATIO
|
||||
new_config['NEXTGEN']['nextgen_ratio'] = int(NEXTGEN_RATIO)
|
||||
new_config['NEXTGEN']['nextgen_options'] = NEXTGEN_OPTIONS
|
||||
|
||||
new_config['KAT'] = {}
|
||||
new_config['KAT']['kat'] = int(KAT)
|
||||
new_config['KAT']['kat_ratio'] = KAT_RATIO
|
||||
new_config['KAT']['kat_ratio'] = int(KAT_RATIO)
|
||||
new_config['KAT']['kat_verified'] = int(KAT_VERIFIED)
|
||||
new_config['KAT']['kat_options'] = KAT_OPTIONS
|
||||
|
||||
new_config['PUBLICHD'] = {}
|
||||
new_config['PUBLICHD']['publichd'] = int(PUBLICHD)
|
||||
new_config['PUBLICHD']['publichd_ratio'] = PUBLICHD_RATIO
|
||||
new_config['PUBLICHD']['publichd_ratio'] = int(PUBLICHD_RATIO)
|
||||
new_config['PUBLICHD']['publichd_options'] = PUBLICHD_OPTIONS
|
||||
|
||||
new_config['SCC'] = {}
|
||||
new_config['SCC']['scc'] = int(SCC)
|
||||
new_config['SCC']['scc_username'] = SCC_USERNAME
|
||||
new_config['SCC']['scc_password'] = helpers.encrypt(SCC_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['SCC']['scc_ratio'] = SCC_RATIO
|
||||
new_config['SCC']['scc_ratio'] = int(SCC_RATIO)
|
||||
new_config['SCC']['scc_options'] = SCC_OPTIONS
|
||||
|
||||
new_config['HDTORRENTS'] = {}
|
||||
new_config['HDTORRENTS']['hdtorrents'] = int(HDTORRENTS)
|
||||
new_config['HDTORRENTS']['hdtorrents_username'] = HDTORRENTS_USERNAME
|
||||
new_config['HDTORRENTS']['hdtorrents_password'] = helpers.encrypt(HDTORRENTS_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['HDTORRENTS']['hdtorrents_ratio'] = HDTORRENTS_RATIO
|
||||
new_config['HDTORRENTS']['hdtorrents_ratio'] = int(HDTORRENTS_RATIO)
|
||||
new_config['HDTORRENTS']['hdtorrents_options'] = HDTORRENTS_OPTIONS
|
||||
|
||||
new_config['TORRENTDAY'] = {}
|
||||
new_config['TORRENTDAY']['torrentday'] = int(TORRENTDAY)
|
||||
new_config['TORRENTDAY']['torrentday_username'] = TORRENTDAY_USERNAME
|
||||
new_config['TORRENTDAY']['torrentday_password'] = helpers.encrypt(TORRENTDAY_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['TORRENTDAY']['torrentday_ratio'] = TORRENTDAY_RATIO
|
||||
new_config['TORRENTDAY']['torrentday_ratio'] = int(TORRENTDAY_RATIO)
|
||||
new_config['TORRENTDAY']['torrentday_freeleech'] = int(TORRENTDAY_FREELEECH)
|
||||
new_config['TORRENTDAY']['torrentday_options'] = TORRENTDAY_OPTIONS
|
||||
|
||||
@ -1501,14 +1518,14 @@ def save_config():
|
||||
new_config['HDBITS']['hdbits'] = int(HDBITS)
|
||||
new_config['HDBITS']['hdbits_username'] = HDBITS_USERNAME
|
||||
new_config['HDBITS']['hdbits_passkey'] = HDBITS_PASSKEY
|
||||
new_config['HDBITS']['hdbits_ratio'] = HDBITS_RATIO
|
||||
new_config['HDBITS']['hdbits_ratio'] = int(HDBITS_RATIO)
|
||||
new_config['HDBITS']['hdbits_options'] = HDBITS_OPTIONS
|
||||
|
||||
new_config['SPEEDCD'] = {}
|
||||
new_config['SPEEDCD']['speedcd'] = int(SPEEDCD)
|
||||
new_config['SPEEDCD']['speedcd_username'] = SPEEDCD_USERNAME
|
||||
new_config['SPEEDCD']['speedcd_password'] = helpers.encrypt(SPEEDCD_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['SPEEDCD']['speedcd_ratio'] = SPEEDCD_RATIO
|
||||
new_config['SPEEDCD']['speedcd_ratio'] = int(SPEEDCD_RATIO)
|
||||
new_config['SPEEDCD']['speedcd_freeleech'] = int(SPEEDCD_FREELEECH)
|
||||
|
||||
new_config['NZBs'] = {}
|
||||
@ -1549,8 +1566,8 @@ def save_config():
|
||||
new_config['TORRENT']['torrent_password'] = helpers.encrypt(TORRENT_PASSWORD, ENCRYPTION_VERSION)
|
||||
new_config['TORRENT']['torrent_host'] = TORRENT_HOST
|
||||
new_config['TORRENT']['torrent_path'] = TORRENT_PATH
|
||||
new_config['TORRENT']['torrent_ratio'] = TORRENT_RATIO
|
||||
new_config['TORRENT']['torrent_seed_time'] = TORRENT_SEED_TIME
|
||||
new_config['TORRENT']['torrent_ratio'] = int(TORRENT_RATIO)
|
||||
new_config['TORRENT']['torrent_seed_time'] = int(TORRENT_SEED_TIME)
|
||||
new_config['TORRENT']['torrent_paused'] = int(TORRENT_PAUSED)
|
||||
new_config['TORRENT']['torrent_high_bandwidth'] = int(TORRENT_HIGH_BANDWIDTH)
|
||||
new_config['TORRENT']['torrent_label'] = TORRENT_LABEL
|
||||
|
@ -21,13 +21,13 @@ import os.path
|
||||
import datetime
|
||||
import re
|
||||
import time
|
||||
import sickbeard
|
||||
|
||||
from sickbeard import helpers
|
||||
from sickbeard import logger
|
||||
from sickbeard import naming
|
||||
from sickbeard import db
|
||||
|
||||
import sickbeard
|
||||
|
||||
naming_ep_type = ("%(seasonnumber)dx%(episodenumber)02d",
|
||||
"s%(seasonnumber)02de%(episodenumber)02d",
|
||||
"S%(seasonnumber)02dE%(episodenumber)02d",
|
||||
@ -157,13 +157,21 @@ def change_TV_DOWNLOAD_DIR(tv_download_dir):
|
||||
return True
|
||||
|
||||
|
||||
def change_SEARCH_FREQUENCY(freq):
|
||||
sickbeard.SEARCH_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_SEARCH_FREQUENCY)
|
||||
def change_RSSUPDATE_FREQUENCY(freq):
|
||||
sickbeard.RSSUPDATE_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_SEARCH_FREQUENCY)
|
||||
|
||||
if sickbeard.SEARCH_FREQUENCY < sickbeard.MIN_SEARCH_FREQUENCY:
|
||||
sickbeard.SEARCH_FREQUENCY = sickbeard.MIN_SEARCH_FREQUENCY
|
||||
if sickbeard.RSSUPDATE_FREQUENCY < sickbeard.MIN_SEARCH_FREQUENCY:
|
||||
sickbeard.RSSUPDATE_FREQUENCY = sickbeard.MIN_SEARCH_FREQUENCY
|
||||
|
||||
sickbeard.backlogSearchScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.get_backlog_cycle_time())
|
||||
sickbeard.updateRSSScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.RSSUPDATE_FREQUENCY)
|
||||
|
||||
def change_BACKLOG_FREQUENCY(freq):
|
||||
sickbeard.BACKLOG_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_SEARCH_FREQUENCY)
|
||||
|
||||
if sickbeard.BACKLOG_FREQUENCY < sickbeard.MIN_SEARCH_FREQUENCY:
|
||||
sickbeard.BACKLOG_FREQUENCY = sickbeard.MIN_SEARCH_FREQUENCY
|
||||
|
||||
sickbeard.backlogSearchScheduler.cycleTime = datetime.timedelta(minutes=sickbeard.BACKLOG_FREQUENCY)
|
||||
|
||||
def change_UPDATE_FREQUENCY(freq):
|
||||
sickbeard.UPDATE_FREQUENCY = to_int(freq, default=sickbeard.DEFAULT_UPDATE_FREQUENCY)
|
||||
@ -606,6 +614,7 @@ class ConfigMigrator():
|
||||
metadata_ps3 = check_setting_str(self.config_obj, 'General', 'metadata_ps3', '0|0|0|0|0|0')
|
||||
metadata_wdtv = check_setting_str(self.config_obj, 'General', 'metadata_wdtv', '0|0|0|0|0|0')
|
||||
metadata_tivo = check_setting_str(self.config_obj, 'General', 'metadata_tivo', '0|0|0|0|0|0')
|
||||
metadata_mede8er = check_setting_str(self.config_obj, 'General', 'metadata_mede8er', '0|0|0|0|0|0')
|
||||
|
||||
use_banner = bool(check_setting_int(self.config_obj, 'General', 'use_banner', 0))
|
||||
|
||||
@ -627,6 +636,11 @@ class ConfigMigrator():
|
||||
metadata = '|'.join(cur_metadata)
|
||||
logger.log(u"Upgrading " + metadata_name + " metadata, new value: " + metadata)
|
||||
|
||||
elif len(cur_metadata) == 10:
|
||||
|
||||
metadata = '|'.join(cur_metadata)
|
||||
logger.log(u"Keeping " + metadata_name + " metadata, value: " + metadata)
|
||||
|
||||
else:
|
||||
logger.log(u"Skipping " + metadata_name + " metadata: '" + metadata + "', incorrect format",
|
||||
logger.ERROR)
|
||||
@ -641,3 +655,4 @@ class ConfigMigrator():
|
||||
sickbeard.METADATA_PS3 = _migrate_metadata(metadata_ps3, 'PS3', use_banner)
|
||||
sickbeard.METADATA_WDTV = _migrate_metadata(metadata_wdtv, 'WDTV', use_banner)
|
||||
sickbeard.METADATA_TIVO = _migrate_metadata(metadata_tivo, 'TIVO', use_banner)
|
||||
sickbeard.METADATA_MEDE8ER = _migrate_metadata(metadata_mede8er, 'Mede8er', use_banner)
|
||||
|
@ -20,12 +20,8 @@ import datetime
|
||||
import threading
|
||||
import Queue
|
||||
|
||||
import sickbeard
|
||||
from lib.concurrent.futures.thread import ThreadPoolExecutor
|
||||
|
||||
from sickbeard import logger
|
||||
|
||||
|
||||
class QueuePriorities:
|
||||
LOW = 10
|
||||
NORMAL = 20
|
||||
@ -33,7 +29,6 @@ class QueuePriorities:
|
||||
|
||||
class GenericQueue:
|
||||
def __init__(self):
|
||||
#self.executor = ThreadPoolExecutor(sickbeard.NUM_OF_THREADS)
|
||||
self.currentItem = None
|
||||
self.thread = None
|
||||
self.queue_name = "QUEUE"
|
||||
@ -72,8 +67,7 @@ class GenericQueue:
|
||||
return
|
||||
|
||||
threadName = self.queue_name + '-' + queueItem.get_thread_name()
|
||||
executor = ThreadPoolExecutor(sickbeard.NUM_OF_THREADS)
|
||||
self.thread = executor.submit(queueItem.execute, name=threadName)
|
||||
self.thread = threading.Thread(None, queueItem.execute, threadName)
|
||||
self.currentItem = queueItem
|
||||
|
||||
class QueueItem:
|
||||
|
@ -285,21 +285,29 @@ def makeDir(path):
|
||||
|
||||
|
||||
def searchDBForShow(regShowName):
|
||||
showNames = list(set([re.sub('[. -]', ' ', regShowName), regShowName]))
|
||||
showNames = [re.sub('[. -]', ' ', regShowName)]
|
||||
|
||||
myDB = db.DBConnection()
|
||||
|
||||
yearRegex = "([^()]+?)\s*(\()?(\d{4})(?(2)\))$"
|
||||
|
||||
for showName in showNames:
|
||||
# if we didn't get exactly one result then try again with the year stripped off if possible
|
||||
match = re.match(yearRegex, showName)
|
||||
if match and match.group(1):
|
||||
logger.log(u"Unable to match original name but trying to manually strip and specify show year",
|
||||
logger.DEBUG)
|
||||
sqlResults = myDB.select(
|
||||
"SELECT * FROM tv_shows WHERE (show_name LIKE ? OR show_name LIKE ?) AND startyear = ?",
|
||||
[match.group(1) + '%', match.group(1) + '%', match.group(3)])
|
||||
|
||||
sqlResults = myDB.select("SELECT * FROM tv_shows WHERE show_name LIKE ?",
|
||||
[showName])
|
||||
|
||||
if len(sqlResults) == 1:
|
||||
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
|
||||
|
||||
else:
|
||||
# if we didn't get exactly one result then try again with the year stripped off if possible
|
||||
match = re.match(yearRegex, showName)
|
||||
if match and match.group(1):
|
||||
logger.log(u"Unable to match original name but trying to manually strip and specify show year",
|
||||
logger.DEBUG)
|
||||
sqlResults = myDB.select(
|
||||
"SELECT * FROM tv_shows WHERE (show_name LIKE ?) AND startyear = ?",
|
||||
[match.group(1) + '%', match.group(3)])
|
||||
|
||||
if len(sqlResults) == 0:
|
||||
logger.log(u"Unable to match a record in the DB for " + showName, logger.DEBUG)
|
||||
@ -308,7 +316,7 @@ def searchDBForShow(regShowName):
|
||||
logger.log(u"Multiple results for " + showName + " in the DB, unable to match show name", logger.DEBUG)
|
||||
continue
|
||||
else:
|
||||
return int(sqlResults[0]["indexer_id"])
|
||||
return (int(sqlResults[0]["indexer_id"]), sqlResults[0]["show_name"])
|
||||
|
||||
return
|
||||
|
||||
|
@ -16,10 +16,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
__all__ = ['generic', 'helpers', 'xbmc', 'xbmc_12plus', 'mediabrowser', 'ps3', 'wdtv', 'tivo']
|
||||
__all__ = ['generic', 'helpers', 'xbmc', 'xbmc_12plus', 'mediabrowser', 'ps3', 'wdtv', 'tivo', 'mede8er']
|
||||
|
||||
import sys
|
||||
import xbmc, xbmc_12plus, mediabrowser, ps3, wdtv, tivo
|
||||
import xbmc, xbmc_12plus, mediabrowser, ps3, wdtv, tivo, mede8er
|
||||
|
||||
|
||||
def available_generators():
|
||||
|
356
sickbeard/metadata/mede8er.py
Normal file
356
sickbeard/metadata/mede8er.py
Normal file
@ -0,0 +1,356 @@
|
||||
# Author: Nic Wolfe <nic@wolfeden.ca>
|
||||
# URL: http://code.google.com/p/sickbeard/
|
||||
#
|
||||
# This file is part of Sick Beard.
|
||||
#
|
||||
# Sick Beard is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Sick Beard is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import datetime
|
||||
|
||||
import sickbeard
|
||||
|
||||
import mediabrowser
|
||||
|
||||
from sickbeard import logger, exceptions, helpers
|
||||
from lib.tvdb_api import tvdb_api, tvdb_exceptions
|
||||
from sickbeard.exceptions import ex
|
||||
|
||||
try:
|
||||
import xml.etree.cElementTree as etree
|
||||
except ImportError:
|
||||
import elementtree.ElementTree as etree
|
||||
|
||||
|
||||
class Mede8erMetadata(mediabrowser.MediaBrowserMetadata):
|
||||
"""
|
||||
Metadata generation class for Mede8er based on the MediaBrowser.
|
||||
|
||||
The following file structure is used:
|
||||
|
||||
show_root/series.xml (show metadata)
|
||||
show_root/folder.jpg (poster)
|
||||
show_root/fanart.jpg (fanart)
|
||||
show_root/Season ##/folder.jpg (season thumb)
|
||||
show_root/Season ##/filename.ext (*)
|
||||
show_root/Season ##/filename.xml (episode metadata)
|
||||
show_root/Season ##/filename.jpg (episode thumb)
|
||||
"""
|
||||
|
||||
def __init__(self,
|
||||
show_metadata=False,
|
||||
episode_metadata=False,
|
||||
fanart=False,
|
||||
poster=False,
|
||||
banner=False,
|
||||
episode_thumbnails=False,
|
||||
season_posters=False,
|
||||
season_banners=False,
|
||||
season_all_poster=False,
|
||||
season_all_banner=False):
|
||||
|
||||
mediabrowser.MediaBrowserMetadata.__init__(self,
|
||||
show_metadata,
|
||||
episode_metadata,
|
||||
fanart,
|
||||
poster,
|
||||
banner,
|
||||
episode_thumbnails,
|
||||
season_posters,
|
||||
season_banners,
|
||||
season_all_poster,
|
||||
season_all_banner)
|
||||
|
||||
self.name = "Mede8er"
|
||||
|
||||
self.fanart_name = "fanart.jpg"
|
||||
|
||||
# web-ui metadata template
|
||||
# self.eg_show_metadata = "series.xml"
|
||||
self.eg_episode_metadata = "Season##\\<i>filename</i>.xml"
|
||||
self.eg_fanart = "fanart.jpg"
|
||||
# self.eg_poster = "folder.jpg"
|
||||
# self.eg_banner = "banner.jpg"
|
||||
self.eg_episode_thumbnails = "Season##\\<i>filename</i>.jpg"
|
||||
# self.eg_season_posters = "Season##\\folder.jpg"
|
||||
# self.eg_season_banners = "Season##\\banner.jpg"
|
||||
# self.eg_season_all_poster = "<i>not supported</i>"
|
||||
# self.eg_season_all_banner = "<i>not supported</i>"
|
||||
|
||||
def get_episode_file_path(self, ep_obj):
|
||||
return helpers.replaceExtension(ep_obj.location, self._ep_nfo_extension)
|
||||
|
||||
def get_episode_thumb_path(self, ep_obj):
|
||||
return helpers.replaceExtension(ep_obj.location, 'jpg')
|
||||
|
||||
def _show_data(self, show_obj):
|
||||
"""
|
||||
Creates an elementTree XML structure for a MediaBrowser-style series.xml
|
||||
returns the resulting data object.
|
||||
|
||||
show_obj: a TVShow instance to create the NFO for
|
||||
"""
|
||||
|
||||
tvdb_lang = show_obj.lang
|
||||
# There's gotta be a better way of doing this but we don't wanna
|
||||
# change the language value elsewhere
|
||||
ltvdb_api_parms = sickbeard.TVDB_API_PARMS.copy()
|
||||
|
||||
if tvdb_lang and not tvdb_lang == 'en':
|
||||
ltvdb_api_parms['language'] = tvdb_lang
|
||||
|
||||
t = tvdb_api.Tvdb(actors=True, **ltvdb_api_parms)
|
||||
|
||||
rootNode = etree.Element("details")
|
||||
tv_node = etree.SubElement(rootNode, "movie")
|
||||
tv_node.attrib["isExtra"] = "false"
|
||||
tv_node.attrib["isSet"] = "false"
|
||||
tv_node.attrib["isTV"] = "true"
|
||||
|
||||
try:
|
||||
myShow = t[int(show_obj.indexerid)]
|
||||
except tvdb_exceptions.tvdb_shownotfound:
|
||||
logger.log(u"Unable to find show with id " + str(show_obj.indexerid) + " on tvdb, skipping it", logger.ERROR)
|
||||
raise
|
||||
|
||||
except tvdb_exceptions.tvdb_error:
|
||||
logger.log(u"TVDB is down, can't use its data to make the NFO", logger.ERROR)
|
||||
raise
|
||||
|
||||
# check for title and id
|
||||
try:
|
||||
if myShow['seriesname'] == None or myShow['seriesname'] == "" or myShow['id'] == None or myShow['id'] == "":
|
||||
logger.log(u"Incomplete info for show with id " + str(show_obj.indexerid) + " on tvdb, skipping it", logger.ERROR)
|
||||
return False
|
||||
except tvdb_exceptions.tvdb_attributenotfound:
|
||||
logger.log(u"Incomplete info for show with id " + str(show_obj.indexerid) + " on tvdb, skipping it", logger.ERROR)
|
||||
return False
|
||||
|
||||
SeriesName = etree.SubElement(tv_node, "title")
|
||||
if myShow['seriesname'] != None:
|
||||
SeriesName.text = myShow['seriesname']
|
||||
else:
|
||||
SeriesName.text = ""
|
||||
|
||||
Genres = etree.SubElement(tv_node, "genres")
|
||||
if myShow["genre"] != None:
|
||||
for genre in myShow['genre'].split('|'):
|
||||
if genre and genre.strip():
|
||||
cur_genre = etree.SubElement(Genres, "Genre")
|
||||
cur_genre.text = genre.strip()
|
||||
|
||||
FirstAired = etree.SubElement(tv_node, "premiered")
|
||||
if myShow['firstaired'] != None:
|
||||
FirstAired.text = myShow['firstaired']
|
||||
|
||||
year = etree.SubElement(tv_node, "year")
|
||||
if myShow["firstaired"] != None:
|
||||
try:
|
||||
year_text = str(datetime.datetime.strptime(myShow["firstaired"], '%Y-%m-%d').year)
|
||||
if year_text:
|
||||
year.text = year_text
|
||||
except:
|
||||
pass
|
||||
|
||||
if myShow['rating'] != None:
|
||||
try:
|
||||
rating = int((float(myShow['rating']) * 10))
|
||||
except ValueError:
|
||||
rating = 0
|
||||
Rating = etree.SubElement(tv_node, "rating")
|
||||
rating_text = str(rating)
|
||||
if rating_text != None:
|
||||
Rating.text = rating_text
|
||||
|
||||
Status = etree.SubElement(tv_node, "status")
|
||||
if myShow['status'] != None:
|
||||
Status.text = myShow['status']
|
||||
|
||||
mpaa = etree.SubElement(tv_node, "mpaa")
|
||||
if myShow["contentrating"] != None:
|
||||
mpaa.text = myShow["contentrating"]
|
||||
|
||||
IMDB_ID = etree.SubElement(tv_node, "id")
|
||||
if myShow['imdb_id'] != None:
|
||||
IMDB_ID.attrib["moviedb"] = "imdb"
|
||||
IMDB_ID.text = myShow['imdb_id']
|
||||
|
||||
tvdbid = etree.SubElement(tv_node, "indexerid")
|
||||
if myShow['id'] != None:
|
||||
tvdbid.text = myShow['id']
|
||||
|
||||
Runtime = etree.SubElement(tv_node, "runtime")
|
||||
if myShow['runtime'] != None:
|
||||
Runtime.text = myShow['runtime']
|
||||
|
||||
cast = etree.SubElement(tv_node, "cast")
|
||||
|
||||
if myShow["_actors"] != None:
|
||||
for actor in myShow['_actors']:
|
||||
cur_actor_name_text = actor['name']
|
||||
|
||||
if cur_actor_name_text != None and cur_actor_name_text.strip():
|
||||
cur_actor = etree.SubElement(cast, "actor")
|
||||
cur_actor.text = cur_actor_name_text.strip()
|
||||
|
||||
helpers.indentXML(rootNode)
|
||||
|
||||
data = etree.ElementTree(rootNode)
|
||||
|
||||
return data
|
||||
|
||||
def _ep_data(self, ep_obj):
|
||||
"""
|
||||
Creates an elementTree XML structure for a MediaBrowser style episode.xml
|
||||
and returns the resulting data object.
|
||||
|
||||
show_obj: a TVShow instance to create the NFO for
|
||||
"""
|
||||
|
||||
eps_to_write = [ep_obj] + ep_obj.relatedEps
|
||||
|
||||
tvdb_lang = ep_obj.show.lang
|
||||
|
||||
try:
|
||||
# There's gotta be a better way of doing this but we don't wanna
|
||||
# change the language value elsewhere
|
||||
ltvdb_api_parms = sickbeard.TVDB_API_PARMS.copy()
|
||||
|
||||
if tvdb_lang and not tvdb_lang == 'en':
|
||||
ltvdb_api_parms['language'] = tvdb_lang
|
||||
|
||||
t = tvdb_api.Tvdb(actors=True, **ltvdb_api_parms)
|
||||
myShow = t[ep_obj.show.indexerid]
|
||||
except tvdb_exceptions.tvdb_shownotfound, e:
|
||||
raise exceptions.ShowNotFoundException(e.message)
|
||||
except tvdb_exceptions.tvdb_error, e:
|
||||
logger.log(u"Unable to connect to TVDB while creating meta files - skipping - " + ex(e), logger.ERROR)
|
||||
return False
|
||||
|
||||
rootNode = etree.Element("details")
|
||||
movie = etree.SubElement(rootNode, "movie")
|
||||
|
||||
movie.attrib["isExtra"] = "false"
|
||||
movie.attrib["isSet"] = "false"
|
||||
movie.attrib["isTV"] = "true"
|
||||
|
||||
# write an MediaBrowser XML containing info for all matching episodes
|
||||
for curEpToWrite in eps_to_write:
|
||||
|
||||
try:
|
||||
myEp = myShow[curEpToWrite.season][curEpToWrite.episode]
|
||||
except (tvdb_exceptions.tvdb_episodenotfound, tvdb_exceptions.tvdb_seasonnotfound):
|
||||
logger.log(u"Unable to find episode " + str(curEpToWrite.season) + "x" + str(curEpToWrite.episode) + " on tvdb... has it been removed? Should I delete from db?")
|
||||
return None
|
||||
|
||||
if curEpToWrite == ep_obj:
|
||||
# root (or single) episode
|
||||
|
||||
# default to today's date for specials if firstaired is not set
|
||||
if myEp['firstaired'] == None and ep_obj.season == 0:
|
||||
myEp['firstaired'] = str(datetime.date.fromordinal(1))
|
||||
|
||||
if myEp['episodename'] == None or myEp['firstaired'] == None:
|
||||
return None
|
||||
|
||||
episode = movie
|
||||
|
||||
EpisodeName = etree.SubElement(episode, "title")
|
||||
if curEpToWrite.name != None:
|
||||
EpisodeName.text = curEpToWrite.name
|
||||
else:
|
||||
EpisodeName.text = ""
|
||||
|
||||
SeasonNumber = etree.SubElement(episode, "season")
|
||||
SeasonNumber.text = str(curEpToWrite.season)
|
||||
|
||||
EpisodeNumber = etree.SubElement(episode, "episode")
|
||||
EpisodeNumber.text = str(ep_obj.episode)
|
||||
|
||||
year = etree.SubElement(episode, "year")
|
||||
if myShow["firstaired"] != None:
|
||||
try:
|
||||
year_text = str(datetime.datetime.strptime(myShow["firstaired"], '%Y-%m-%d').year)
|
||||
if year_text:
|
||||
year.text = year_text
|
||||
except:
|
||||
pass
|
||||
|
||||
plot = etree.SubElement(episode, "plot")
|
||||
if myShow["overview"] != None:
|
||||
plot.text = myShow["overview"]
|
||||
|
||||
Overview = etree.SubElement(episode, "episodeplot")
|
||||
if curEpToWrite.description != None:
|
||||
Overview.text = curEpToWrite.description
|
||||
else:
|
||||
Overview.text = ""
|
||||
|
||||
mpaa = etree.SubElement(episode, "mpaa")
|
||||
if myShow["contentrating"] != None:
|
||||
mpaa.text = myShow["contentrating"]
|
||||
|
||||
if not ep_obj.relatedEps:
|
||||
if myEp["rating"] != None:
|
||||
try:
|
||||
rating = int((float(myEp['rating']) * 10))
|
||||
except ValueError:
|
||||
rating = 0
|
||||
Rating = etree.SubElement(episode, "rating")
|
||||
rating_text = str(rating)
|
||||
if rating_text != None:
|
||||
Rating.text = rating_text
|
||||
|
||||
director = etree.SubElement(episode, "director")
|
||||
director_text = myEp['director']
|
||||
if director_text != None:
|
||||
director.text = director_text
|
||||
|
||||
credits = etree.SubElement(episode, "credits")
|
||||
credits_text = myEp['writer']
|
||||
if credits_text != None:
|
||||
credits.text = credits_text
|
||||
|
||||
cast = etree.SubElement(episode, "cast")
|
||||
|
||||
if myShow["_actors"] != None:
|
||||
for actor in myShow['_actors']:
|
||||
cur_actor_name_text = actor['name']
|
||||
|
||||
if cur_actor_name_text != None and cur_actor_name_text.strip():
|
||||
cur_actor = etree.SubElement(cast, "actor")
|
||||
cur_actor.text = cur_actor_name_text.strip()
|
||||
|
||||
else:
|
||||
# append data from (if any) related episodes
|
||||
|
||||
if curEpToWrite.name:
|
||||
if not EpisodeName.text:
|
||||
EpisodeName.text = curEpToWrite.name
|
||||
else:
|
||||
EpisodeName.text = EpisodeName.text + ", " + curEpToWrite.name
|
||||
|
||||
if curEpToWrite.description:
|
||||
if not Overview.text:
|
||||
Overview.text = curEpToWrite.description
|
||||
else:
|
||||
Overview.text = Overview.text + "\r" + curEpToWrite.description
|
||||
|
||||
helpers.indentXML(rootNode)
|
||||
data = etree.ElementTree(rootNode)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
# present a standard "interface" from the module
|
||||
metadata_class = Mede8erMetadata
|
@ -180,13 +180,6 @@ class GenericProvider:
|
||||
|
||||
return True
|
||||
|
||||
def searchRSS(self):
|
||||
|
||||
self._checkAuth()
|
||||
self.cache.updateCache()
|
||||
|
||||
return self.cache.findNeededEpisodes()
|
||||
|
||||
def getQuality(self, item):
|
||||
"""
|
||||
Figures out the quality of the given RSS item node
|
||||
@ -236,9 +229,6 @@ class GenericProvider:
|
||||
searchItems = {}
|
||||
itemList = []
|
||||
|
||||
#if not manualSearch:
|
||||
# self.cache.updateCache()
|
||||
|
||||
for epObj in episodes:
|
||||
cacheResult = self.cache.searchCache(epObj, manualSearch)
|
||||
if len(cacheResult):
|
||||
|
@ -291,7 +291,6 @@ class NewznabCache(tvcache.TVCache):
|
||||
logger.log(u"Clearing " + self.provider.name + " cache and updating with new information")
|
||||
self._clearCache()
|
||||
|
||||
|
||||
if self._checkAuth(data):
|
||||
items = data.entries
|
||||
ql = []
|
||||
@ -325,6 +324,6 @@ class NewznabCache(tvcache.TVCache):
|
||||
|
||||
url = self._translateLinkURL(url)
|
||||
|
||||
logger.log(u"Adding item from RSS to cache: " + title, logger.DEBUG)
|
||||
logger.log(u"Attempting to add item from RSS to cache: " + title, logger.DEBUG)
|
||||
|
||||
return self._addCacheEntry(title, url)
|
||||
|
@ -20,17 +20,19 @@ from __future__ import with_statement
|
||||
|
||||
import sickbeard
|
||||
|
||||
from sickbeard import search_queue
|
||||
from sickbeard import logger
|
||||
|
||||
import threading
|
||||
|
||||
|
||||
class CurrentSearcher():
|
||||
class RSSUpdater():
|
||||
def __init__(self):
|
||||
self.lock = threading.Lock()
|
||||
|
||||
self.amActive = False
|
||||
|
||||
def run(self):
|
||||
search_queue_item = search_queue.RSSSearchQueueItem()
|
||||
sickbeard.searchQueueScheduler.action.add_item(search_queue_item)
|
||||
providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()]
|
||||
|
||||
for provider in providers:
|
||||
logger.log(u"Updating RSS cache for provider [" + provider.name + "]")
|
||||
provider.cache.updateCache()
|
@ -19,8 +19,6 @@
|
||||
from __future__ import with_statement
|
||||
|
||||
import datetime
|
||||
import Queue
|
||||
import time
|
||||
import traceback
|
||||
import threading
|
||||
|
||||
@ -33,11 +31,8 @@ from sickbeard import ui
|
||||
search_queue_lock = threading.Lock()
|
||||
|
||||
BACKLOG_SEARCH = 10
|
||||
RSS_SEARCH = 20
|
||||
FAILED_SEARCH = 30
|
||||
MANUAL_SEARCH = 30
|
||||
SNATCH = 40
|
||||
|
||||
|
||||
class SearchQueue(generic_queue.GenericQueue):
|
||||
def __init__(self):
|
||||
@ -109,8 +104,6 @@ class ManualSearchQueueItem(generic_queue.QueueItem):
|
||||
def execute(self):
|
||||
generic_queue.QueueItem.execute(self)
|
||||
|
||||
didSearch = False
|
||||
|
||||
try:
|
||||
logger.log("Beginning manual search for [" + self.ep_obj.prettyName() + "]")
|
||||
searchResult = search.searchProviders(self, self.show, self.ep_obj.season, [self.ep_obj],False,True)
|
||||
@ -145,6 +138,8 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||
self.segment = segment
|
||||
self.wantedEpisodes = []
|
||||
|
||||
self._changeMissingEpisodes()
|
||||
|
||||
logger.log(u"Seeing if we need any episodes from " + self.show.name + " season " + str(self.segment))
|
||||
|
||||
myDB = db.DBConnection()
|
||||
@ -173,9 +168,6 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||
def execute(self):
|
||||
generic_queue.QueueItem.execute(self)
|
||||
|
||||
fs = []
|
||||
didSearch = False
|
||||
|
||||
# check if we want to search for season packs instead of just season/episode
|
||||
seasonSearch = False
|
||||
seasonEps = self.show.getAllEpisodes(self.segment)
|
||||
@ -222,6 +214,37 @@ class BacklogQueueItem(generic_queue.QueueItem):
|
||||
return wantedEpisodes
|
||||
|
||||
|
||||
def _changeMissingEpisodes(self):
|
||||
|
||||
logger.log(u"Changing all old missing episodes to status WANTED")
|
||||
|
||||
curDate = datetime.date.today().toordinal()
|
||||
|
||||
myDB = db.DBConnection()
|
||||
sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE status = ? AND airdate < ?",
|
||||
[common.UNAIRED, curDate])
|
||||
|
||||
for sqlEp in sqlResults:
|
||||
|
||||
try:
|
||||
show = helpers.findCertainShow(sickbeard.showList, int(sqlEp["showid"]))
|
||||
except exceptions.MultipleShowObjectsException:
|
||||
logger.log(u"ERROR: expected to find a single show matching " + sqlEp["showid"])
|
||||
return None
|
||||
|
||||
if show == None:
|
||||
logger.log(u"Unable to find the show with ID " + str(
|
||||
sqlEp["showid"]) + " in your show list! DB value was " + str(sqlEp), logger.ERROR)
|
||||
return None
|
||||
|
||||
ep = show.getEpisode(sqlEp["season"], sqlEp["episode"])
|
||||
with ep.lock:
|
||||
if ep.show.paused:
|
||||
ep.status = common.SKIPPED
|
||||
else:
|
||||
ep.status = common.WANTED
|
||||
ep.saveToDB()
|
||||
|
||||
class FailedQueueItem(generic_queue.QueueItem):
|
||||
def __init__(self, show, episodes):
|
||||
generic_queue.QueueItem.__init__(self, 'Retry', FAILED_SEARCH)
|
||||
@ -234,8 +257,6 @@ class FailedQueueItem(generic_queue.QueueItem):
|
||||
def execute(self):
|
||||
generic_queue.QueueItem.execute(self)
|
||||
|
||||
fs = []
|
||||
didSearch = False
|
||||
episodes = []
|
||||
|
||||
for i, epObj in enumerate(episodes):
|
||||
@ -253,7 +274,7 @@ class FailedQueueItem(generic_queue.QueueItem):
|
||||
|
||||
try:
|
||||
logger.log(
|
||||
"Beginning failed download search for episodes from Season [" + self.episodes[0].season + "]")
|
||||
"Beginning failed download search for episodes from Season [" + str(self.episodes[0].season) + "]")
|
||||
|
||||
searchResult = search.searchProviders(self.show, self.episodes[0].season, self.episodes, False, True)
|
||||
if searchResult:
|
||||
|
@ -251,24 +251,18 @@ class TVCache():
|
||||
indexerid = int(cacheResult)
|
||||
|
||||
if not indexerid:
|
||||
name_list = show_name_helpers.sceneToNormalShowNames(parse_result.series_name)
|
||||
for cur_name in name_list:
|
||||
if not indexerid:
|
||||
for curShow in sickbeard.showList:
|
||||
if show_name_helpers.isGoodResult(cur_name, curShow, False):
|
||||
indexerid = int(curShow.indexerid)
|
||||
break
|
||||
showResult = helpers.searchDBForShow(parse_result.series_name)
|
||||
if showResult:
|
||||
indexerid = int(showResult[0])
|
||||
|
||||
if not indexerid:
|
||||
# do a scene reverse-lookup to get a list of all possible names
|
||||
scene_id = sickbeard.scene_exceptions.get_scene_exception_by_name(cur_name)
|
||||
if scene_id:
|
||||
indexerid = int(scene_id)
|
||||
break
|
||||
if not indexerid:
|
||||
for curShow in sickbeard.showList:
|
||||
if show_name_helpers.isGoodResult(name, curShow, False):
|
||||
indexerid = int(curShow.indexerid)
|
||||
break
|
||||
|
||||
showObj = None
|
||||
if indexerid:
|
||||
logger.log(u"Found Indexer ID: [" + str(indexerid) + "], for [" + str(cur_name) + "}", logger.DEBUG)
|
||||
showObj = helpers.findCertainShow(sickbeard.showList, indexerid)
|
||||
|
||||
if not showObj:
|
||||
@ -318,7 +312,6 @@ class TVCache():
|
||||
neededEps = self.findNeededEpisodes(episode, manualSearch)
|
||||
return neededEps
|
||||
|
||||
|
||||
def listPropers(self, date=None, delimiter="."):
|
||||
myDB = self._getDB()
|
||||
|
||||
|
@ -1051,7 +1051,7 @@ class ConfigSearch:
|
||||
def saveSearch(self, use_nzbs=None, use_torrents=None, nzb_dir=None, sab_username=None, sab_password=None,
|
||||
sab_apikey=None, sab_category=None, sab_host=None, nzbget_username=None, nzbget_password=None,
|
||||
nzbget_category=None, nzbget_host=None, nzbget_use_https=None,
|
||||
nzb_method=None, torrent_method=None, usenet_retention=None, search_frequency=None,
|
||||
nzb_method=None, torrent_method=None, usenet_retention=None, rssupdate_frequency=None, backlog_frequency=None,
|
||||
download_propers=None, prefer_episode_releases=None, allow_high_priority=None, backlog_startup=None,
|
||||
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
|
||||
torrent_label=None, torrent_path=None, torrent_verify_cert=None,
|
||||
@ -1065,7 +1065,7 @@ class ConfigSearch:
|
||||
if not config.change_TORRENT_DIR(torrent_dir):
|
||||
results += ["Unable to create directory " + os.path.normpath(torrent_dir) + ", dir not changed."]
|
||||
|
||||
config.change_SEARCH_FREQUENCY(search_frequency)
|
||||
config.change_RSSUPDATE_FREQUENCY(rssupdate_frequency)
|
||||
|
||||
sickbeard.USE_NZBS = config.checkbox_to_value(use_nzbs)
|
||||
sickbeard.USE_TORRENTS = config.checkbox_to_value(use_torrents)
|
||||
@ -1084,6 +1084,8 @@ class ConfigSearch:
|
||||
|
||||
sickbeard.PREFER_EPISODE_RELEASES = config.checkbox_to_value(prefer_episode_releases)
|
||||
sickbeard.ALLOW_HIGH_PRIORITY = config.checkbox_to_value(allow_high_priority)
|
||||
|
||||
config.change_BACKLOG_FREQUENCY(backlog_frequency)
|
||||
sickbeard.BACKLOG_STARTUP = config.checkbox_to_value(backlog_startup)
|
||||
if sickbeard.BACKLOG_STARTUP:
|
||||
sickbeard.backlogSearchScheduler.silent = False
|
||||
@ -1137,7 +1139,7 @@ class ConfigPostProcessing:
|
||||
@cherrypy.expose
|
||||
def savePostProcessing(self, naming_pattern=None, naming_multi_ep=None,
|
||||
xbmc_data=None, xbmc_12plus_data=None, mediabrowser_data=None, sony_ps3_data=None,
|
||||
wdtv_data=None, tivo_data=None,
|
||||
wdtv_data=None, tivo_data=None, mede8er_data=None,
|
||||
keep_processed_dir=None, process_method=None, process_automatically=None,
|
||||
rename_episodes=None, unpack=None,
|
||||
move_associated_files=None, tv_download_dir=None, naming_custom_abd=None,
|
||||
@ -1183,6 +1185,7 @@ class ConfigPostProcessing:
|
||||
sickbeard.METADATA_PS3 = sony_ps3_data
|
||||
sickbeard.METADATA_WDTV = wdtv_data
|
||||
sickbeard.METADATA_TIVO = tivo_data
|
||||
sickbeard.METADATA_MEDE8ER = mede8er_data
|
||||
|
||||
sickbeard.metadata_provider_dict['XBMC'].set_config(sickbeard.METADATA_XBMC)
|
||||
sickbeard.metadata_provider_dict['XBMC 12+'].set_config(sickbeard.METADATA_XBMC_12PLUS)
|
||||
@ -1190,6 +1193,7 @@ class ConfigPostProcessing:
|
||||
sickbeard.metadata_provider_dict['Sony PS3'].set_config(sickbeard.METADATA_PS3)
|
||||
sickbeard.metadata_provider_dict['WDTV'].set_config(sickbeard.METADATA_WDTV)
|
||||
sickbeard.metadata_provider_dict['TIVO'].set_config(sickbeard.METADATA_TIVO)
|
||||
sickbeard.metadata_provider_dict['Mede8er'].set_config(sickbeard.METADATA_MEDE8ER)
|
||||
|
||||
if self.isNamingValid(naming_pattern, naming_multi_ep) != "invalid":
|
||||
sickbeard.NAMING_PATTERN = naming_pattern
|
||||
@ -1562,16 +1566,16 @@ class ConfigProviders:
|
||||
else:
|
||||
logger.log(u"don't know what " + curProvider + " is, skipping")
|
||||
|
||||
sickbeard.EZRSS_RATIO = ezrss_ratio
|
||||
sickbeard.EZRSS_RATIO = config.to_int(ezrss_ratio)
|
||||
|
||||
sickbeard.TVTORRENTS_DIGEST = tvtorrents_digest.strip()
|
||||
sickbeard.TVTORRENTS_HASH = tvtorrents_hash.strip()
|
||||
sickbeard.TVTORRENTS_RATIO = tvtorrents_ratio
|
||||
sickbeard.TVTORRENTS_RATIO = config.to_int(tvtorrents_ratio)
|
||||
|
||||
sickbeard.BTN_API_KEY = btn_api_key.strip()
|
||||
sickbeard.BTN_RATIO = btn_ratio
|
||||
sickbeard.BTN_RATIO = config.to_int(btn_ratio)
|
||||
|
||||
sickbeard.THEPIRATEBAY_RATIO = thepiratebay_ratio
|
||||
sickbeard.THEPIRATEBAY_RATIO = config.to_int(thepiratebay_ratio)
|
||||
sickbeard.THEPIRATEBAY_TRUSTED = config.checkbox_to_value(thepiratebay_trusted)
|
||||
|
||||
thepiratebay_proxy = config.checkbox_to_value(thepiratebay_proxy)
|
||||
@ -1584,48 +1588,48 @@ class ConfigProviders:
|
||||
|
||||
sickbeard.TORRENTLEECH_USERNAME = torrentleech_username
|
||||
sickbeard.TORRENTLEECH_PASSWORD = torrentleech_password
|
||||
sickbeard.TORRENTLEECH_RATIO = torrentleech_ratio
|
||||
sickbeard.TORRENTLEECH_RATIO = config.to_int(torrentleech_ratio)
|
||||
|
||||
sickbeard.IPTORRENTS_USERNAME = iptorrents_username.strip()
|
||||
sickbeard.IPTORRENTS_PASSWORD = iptorrents_password.strip()
|
||||
sickbeard.IPTORRENTS_RATIO = iptorrents_ratio
|
||||
sickbeard.IPTORRENTS_RATIO = config.to_int(iptorrents_ratio)
|
||||
|
||||
sickbeard.IPTORRENTS_FREELEECH = config.checkbox_to_value(iptorrents_freeleech)
|
||||
|
||||
sickbeard.KAT_TRUSTED = config.checkbox_to_value(kat_trusted)
|
||||
sickbeard.KAT_RATIO = kat_ratio
|
||||
sickbeard.KAT_RATIO = config.to_int(kat_ratio)
|
||||
sickbeard.KAT_VERIFIED = config.checkbox_to_value(kat_verified)
|
||||
|
||||
sickbeard.PUBLICHD_RATIO = publichd_ratio
|
||||
|
||||
sickbeard.TORRENTDAY_USERNAME = torrentday_username.strip()
|
||||
sickbeard.TORRENTDAY_PASSWORD = torrentday_password.strip()
|
||||
sickbeard.TORRENTDAY_RATIO = torrentday_ratio
|
||||
sickbeard.TORRENTDAY_RATIO = config.to_int(torrentday_ratio)
|
||||
|
||||
sickbeard.TORRENTDAY_FREELEECH = config.checkbox_to_value(torrentday_freeleech)
|
||||
|
||||
sickbeard.SCC_USERNAME = scc_username.strip()
|
||||
sickbeard.SCC_PASSWORD = scc_password.strip()
|
||||
sickbeard.SCC_RATIO = scc_ratio
|
||||
sickbeard.SCC_RATIO = config.to_int(scc_ratio)
|
||||
|
||||
sickbeard.HDTORRENTS_USERNAME = hdtorrents_username.strip()
|
||||
sickbeard.HDTORRENTS_PASSWORD = hdtorrents_password.strip()
|
||||
sickbeard.HDTORRENTS_RATIO = hdtorrents_ratio
|
||||
sickbeard.HDTORRENTS_RATIO = config.to_int(hdtorrents_ratio)
|
||||
|
||||
sickbeard.HDBITS_USERNAME = hdbits_username.strip()
|
||||
sickbeard.HDBITS_PASSKEY = hdbits_passkey.strip()
|
||||
sickbeard.HDBITS_RATIO = hdbits_ratio
|
||||
sickbeard.HDBITS_RATIO = config.to_int(hdbits_ratio)
|
||||
|
||||
sickbeard.OMGWTFNZBS_USERNAME = omgwtfnzbs_username.strip()
|
||||
sickbeard.OMGWTFNZBS_APIKEY = omgwtfnzbs_apikey.strip()
|
||||
|
||||
sickbeard.NEXTGEN_USERNAME = nextgen_username.strip()
|
||||
sickbeard.NEXTGEN_PASSWORD = nextgen_password.strip()
|
||||
sickbeard.NEXTGEN_RATIO = nextgen_ratio
|
||||
sickbeard.NEXTGEN_RATIO = config.to_int(nextgen_ratio)
|
||||
|
||||
sickbeard.SPEEDCD_USERNAME = speedcd_username.strip()
|
||||
sickbeard.SPEEDCD_PASSWORD = speedcd_password.strip()
|
||||
sickbeard.SPEEDCD_RATIO = speedcd_ratio
|
||||
sickbeard.SPEEDCD_RATIO = config.to_int(speedcd_ratio)
|
||||
sickbeard.SPEEDCD_FREELEECH = config.checkbox_to_value(speedcd_freeleech)
|
||||
|
||||
sickbeard.NEWZNAB_DATA = '!!!'.join([x.configStr() for x in sickbeard.newznabProviderList])
|
||||
|
Loading…
Reference in New Issue
Block a user