1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Added config option download_url

Added field to configure download_url in general --> interface
Added link to download episodes in the displayShow template, using download_url
This commit is contained in:
Kevin Lemonnier 2015-01-14 16:06:28 +01:00
parent 33e95870e0
commit 39edad882e
4 changed files with 42 additions and 3 deletions

View File

@ -301,6 +301,18 @@
</label>
</div>
<div class="field-pair">
<label for="download_url">
<span class="component-title">Download url</span>
<input type="text" name="download_url" id="download_url" value="$sickbeard.DOWNLOAD_URL" size="35" />
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">URL where the shows can be downloaded.</span>
</label>
</div>
<input type="submit" class="btn config_submitter" value="Save Changes" />
</fieldset>

View File

@ -6,6 +6,7 @@
#from lib import subliminal
#import os.path, os
#import datetime
#import urllib
#set global $title=$show.name
##set global $header = '<a></a>' %
@ -376,6 +377,7 @@
#end if
<th class="col-name">Name</th>
<th class="col-airdate">Airdate</th>
<th class="col-ep">Download</th>
#if $sickbeard.USE_SUBTITLES and $show.subtitles:
<th class="col-subtitles">Subtitles</th>
#end if
@ -471,6 +473,25 @@
<span class="${fuzzydate}">#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)))#</span>
</td>
<td>
#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'))
<center><a href="$filename">Download</a></center>
#else
#if $epLoc and $show._location and $epLoc.lower().startswith($show._location.lower()):
$epLoc[len($show._location)+1:]
#elif $epLoc and (not $epLoc.lower().startswith($show._location.lower()) or not $show._location):
$epLoc
#end if
#end if
</td>
#if $sickbeard.USE_SUBTITLES and $show.subtitles:
<td class="col-subtitles" align="center">
#if $epResult["subtitles"]:

View File

@ -138,6 +138,8 @@ WEB_IPV6 = None
PLAY_VIDEOS = False
DOWNLOAD_URL = None
HANDLE_REVERSE_PROXY = False
PROXY_SETTING = None
PROXY_INDEXERS = True
@ -525,7 +527,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__:
@ -640,6 +642,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')
@ -1431,6 +1435,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

View File

@ -3431,13 +3431,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)