diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index 59b8bf0b..dca5fd3d 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -321,6 +321,18 @@ +
+ + +
+ + diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 26268fd4..c85e9f49 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -6,6 +6,7 @@ #from lib import subliminal #import os.path, os #import datetime +#import urllib #set global $title=$show.name ##set global $header = '' % @@ -376,6 +377,9 @@ #end if Name Airdate + #if len($sickbeard.DOWNLOAD_URL) > 0 + Download + #end if #if $sickbeard.USE_SUBTITLES and $show.subtitles: Subtitles #end if @@ -470,6 +474,21 @@ #if int($epResult['airdate']) == 1 then 'never' else $sbdatetime.sbdatetime.sbfdate($sbdatetime.sbdatetime.convert_to_setting($network_timezones.parse_date_time($epResult['airdate'],$show.airs,$show.network)))# + + #if len($sickbeard.DOWNLOAD_URL) > 0 and len($epResult['location']) > 0 + + #set $filename = $epResult['location'] + #for $rootDir in $sickbeard.ROOT_DIRS.split('|') + #if $rootDir.startswith('/') + #set $filename = $filename.replace($rootDir, "") + #end if + #end for + #set $filename = $sickbeard.DOWNLOAD_URL + $urllib.quote($filename.encode('utf8')) +
Download
+ + #elif len($sickbeard.DOWNLOAD_URL) > 0 + + #end if #if $sickbeard.USE_SUBTITLES and $show.subtitles: diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 93997c60..1676a853 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -140,6 +140,8 @@ WEB_IPV6 = None PLAY_VIDEOS = False +DOWNLOAD_URL = None + HANDLE_REVERSE_PROXY = False PROXY_SETTING = None PROXY_INDEXERS = True @@ -534,7 +536,7 @@ def initialize(consoleLogging=True): USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, PROXY_INDEXERS, \ AUTOPOSTPROCESSER_FREQUENCY, DEFAULT_AUTOPOSTPROCESSER_FREQUENCY, MIN_AUTOPOSTPROCESSER_FREQUENCY, \ ANIME_DEFAULT, NAMING_ANIME, ANIMESUPPORT, USE_ANIDB, ANIDB_USERNAME, ANIDB_PASSWORD, ANIDB_USE_MYLIST, \ - ANIME_SPLIT_HOME, SCENE_DEFAULT, PLAY_VIDEOS, BACKLOG_DAYS, GIT_ORG, GIT_REPO, GIT_USERNAME, GIT_PASSWORD, \ + ANIME_SPLIT_HOME, SCENE_DEFAULT, PLAY_VIDEOS, DOWNLOAD_URL, BACKLOG_DAYS, GIT_ORG, GIT_REPO, GIT_USERNAME, GIT_PASSWORD, \ GIT_AUTOISSUES, gh if __INITIALIZED__: @@ -650,6 +652,8 @@ def initialize(consoleLogging=True): PLAY_VIDEOS = bool(check_setting_int(CFG, 'General', 'play_videos', 0)) + DOWNLOAD_URL = check_setting_str(CFG, 'General', 'download_url', "") + LOCALHOST_IP = check_setting_str(CFG, 'General', 'localhost_ip', '') CPU_PRESET = check_setting_str(CFG, 'General', 'cpu_preset', 'NORMAL') @@ -1450,6 +1454,7 @@ def save_config(): new_config['General']['web_username'] = WEB_USERNAME new_config['General']['web_password'] = helpers.encrypt(WEB_PASSWORD, ENCRYPTION_VERSION) new_config['General']['play_videos'] = int(PLAY_VIDEOS) + new_config['General']['download_url'] = DOWNLOAD_URL new_config['General']['localhost_ip'] = LOCALHOST_IP new_config['General']['cpu_preset'] = CPU_PRESET new_config['General']['anon_redirect'] = ANON_REDIRECT diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index d2438202..ccc27dc5 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3451,13 +3451,14 @@ class ConfigGeneral(Config): proxy_setting=None, proxy_indexers=None, anon_redirect=None, git_path=None, git_remote=None, calendar_unprotected=None, fuzzy_dating=None, trim_zero=None, date_preset=None, date_preset_na=None, time_preset=None, - indexer_timeout=None, play_videos=None, rootDir=None, theme_name=None, + indexer_timeout=None, play_videos=None, download_url=None, rootDir=None, theme_name=None, git_reset=None, git_username=None, git_password=None, git_autoissues=None): results = [] # Misc sickbeard.PLAY_VIDEOS = config.checkbox_to_value(play_videos) + sickbeard.DOWNLOAD_URL = download_url sickbeard.LAUNCH_BROWSER = config.checkbox_to_value(launch_browser) config.change_VERSION_NOTIFY(config.checkbox_to_value(version_notify)) sickbeard.AUTO_UPDATE = config.checkbox_to_value(auto_update)