diff --git a/CHANGES.md b/CHANGES.md index 8a38a49f08c172797bedcc335b6d9e2ab11e1535..8f34e83582ae3e4d865d96170de5f4bac1d5024d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -47,7 +47,9 @@ * Add handler for when Trakt returns no results for Add Show/Add Trending Show page * Fix image links when anchor child images are not found at Trakt on Add Show/Add Trending Show page * Add image to be used when Trakt posters are void on Add Show/Add Trending Show page -* Fix growl registration not sending sickrage update notification registration. +* Fix growl registration not sending sickrage an update notification registration +* Add an anonymous redirect builder for external links +* Update xbmc link to Kodi at Config Notifications * Fix missing url for kickasstorrents in config_providers * Fix post processing when using tvrage indexer and mediabrowser metadata generation diff --git a/gui/slick/interfaces/default/comingEpisodes.tmpl b/gui/slick/interfaces/default/comingEpisodes.tmpl index 956066d71005fd8dab943b0f51af022d1f49d22f..c3c39466df55badcce2d5f286da6e2b3d8b17a35 100644 --- a/gui/slick/interfaces/default/comingEpisodes.tmpl +++ b/gui/slick/interfaces/default/comingEpisodes.tmpl @@ -2,49 +2,50 @@ #import datetime #from sickbeard.common import * #from sickbeard import sbdatetime +#from sickbeard.helpers import anon_url -#set global $title="Coming Episodes" -#set global $header="Coming Episodes" +#set global $title = 'Coming Episodes' +#set global $header = 'Coming Episodes' -#set global $sbPath=".." +#set global $sbPath = '..' -#set global $topmenu="comingEpisodes" +#set global $topmenu = 'comingEpisodes' #import os.path -#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') #set $sort = $sickbeard.COMING_EPS_SORT <script type="text/javascript" src="$sbRoot/js/ajaxEpSearch.js?$sbPID"></script> -#if $varExists('header') +#if $varExists('header') <h1 class="header">$header</h1> -#else +#else <h1 class="title">$title</h1> #end if <style type="text/css"> -#SubMenu {display:none;} -#contentWrapper {padding-top:30px;} +#SubMenu {display:none} +#contentWrapper {padding-top:30px} </style> <div class="h2footer pull-right"> - <span> Layout: + <span>Layout: <select name="layout" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;"> - <option value="$sbRoot/setComingEpsLayout/?layout=poster" #if $sickbeard.COMING_EPS_LAYOUT == "poster" then "selected=\"selected\"" else ""#>Poster</option> - <option value="$sbRoot/setComingEpsLayout/?layout=calendar" #if $sickbeard.COMING_EPS_LAYOUT == "calendar" then "selected=\"selected\"" else ""#>Calendar</option> - <option value="$sbRoot/setComingEpsLayout/?layout=banner" #if $sickbeard.COMING_EPS_LAYOUT == "banner" then "selected=\"selected\"" else ""#>Banner</option> - <option value="$sbRoot/setComingEpsLayout/?layout=list" #if $sickbeard.COMING_EPS_LAYOUT == "list" then "selected=\"selected\"" else ""#>List</option> + <option value="$sbRoot/setComingEpsLayout/?layout=poster" #if 'poster' == $sickbeard.COMING_EPS_LAYOUT then 'selected="selected"' else ''#>Poster</option> + <option value="$sbRoot/setComingEpsLayout/?layout=calendar" #if 'calendar' == $sickbeard.COMING_EPS_LAYOUT then 'selected="selected"' else ''#>Calendar</option> + <option value="$sbRoot/setComingEpsLayout/?layout=banner" #if 'banner' == $sickbeard.COMING_EPS_LAYOUT then 'selected="selected"' else ''#>Banner</option> + <option value="$sbRoot/setComingEpsLayout/?layout=list" #if 'list' == $sickbeard.COMING_EPS_LAYOUT then 'selected="selected"' else ''#>List</option> </select> </span> - - <span> Sort By: + + <span>Sort By: <select name="sort" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;"> - <option value="$sbRoot/setComingEpsSort/?sort=date" #if $sickbeard.COMING_EPS_SORT == "date" then "selected=\"selected\"" else ""#>Date</option> - <option value="$sbRoot/setComingEpsSort/?sort=network" #if $sickbeard.COMING_EPS_SORT == "network" then "selected=\"selected\"" else ""#>Network</option> - <option value="$sbRoot/setComingEpsSort/?sort=show" #if $sickbeard.COMING_EPS_SORT == "show" then "selected=\"selected\"" else ""#>Show</option> + <option value="$sbRoot/setComingEpsSort/?sort=date" #if 'date' == $sickbeard.COMING_EPS_SORT then 'selected="selected"' else ''#>Date</option> + <option value="$sbRoot/setComingEpsSort/?sort=network" #if 'network' == $sickbeard.COMING_EPS_SORT then 'selected="selected"' else ''#>Network</option> + <option value="$sbRoot/setComingEpsSort/?sort=show" #if 'show' == $sickbeard.COMING_EPS_SORT then 'selected="selected"' else ''#>Show</option> </select> </span> - - <span> View Paused: + + <span>View Paused: <select name="viewpaused" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;"> <option value="$sbRoot/toggleComingEpsDisplayPaused"<%= (' selected="selected"', '')[True == sickbeard.COMING_EPS_DISPLAY_PAUSED] %>>Hidden</option> <option value="$sbRoot/toggleComingEpsDisplayPaused"<%= ('', ' selected="selected"')[True == sickbeard.COMING_EPS_DISPLAY_PAUSED] %>>Shown</option> @@ -53,57 +54,58 @@ </div> <div class="key pull-right"> -#if $layout != 'calendar': - <b>Key:</b> - <span class="listing-key listing-overdue">Missed</span> - <span class="listing-key listing-current">Current</span> - <span class="listing-key listing-default">Future</span> - <span class="listing-key listing-toofar">Distant</span> +#if 'calendar' != $layout: + <b>Key:</b> + <span class="listing-key listing-overdue">Missed</span> + <span class="listing-key listing-current">Current</span> + <span class="listing-key listing-default">Future</span> + <span class="listing-key listing-toofar">Distant</span> #end if <a class="btn btn-inline forceBacklog" href="webcal://$sbHost:$sbHttpPort/calendar"> - <i class="icon-calendar icon-white"></i>Subscribe</a> + <i class="icon-calendar icon-white"></i>Subscribe</a> </div> <br> -#if $layout == 'list': +#if 'list' == $layout: <!-- start list view //--> + <script type="text/javascript" src="$sbRoot/js/plotTooltip.js?$sbPID"></script> <script type="text/javascript" charset="utf-8"> <!-- \$.tablesorter.addParser({ id: 'loadingNames', is: function(s) { - return false; + return false }, format: function(s) { - if (s.indexOf('Loading...') == 0) - return s.replace('Loading...','000'); - #if not $sickbeard.SORT_ARTICLE: - return (s || '').replace(/^(The|A|An)\s/i,''); - #else: - return (s || ''); - #end if + if (0 == s.indexOf('Loading...')) + return s.replace('Loading...', '000') +#if not $sickbeard.SORT_ARTICLE: + return (s || '').replace(/^(The|A|An)\s/i, '') +#else: + return (s || '') +#end if }, type: 'text' }); \$.tablesorter.addParser({ id: 'quality', is: function(s) { - return false; + return false }, format: function(s) { - return s.replace('hd1080p',5).replace('hd720p',4).replace('hd',3).replace('sd',2).replace('any',1).replace('best',0).replace('custom',7); + return s.replace('hd1080p', 5).replace('hd720p', 4).replace('hd', 3).replace('sd', 2).replace('any', 1).replace('best', 0).replace('custom', 7) }, type: 'numeric' }); \$.tablesorter.addParser({ id: 'cDate', is: function(s) { - return false; + return false }, format: function(s) { - return s; + return s }, type: 'numeric' }); @@ -114,15 +116,16 @@ #if $sort not in $sort_codes: $sort = 'date' #end if - sortList = [[$sort_codes[$sort],0]]; - \$("#showListTable:has(tbody tr)").tablesorter({ + sortList = [[$sort_codes[$sort], 0]]; + + \$('#showListTable:has(tbody tr)').tablesorter({ widgets: ['stickyHeaders'], sortList: sortList, textExtraction: { - 0: function(node) { return \$(node).find("span").text().toLowerCase(); }, - 4: function(node) { return \$(node).find("img").attr("alt"); }, - 5: function(node) { return \$(node).find("span").text().toLowerCase(); } + 0: function(node) { return \$(node).find('span').text().toLowerCase() }, + 4: function(node) { return \$(node).find('img').attr('alt') }, + 5: function(node) { return \$(node).find('span').text().toLowerCase() } }, headers: { 0: { sorter: 'cDate' }, @@ -146,7 +149,7 @@ dateHasTime : true, dateFormat : '${sickbeard.DATE_PRESET}', timeFormat : '${sickbeard.TIME_PRESET}', - trimZero : #if $sickbeard.TRIM_ZERO then "true" else "false"# + trimZero : #if $sickbeard.TRIM_ZERO then 'true' else 'false'# }); #end if @@ -154,13 +157,13 @@ //--> </script> -#set $show_div = "listing-default" +#set $show_div = 'listing-default' <input type="hidden" id="sbRoot" value="$sbRoot" /> <table id="showListTable" class="sickbeardTable tablesorter seasonstyle" cellspacing="1" border="0" cellpadding="0"> - <thead> + <thead> <tr> <th>Airdate</th> <th>Show</th> @@ -172,108 +175,110 @@ <th>Search</th> </tr> </thead> - - <tbody style="text-shadow:none;"> - #for $cur_result in $sql_results: - #set $cur_indexer = int($cur_result["indexer"]) - #set $runtime = $cur_result["runtime"] + <tbody style="text-shadow:none;"> - #if int($cur_result["paused"]) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: - #continue - #end if +#for $cur_result in $sql_results: + #set $cur_indexer = int($cur_result['indexer']) + #set $runtime = $cur_result['runtime'] - #set $cur_ep_airdate = $cur_result["localtime"].date() + #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: + #continue + #end if - #if $runtime: - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) - #if $cur_ep_enddate < $today: - #set $show_div = "listing-overdue" - #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "listing-toofar" - #elif $cur_ep_airdate >= $today.date() and $cur_ep_airdate < $next_week.date(): - #if $cur_ep_airdate == $today.date(): - #set $show_div = "listing-current" - #else: - #set $show_div = "listing-default" - #end if + #set $cur_ep_airdate = $cur_result['localtime'].date() + + #if $runtime: + #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) + #if $cur_ep_enddate < $today: + #set $show_div = 'listing-overdue' + #elif $cur_ep_airdate >= $next_week.date(): + #set $show_div = 'listing-toofar' + #elif $cur_ep_airdate >= $today.date() and $cur_ep_airdate < $next_week.date(): + #if $cur_ep_airdate == $today.date(): + #set $show_div = 'listing-current' + #else: + #set $show_div = 'listing-default' #end if #end if + #end if - <!-- start $cur_result["show_name"] //--> + <!-- start $cur_result['show_name'] //--> <tr class="$show_div"> ## forced to use a div to wrap airdate, the column sort went crazy with a span <td align="center" class="nowrap"> - <div class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)</div><span class="sort_data">$time.mktime($cur_result["localtime"].timetuple())</span> + <div class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdatetime($cur_result['localtime']).decode($sickbeard.SYS_ENCODING)</div><span class="sort_data">$time.mktime($cur_result['localtime'].timetuple())</span> </td> - - <td class="tvShow"><a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}">$cur_result["show_name"]</a> - #if int($cur_result["paused"]): - <span class="pause">[paused]</span> - #end if + + <td class="tvShow"><a href="$sbRoot/home/displayShow?show=${cur_result['showid']}">$cur_result['show_name']</a> +#if int($cur_result['paused']): + <span class="pause">[paused]</span> +#end if </td> - + <td class="nowrap" align="center"> - <%="S%02i" % int(cur_result["season"])+"E%02i" % int(cur_result["episode"]) %> + <%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> </td> - + <td> - #if $cur_result["description"] != "" and $cur_result["description"] != None: - <img alt="" src="$sbRoot/images/info32.png" height="16" width="16" class="plotInfo" id="plot_info_<%=str(cur_result["showid"])+"_"+str(cur_result["season"])+"_"+str(cur_result["episode"])%>" /> - #else: - <img src="$sbRoot/images/info32.png" width="16" height="16" class="plotInfoNone" alt="" /> - #end if - $cur_result["name"] +#if $cur_result['description']: + <img alt='' src='$sbRoot/images/info32.png' height='16' width='16' class='plotInfo' id="plot_info_<%= '%s_%s_%s' % (str(cur_result['showid']), str(cur_result['season']), str(cur_result['episode'])) %>" /> +#else: + <img alt="" src="$sbRoot/images/info32.png" width="16" height="16" class="plotInfoNone" /> +#end if + $cur_result['name'] </td> - + <td align="center"> - $cur_result["network"] + $cur_result['network'] </td> - + <td align="center"> - #if int($cur_result["quality"]) in $qualityPresets: - <span class="quality $qualityPresetStrings[int($cur_result["quality"])]">$qualityPresetStrings[int($cur_result["quality"])]</span> - #else: - <span class="quality Custom">Custom</span> - #end if +#if int($cur_result['quality']) in $qualityPresets: + <span class="quality $qualityPresetStrings[int($cur_result['quality'])]">$qualityPresetStrings[int($cur_result['quality'])]</span> +#else: + <span class="quality Custom">Custom</span> +#end if </td> - + <td align="center" style="vertical-align: middle;"> - #if $cur_result["imdb_id"]: - <a href="http://www.imdb.com/title/${cur_result["imdb_id"]}" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="http://www.imdb.com/title/${cur_result["imdb_id"]}"><img alt="[imdb]" height="16" width="16" src="$sbRoot/images/imdb.png" /> - #end if - <a href="$sickbeard.indexerApi($cur_indexer).config["show_url"]${cur_result["showid"]}" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="$sickbeard.indexerApi($cur_indexer).config["show_url"]${cur_result["showid"]}"><img alt="$sickbeard.indexerApi($cur_indexer).name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($cur_indexer).config["icon"]" /></a> +#if $cur_result['imdb_id']: + <a href="<%= anon_url('http://www.imdb.com/title/', cur_result['imdb_id']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="http://www.imdb.com/title/${cur_result['imdb_id']}"><img alt="[imdb]" height="16" width="16" src="$sbRoot/images/imdb.png" /> +#end if + <a href="<%= anon_url(sickbeard.indexerApi(cur_indexer).config['show_url'], cur_result['showid']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="$sickbeard.indexerApi($cur_indexer).config['show_url']${cur_result['showid']}"><img alt="$sickbeard.indexerApi($cur_indexer).name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($cur_indexer).config['icon']" /></a> </td> - + <td align="center"> - <a href="$sbRoot/home/searchEpisode?show=${cur_result["showid"]}&season=$cur_result["season"]&episode=$cur_result["episode"]" title="Manual Search" id="forceUpdate-${cur_result["showid"]}" class="forceUpdate epSearch"><img alt="[search]" height="16" width="16" src="$sbRoot/images/search16.png" id="forceUpdateImage-${cur_result["showid"]}" /></a> + <a href="$sbRoot/home/searchEpisode?show=${cur_result['showid']}&season=$cur_result['season']&episode=$cur_result['episode']" title="Manual Search" id="forceUpdate-${cur_result['showid']}" class="forceUpdate epSearch"><img alt="[search]" height="16" width="16" src="$sbRoot/images/search16.png" id="forceUpdateImage-${cur_result['showid']}" /></a> </td> </tr> - <!-- end $cur_result["show_name"] //--> - #end for - </tbody> - + <!-- end $cur_result['show_name'] //--> +#end for + </tbody> + <tfoot> <tr> <th rowspan="1" colspan="10" align="center"> </th> </tr> </tfoot> - + </table> <!-- end list view //--> + #else if $layout in ['banner', 'poster']: + <!-- start non list view //--> <script type="text/javascript" charset="utf-8"> <!-- -\$(document).ready(function(){ +\$(document).ready(function(){ \$('#sbRoot').ajaxEpSearch({'size': 16, 'loadingImage': 'loading16' + themeSpinner + '.gif'}); - \$(".ep_summary").hide(); - \$(".ep_summaryTrigger").click(function() { - \$(this).next(".ep_summary").slideToggle('normal', function() { - \$(this).prev(".ep_summaryTrigger").attr('src', function(i, src) { - return \$(this).next(".ep_summary").is(':visible') ? src.replace('plus','minus') : src.replace('minus','plus'); + \$('.ep_summary').hide(); + \$('.ep_summaryTrigger').click(function() { + \$(this).next('.ep_summary').slideToggle('normal', function() { + \$(this).prev('.ep_summaryTrigger').attr('src', function(i, src) { + return \$(this).next('.ep_summary').is(':visible') ? src.replace('plus','minus') : src.replace('minus','plus') }); }); }); @@ -287,7 +292,7 @@ dateHasTime : true, dateFormat : '${sickbeard.DATE_PRESET}', timeFormat : '${sickbeard.TIME_PRESET}', - trimZero : #if $sickbeard.TRIM_ZERO then "true" else "false"# + trimZero : #if $sickbeard.TRIM_ZERO then 'true' else 'false'# }); #end if @@ -299,52 +304,52 @@ #set $too_late_header = False #set $missed_header = False #set $today_header = False -#set $show_div = "ep_listing listing-default" +#set $show_div = 'ep_listing listing-default' -#if $sort == "show": - <br /><br /> +#if 'show' == $sort: + <br /><br /> #end if - + #for $cur_result in $sql_results: - #set $cur_indexer = int($cur_result["indexer"]) + #set $cur_indexer = int($cur_result['indexer']) -<!-- start $cur_result["show_name"] //--> - - #if int($cur_result["paused"]) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: +<!-- start $cur_result['show_name'] //--> + + #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if - #set $runtime = $cur_result["runtime"] + #set $runtime = $cur_result['runtime'] - #if $sort == "network": - #if $cur_result["network"] and $cur_segment != $cur_result["network"]: + #if 'network' == $sort: + #if $cur_result['network'] and $cur_segment != $cur_result['network']: <div class="comingepheader"> - <br><h2 class="network">$cur_result["network"]</h2> - #set $cur_segment = $cur_result["network"] + <br><h2 class="network">$cur_result['network']</h2> + #set $cur_segment = $cur_result['network'] #end if - #set $cur_ep_airdate = $cur_result["localtime"].date() + #set $cur_ep_airdate = $cur_result['localtime'].date() #if $runtime: - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today: - #set $show_div = "ep_listing listing-overdue" + #set $show_div = 'ep_listing listing-overdue' #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "ep_listing listing-toofar" + #set $show_div = 'ep_listing listing-toofar' #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): - #set $show_div = "ep_listing listing-current" + #set $show_div = 'ep_listing listing-current' #else: - #set $show_div = "ep_listing listing-default" + #set $show_div = 'ep_listing listing-default' #end if #end if #end if - - #elif $sort == "date": - #set $cur_ep_airdate = $cur_result["localtime"].date() + + #elif 'date' == $sort: + #set $cur_ep_airdate = $cur_result['localtime'].date() #if $cur_segment != $cur_ep_airdate: #if $runtime: - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today and $cur_ep_airdate != $today.date() and not $missed_header: <br /><h2 class="day">Missed</h2> #set $missed_header = True @@ -353,128 +358,128 @@ #set $too_late_header = True #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): - <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime("%A").decode($sickbeard.SYS_ENCODING).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2> + <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2> #set $today_header = True #else: - <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime("%A").decode($sickbeard.SYS_ENCODING).capitalize()</h2> + <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()</h2> #end if #end if #end if #set $cur_segment = $cur_ep_airdate #end if - - #if $cur_ep_airdate == $today.date() and not $today_header: - <div class="comingepheader"> - <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime("%A").decode($sickbeard.SYS_ENCODING).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2> + + #if $cur_ep_airdate == $today.date() and not $today_header: + <div class="comingepheader"> + <br /><h2 class="day">$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() <span style="font-size: 14px; vertical-align: top;">[Today]</span></h2> #set $today_header = True #end if - #if $runtime: - #if $cur_ep_enddate < $today: - #set $show_div = "ep_listing listing-overdue" - #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "ep_listing listing-toofar" - #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): - #if $cur_ep_airdate == $today.date(): - #set $show_div = "ep_listing listing-current" - #else: - #set $show_div = "ep_listing listing-default" - #end if - #end if - #end if - - #elif $sort == "show": - #set $cur_ep_airdate = $cur_result["localtime"].date() + #if $runtime: + #if $cur_ep_enddate < $today: + #set $show_div = 'ep_listing listing-overdue' + #elif $cur_ep_airdate >= $next_week.date(): + #set $show_div = 'ep_listing listing-toofar' + #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): + #if $cur_ep_airdate == $today.date(): + #set $show_div = 'ep_listing listing-current' + #else: + #set $show_div = 'ep_listing listing-default' + #end if + #end if + #end if + + #elif 'show' == $sort: + #set $cur_ep_airdate = $cur_result['localtime'].date() #if $runtime: - #set $cur_ep_enddate = $cur_result["localtime"] + datetime.timedelta(minutes=$runtime) + #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today: - #set $show_div = "ep_listing listing-overdue listingradius" + #set $show_div = 'ep_listing listing-overdue listingradius' #elif $cur_ep_airdate >= $next_week.date(): - #set $show_div = "ep_listing listing-toofar listingradius" + #set $show_div = 'ep_listing listing-toofar listingradius' #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): - #set $show_div = "ep_listing listing-current listingradius" + #set $show_div = 'ep_listing listing-current listingradius' #else: - #set $show_div = "ep_listing listing-default listingradius" + #set $show_div = 'ep_listing listing-default listingradius' #end if #end if #end if #end if -<div class="$show_div" id="listing-${cur_result["showid"]}"> +<div class="$show_div" id="listing-${cur_result['showid']}"> <div class="tvshowDiv"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> - <th #if $layout == 'banner' then "class=\"nobg\"" else "rowspan=\"2\""# valign="top"> - <a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}"><img alt="" class="#if $layout == 'banner' then "bannerThumb" else "posterThumb"#" src="$sbRoot/showPoster/?show=${cur_result["showid"]}&which=#if $layout == 'poster' then "poster_thumb" else $layout#" /></a> + <th #if 'banner' == $layout then 'class="nobg"' else 'rowspan="2"'# valign="top"> + <a href="$sbRoot/home/displayShow?show=${cur_result['showid']}"><img alt="" class="#if 'banner' == $layout then 'bannerThumb' else 'posterThumb'#" src="$sbRoot/showPoster/?show=${cur_result['showid']}&which=#if 'poster' == $layout then 'poster_thumb' else $layout#" /></a> </th> - #if $layout == 'banner': +#if 'banner' == $layout: </tr> <tr> - #end if - +#end if + <td class="next_episode"> <div class="clearfix"> <span class="tvshowTitle"> - <a href="$sbRoot/home/displayShow?show=${cur_result["showid"]}">$cur_result["show_name"] - #if int($cur_result["paused"]): + <a href="$sbRoot/home/displayShow?show=${cur_result['showid']}'>$cur_result['show_name'] + #if int($cur_result['paused']): <span class="pause">[paused]</span> - #end if + #end if </a></span> - + <span class="tvshowTitleIcons"> - #if $cur_result["imdb_id"]: - <a href="http://www.imdb.com/title/${cur_result["imdb_id"]}" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="http://www.imdb.com/title/${cur_result["imdb_id"]}"><img alt="[imdb]" height="16" width="16" src="$sbRoot/images/imdb.png" /> - #end if - <a href="$sickbeard.indexerApi($cur_indexer).config["show_url"]${cur_result["showid"]}" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="$sickbeard.indexerApi($cur_indexer).config["show_url"]${cur_result["showid"]}"><img alt="$sickbeard.indexerApi($cur_indexer).name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($cur_indexer).config["icon"]" /></a> - <span><a href="$sbRoot/home/searchEpisode?show=${cur_result["showid"]}&season=$cur_result["season"]&episode=$cur_result["episode"]" title="Manual Search" id="forceUpdate-${cur_result["showid"]}" class="epSearch forceUpdate"><img alt="[search]" height="16" width="16" src="$sbRoot/images/search16.png" id="forceUpdateImage-${cur_result["showid"]}" /></a></span> +#if $cur_result['imdb_id']: + <a href="<%= anon_url('http://www.imdb.com/title/', cur_result['imdb_id']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="http://www.imdb.com/title/${cur_result['imdb_id']}"><img alt="[imdb]" height="16" width="16" src="$sbRoot/images/imdb.png" /> +#end if + <a href="<%= anon_url(sickbeard.indexerApi(cur_indexer).config['show_url'], cur_result['showid']) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false" title="$sickbeard.indexerApi($cur_indexer).config['show_url']${cur_result['showid']}"><img alt="$sickbeard.indexerApi($cur_indexer).name" height="16" width="16" src="$sbRoot/images/$sickbeard.indexerApi($cur_indexer).config['icon']" /></a> + <span><a href="$sbRoot/home/searchEpisode?show=${cur_result['showid']}&season=$cur_result['season']&episode=$cur_result['episode']" title="Manual Search" id="forceUpdate-${cur_result['showid']}" class="epSearch forceUpdate"><img alt="[search]" height="16" width="16" src="$sbRoot/images/search16.png" id="forceUpdateImage-${cur_result['showid']}" /></a></span> </span> </div> - - <span class="title">Next Episode:</span> <span><%="S%02i" % int(cur_result["season"])+"E%02i" % int(cur_result["episode"]) %> - $cur_result["name"]</span> - + + <span class="title">Next Episode:</span> <span><%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $cur_result['name']</span> + <div class="clearfix"> - <span class="title">Airs: </span><span class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdatetime($cur_result["localtime"]).decode($sickbeard.SYS_ENCODING)</span><span> on $cur_result["network"]</span> + <span class="title">Airs: </span><span class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdatetime($cur_result['localtime']).decode($sickbeard.SYS_ENCODING)</span><span> on $cur_result['network']</span> </div> - + <div class="clearfix"> <span class="title">Quality:</span> - #if int($cur_result["quality"]) in $qualityPresets: - <span class="quality $qualityPresetStrings[int($cur_result["quality"])]">$qualityPresetStrings[int($cur_result["quality"])]</span> + #if int($cur_result['quality']) in $qualityPresets: + <span class="quality $qualityPresetStrings[int($cur_result['quality'])]">$qualityPresetStrings[int($cur_result['quality'])]</span> #else: <span class="quality Custom">Custom</span> #end if </div> </td> - </tr> - <tr> + </tr> + <tr> <td style="vertical-align: top;"> - <div> - #if $cur_result["description"] != "" and $cur_result["description"] != None: + <div> +#if $cur_result['description']: <span class="title" style="vertical-align:middle;">Plot:</span> - <img class="ep_summaryTrigger" src="$sbRoot/images/plus.png" height="16" width="16" alt="" title="Toggle Summary" /><div class="ep_summary">$cur_result["description"]</div> - #else: + <img class="ep_summaryTrigger" src="$sbRoot/images/plus.png" height="16" width="16" alt="" title="Toggle Summary" /><div class="ep_summary">$cur_result['description']</div> +#else: <span class="title ep_summaryTriggerNone" style="vertical-align:middle;">Plot:</span> <img class="ep_summaryTriggerNone" src="$sbRoot/images/plus.png" height="16" width="16" alt="" /> - #end if +#end if </div> - </td> - </tr> + </td> + </tr> </table> - </div> + </div> </div> - -<!-- end $cur_result["show_name"] //--> + +<!-- end $cur_result['show_name'] //--> #end for <!-- end non list view //--> #end if -#if $layout == 'calendar': +#if 'calendar' == $layout: #set $today = datetime.date.today() -#set $dates = [$today + datetime.timedelta(days=$i) for $i in range(7)] +#set $dates = [$today + datetime.timedelta(days = $i) for $i in range(7)] #set $tbl_day = 0 <br> <br> @@ -482,42 +487,42 @@ <input type="hidden" id="sbRoot" value="$sbRoot" /> #for $day in $dates #set $tbl_day += 1 - <table class="sickbeardTable tablesorter calendarTable <%= 'cal-%s' % ('odd' if 1 == tbl_day % 2 else 'even') %>" cellspacing="0" border="0" cellpadding="0"> - <thead><tr><th>$day.strftime("%A").decode($sickbeard.SYS_ENCODING).capitalize()</th></tr></thead> - <tbody> + <table class="sickbeardTable tablesorter calendarTable <%= 'cal-%s' % (('even', 'odd')[1 == tbl_day % 2]) %>" cellspacing="0" border="0" cellpadding="0"> + <thead><tr><th>$day.strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()</th></tr></thead> + <tbody> #set $day_has_show = False #for $cur_result in $sql_results: #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if - #set $cur_indexer = int($cur_result["indexer"]) - #set $runtime = $cur_result["runtime"] - #set $airday = $cur_result["localtime"].date() + #set $cur_indexer = int($cur_result['indexer']) + #set $runtime = $cur_result['runtime'] + #set $airday = $cur_result['localtime'].date() #if $airday == $day: #set $day_has_show = True - #set $airtime = $sbdatetime.sbdatetime.fromtimestamp($time.mktime($cur_result["localtime"].timetuple())).sbftime().decode($sickbeard.SYS_ENCODING) + #set $airtime = $sbdatetime.sbdatetime.fromtimestamp($time.mktime($cur_result['localtime'].timetuple())).sbftime().decode($sickbeard.SYS_ENCODING) #if $sickbeard.TRIM_ZERO: - #set $airtime = re.sub(r"0(\d:\d\d)", r"\1", $airtime, 0, re.IGNORECASE | re.MULTILINE) + #set $airtime = re.sub(r'0(\d:\d\d)', r'\1', $airtime, 0, re.IGNORECASE | re.MULTILINE) #end if - <tr> - <td class="calendarShow"> - <div class="poster"> - <a title="${cur_result["show_name"]}" href="$sbRoot/home/displayShow?show=${cur_result["showid"]}"><img alt="" src="$sbRoot/showPoster/?show=${cur_result["showid"]}&which=poster_thumb" /></a> - </div> - <div class="text"> - <span class="airtime"> - ${airtime} on $cur_result["network"] - </span> - <span class="episode-title" title="$cur_result["name"]"> - <%= "S%02i" % int(cur_result["season"]) + "E%02i" % int(cur_result["episode"]) %> - $cur_result["name"] - </span> - </div> - </td> <!-- end $cur_result["show_name"] --> - </tr> - #end if + <tr> + <td class="calendarShow"> + <div class="poster"> + <a title="${cur_result['show_name']}" href="$sbRoot/home/displayShow?show=${cur_result['showid']}"><img alt="" src="$sbRoot/showPoster/?show=${cur_result['showid']}&which=poster_thumb" /></a> + </div> + <div class="text"> + <span class="airtime"> + ${airtime} on $cur_result["network"] + </span> + <span class="episode-title" title="$cur_result['name']"> + <%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $cur_result['name'] + </span> + </div> + </td> <!-- end $cur_result['show_name'] --> + </tr> + #end if #end for #if not $day_has_show: @@ -535,8 +540,8 @@ <script type="text/javascript" charset="utf-8"> <!-- -window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes +window.setInterval('location.reload(true)', 600000); // Refresh every 10 minutes //--> </script> -#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_bottom.tmpl") +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl') diff --git a/gui/slick/interfaces/default/config.tmpl b/gui/slick/interfaces/default/config.tmpl index 7d5a6544256a09fabec034bb660b39270b19e7ea..fa26af59f108e8e4660b9a04074d66f0473e8e4c 100644 --- a/gui/slick/interfaces/default/config.tmpl +++ b/gui/slick/interfaces/default/config.tmpl @@ -1,6 +1,8 @@ #import sickbeard #from sickbeard import db +#from sickbeard.helpers import anon_url #import os.path + #set global $title="Configuration" #set global $header="Configuration" @@ -37,16 +39,16 @@ #end if <font color="red">You are using BETA software</font> </td></tr> - <tr><td class="infoTableHeader">SR Config file: </td><td class="infoTableCell">$sickbeard.CONFIG_FILE</td></tr> - <tr><td class="infoTableHeader">SR Database file: </td><td class="infoTableCell">$db.dbFilename()</td></tr> - <tr><td class="infoTableHeader">SR Cache Dir: </td><td class="infoTableCell">$sickbeard.CACHE_DIR</td></tr> - <tr><td class="infoTableHeader">SR Arguments: </td><td class="infoTableCell">$sickbeard.MY_ARGS</td></tr> - <tr><td class="infoTableHeader">SR Web Root: </td><td class="infoTableCell">$sickbeard.WEB_ROOT</td></tr> - <tr><td class="infoTableHeader">Python Version: </td><td class="infoTableCell">$sys.version[:120]</td></tr> - <tr class="infoTableSeperator"><td class="infoTableHeader"><i class="icon16-sb"></i> Homepage </td><td><a href="http://www.sickrage.tv/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">http://www.sickrage.tv/</a></td></tr> - <tr><td class="infoTableHeader"><i class="icon16-web"></i> Forums </td><td><a href="http://sickrage.tv/forums/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">http://sickrage.tv/forums/</a></td></tr> - <tr><td class="infoTableHeader"><i class="icon16-github"></i> Source </td><td><a href="https://github.com/SickragePVR/SickRage/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">https://github.com/SickragePVR/SickRage/</a></td></tr> - <tr><td class="infoTableHeader"><i class="icon16-mirc"></i> Internet Relay Chat </td><td><a href="irc://irc.freenode.net/#sickrage" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;"><i>#sickrage</i> on <i>irc.freenode.net</i></a></td></tr> + <tr><td class="infoTableHeader">SR Config file:</td><td class="infoTableCell">$sickbeard.CONFIG_FILE</td></tr> + <tr><td class="infoTableHeader">SR Database file:</td><td class="infoTableCell">$db.dbFilename()</td></tr> + <tr><td class="infoTableHeader">SR Cache Dir:</td><td class="infoTableCell">$sickbeard.CACHE_DIR</td></tr> + <tr><td class="infoTableHeader">SR Arguments:</td><td class="infoTableCell">$sickbeard.MY_ARGS</td></tr> + <tr><td class="infoTableHeader">SR Web Root:</td><td class="infoTableCell">$sickbeard.WEB_ROOT</td></tr> + <tr><td class="infoTableHeader">Python Version:</td><td class="infoTableCell">$sys.version[:120]</td></tr> + <tr class="infoTableSeperator"><td class="infoTableHeader"><i class="icon16-sb"></i> Homepage</td><td class="infoTableCell"><a href="<%= anon_url('http://www.sickrage.tv/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">http://www.sickrage.tv/</a></td></tr> + <tr><td class="infoTableHeader"><i class="icon16-web"></i> Forums</td><td class="infoTableCell"><a href="<%= anon_url('http://sickrage.tv/forums/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">http://sickrage.tv/forums/</a></td></tr> + <tr><td class="infoTableHeader"><i class="icon16-github"></i> Source</td><td class="infoTableCell"><a href="<%= anon_url('https://github.com/SickragePVR/SickRage/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">https://github.com/SickragePVR/SickRage/</a></td></tr> + <tr><td class="infoTableHeader"><i class="icon16-mirc"></i> Internet Relay Chat</td><td class="infoTableCell"><a href="irc://irc.freenode.net/#sickrage" rel="noreferrer"><i>#sickrage</i> on <i>irc.freenode.net</i></a></td></tr> </table> </div> diff --git a/gui/slick/interfaces/default/config_anime.tmpl b/gui/slick/interfaces/default/config_anime.tmpl index 28c2bde0393273034c59e6820f773eb1ff1234fc..17f56de5e27f3e560bf5ae5e3836f72123dc7dc6 100644 --- a/gui/slick/interfaces/default/config_anime.tmpl +++ b/gui/slick/interfaces/default/config_anime.tmpl @@ -1,4 +1,6 @@ #import sickbeard +#from sickbeard.helpers import anon_url + #set global $title="Config - Anime" #set global $header="Anime" @@ -30,7 +32,7 @@ <div id="core-component-group1" class="tab-pane active component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/providers/anidb.gif" alt="AniDB" title="AniDB" width="24" height="24" /> - <h3><a href="http://anidb.info" onclick="window.open(this.href, '_blank'); return false;">AniDB</a></h3> + <h3><a href="<%= anon_url('http://anidb.info') %>" onclick="window.open(this.href, '_blank'); return false;">AniDB</a></h3> <p>AniDB is non-profit database of anime information that is freely open to the public</p> </div> diff --git a/gui/slick/interfaces/default/config_general.tmpl b/gui/slick/interfaces/default/config_general.tmpl index 23b23f39c8a12adeb753ceec5448cd8bd0719c9c..7c3cd17e322848632d3f4c669be5168f17cc5fdb 100644 --- a/gui/slick/interfaces/default/config_general.tmpl +++ b/gui/slick/interfaces/default/config_general.tmpl @@ -7,6 +7,7 @@ #from sickbeard import config #from sickbeard import metadata #from sickbeard.metadata.generic import GenericMetadata +#from sickbeard.helpers import anon_url #set global $title = 'Config - General' #set global $header = 'General Configuration' @@ -509,7 +510,7 @@ <span class="component-desc"> <input type="checkbox" name="encryption_version" id="encryption_version" #if $sickbeard.ENCRYPTION_VERSION then 'checked="checked"' else ''#/> <p>in the <code>config.ini</code> file. - <b>Warning:</b> Passwords must only contain <a target="_blank" href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters">ASCII characters</a></p> + <b>Warning:</b> Passwords must only contain <a target="_blank" href="<%= anon_url('http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters') %>">ASCII characters</a></p> </span> </label> </div> diff --git a/gui/slick/interfaces/default/config_notifications.tmpl b/gui/slick/interfaces/default/config_notifications.tmpl index ff96f7080c4a71e276768328b00651133f8a5cad..acbf68b795626daa790029c032b4e2715e69dafe 100644 --- a/gui/slick/interfaces/default/config_notifications.tmpl +++ b/gui/slick/interfaces/default/config_notifications.tmpl @@ -1,4 +1,6 @@ #import sickbeard +#from sickbeard.helpers import anon_url + #set global $title="Config - Notifications" #set global $header="Notifications" @@ -31,7 +33,7 @@ <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/xbmc.png" alt="" title="XBMC" /> - <h3><a href="http://xbmc.org/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">XBMC</a></h3> + <h3><a href="<%= anon_url('http://kodi.tv/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">XBMC</a></h3> <p>A free and open source cross-platform media center and home entertainment system software with a 10-foot user interface designed for the living-room TV.</p> </div> <fieldset class="component-group-list"> @@ -156,7 +158,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/plex.png" alt="" title="Plex Media Server" /> - <h3><a href="http://www.plexapp.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Plex Media Server</a></h3> + <h3><a href="<%= anon_url('http://www.plexapp.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Plex Media Server</a></h3> <p>Experience your media on a visually stunning, easy to use interface on your Mac connected to your TV. Your media library has never looked this good!</p> <p class="plexinfo hide">For sending notifications to Plex Home Theater (PHT) clients, use the XBMC notifier with port <b>3005</b>.</p> </div> @@ -264,7 +266,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/nmj.png" alt="" title="Networked Media Jukebox" /> - <h3><a href="http://www.popcornhour.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">NMJ</a></h3> + <h3><a href="<%= anon_url('http://www.popcornhour.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">NMJ</a></h3> <p>The Networked Media Jukebox, or NMJ, is the official media jukebox interface made available for the Popcorn Hour 200-series.</p> </div> <fieldset class="component-group-list"> @@ -330,7 +332,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/nmj.png" alt="" title="Networked Media Jukebox v2"/> - <h3><a href="http://www.popcornhour.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">NMJv2</a></h3> + <h3><a href="<%= anon_url('http://www.popcornhour.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">NMJv2</a></h3> <p>The Networked Media Jukebox, or NMJv2, is the official media jukebox interface made available for the Popcorn Hour 300 & 400-series.</p> </div> <fieldset class="component-group-list"> @@ -418,7 +420,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/synoindex.png" alt="" title="Synology" /> - <h3><a href="http://synology.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Synology</a></h3> + <h3><a href="<%= anon_url('http://synology.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Synology</a></h3> <p>The Synology DiskStation NAS.</p> <p>Synology Indexer is the daemon running on the Synology NAS to build its media database.</p> </div> @@ -449,7 +451,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/synologynotifier.png" alt="" title="Synology Indexer" /> - <h3><a href="http://synology.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Synology Notifier</a></h3> + <h3><a href="<%= anon_url('http://synology.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Synology Notifier</a></h3> <p>Synology Notifier is the notification system of Synology DSM</p> </div> @@ -504,7 +506,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/pytivo.png" alt="" title="pyTivo" /> - <h3><a href="http://pytivo.sourceforge.net/wiki/index.php/PyTivo" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">pyTivo</a></h3> + <h3><a href="<%= anon_url('http://pytivo.sourceforge.net/wiki/index.php/PyTivo') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">pyTivo</a></h3> <p>pyTivo is both an HMO and GoBack server. This notifier will load the completed downloads to your Tivo.</p> </div> <fieldset class="component-group-list"> @@ -566,7 +568,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/growl.png" alt="" title="Growl" /> - <h3><a href="http://growl.info/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Growl</a></h3> + <h3><a href="<%= anon_url('http://growl.info/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Growl</a></h3> <p>A cross-platform unobtrusive global notification system.</p> </div> <fieldset class="component-group-list"> @@ -644,7 +646,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/prowl.png" alt="Prowl" title="Prowl" /> - <h3><a href="http://www.prowlapp.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Prowl</a></h3> + <h3><a href="<%= anon_url('http://www.prowlapp.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Prowl</a></h3> <p>A Growl client for iOS.</p> </div> <fieldset class="component-group-list"> @@ -693,7 +695,7 @@ </label> <label> <span class="component-title"> </span> - <span class="component-desc">get your key at: <a href="https://www.prowlapp.com/api_settings.php" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">https://www.prowlapp.com/api_settings.php</a></span> + <span class="component-desc">get your key at: <a href="<%= anon_url('https://www.prowlapp.com/api_settings.php') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">https://www.prowlapp.com/api_settings.php</a></span> </label> </div> <div class="field-pair"> @@ -724,7 +726,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/libnotify.png" alt="" title="Libnotify" /> - <h3><a href="http://library.gnome.org/devel/libnotify/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Libnotify</a></h3> + <h3><a href="<%= anon_url('http://library.gnome.org/devel/libnotify/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Libnotify</a></h3> <p>The standard desktop notification API for Linux/*nix systems. This notifier will only function if the pynotify module is installed (Ubuntu/Debian package <a href="apt:python-notify">python-notify</a>).</p> </div> <fieldset class="component-group-list"> @@ -778,7 +780,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/pushover.png" alt="" title="Pushover" /> - <h3><a href="https://pushover.net/apps/clone/sickrage" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Pushover</a></h3> + <h3><a href="<%= anon_url('https://pushover.net/apps/clone/sickrage') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Pushover</a></h3> <p>Pushover makes it easy to send real-time notifications to your Android and iOS devices.</p> </div> <fieldset class="component-group-list"> @@ -837,7 +839,7 @@ </label> <label> <span class="component-title"> </span> - <span class="component-desc"><a href="https://pushover.net/apps/clone/sickrage" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;"><b>Click here</b></a> to create a Pushover API key</span> + <span class="component-desc"><a href="<%= anon_url('https://pushover.net/apps/clone/sickrage') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;"><b>Click here</b></a> to create a Pushover API key</span> </label> </div> <div class="testNotification" id="testPushover-result">Click below to test.</div> @@ -851,7 +853,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/boxcar.png" alt="" title="Boxcar" /> - <h3><a href="http://boxcar.io/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Boxcar</a></h3> + <h3><a href="<%= anon_url('http://boxcar.io/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Boxcar</a></h3> <p>Universal push notification for iOS. Read your messages where and when you want them! A subscription will be sent if needed.</p> </div> <fieldset class="component-group-list"> @@ -914,7 +916,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/boxcar2.png" alt="" title="Boxcar2"/> - <h3><a href="https://new.boxcar.io/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Boxcar2</a></h3> + <h3><a href="<%= anon_url('https://new.boxcar.io/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Boxcar2</a></h3> <p>Read your messages where and when you want them!</p> </div> <fieldset class="component-group-list"> @@ -977,7 +979,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/nma.png" alt="" title="NMA"/> - <h3><a href="http://nma.usk.bz" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Notify My Android</a></h3> + <h3><a href="<%= anon_url('http://nma.usk.bz') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Notify My Android</a></h3> <p>Notify My Android is a Prowl-like Android App and API that offers an easy way to send notifications from your application directly to your Android device.</p> </div> <fieldset class="component-group-list"> @@ -1056,7 +1058,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/pushalot.png" alt="" title="Pushalot" /> - <h3><a href="https://pushalot.com" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Pushalot</a></h3> + <h3><a href="<%= anon_url('https://pushalot.com') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Pushalot</a></h3> <p>Pushalot is a platform for receiving custom push notifications to connected devices running Windows Phone or Windows 8.</p> </div> <fieldset class="component-group-list"> @@ -1119,7 +1121,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/pushbullet.png" alt="" title="Pushbullet" /> - <h3><a href="https://www.pushbullet.com" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Pushbullet</a></h3> + <h3><a href="<%= anon_url('https://www.pushbullet.com') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Pushbullet</a></h3> <p>Pushbullet is a platform for receiving custom push notifications to connected devices running Android and desktop Chrome browsers.</p> </div> <fieldset class="component-group-list"> @@ -1197,7 +1199,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/twitter.png" alt="" title="Twitter"/> - <h3><a href="http://www.twitter.com/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Twitter</a></h3> + <h3><a href="<%= anon_url('http://www.twitter.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Twitter</a></h3> <p>A social networking and microblogging service, enabling its users to send and read other users' messages called tweets.</p> </div> <fieldset class="component-group-list"> @@ -1281,7 +1283,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/trakt.png" alt="" title="Trakt"/> - <h3><a href="http://trakt.tv/" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Trakt</a></h3> + <h3><a href="<%= anon_url('http://trakt.tv/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Trakt</a></h3> <p>trakt helps keep a record of what TV shows and movies you are watching. Based on your favorites, trakt recommends additional shows and movies you'll enjoy!</p> </div> <fieldset class="component-group-list"> @@ -1323,7 +1325,7 @@ </label> <label> <span class="component-title"> </span> - <span class="component-desc">get your key at: <a href="http://trakt.tv/settings/api" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;"><b>http://trakt.tv/settings/api</b></a></span> + <span class="component-desc">get your key at: <a href="<%= anon_url('http://trakt.tv/settings/api') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;"><b>http://trakt.tv/settings/api</b></a></span> </label> </div> <div class="field-pair"> @@ -1409,7 +1411,7 @@ <div class="component-group"> <div class="component-group-desc"> <img class="notifier-icon" src="$sbRoot/images/notifiers/email.png" alt="" title="Email" /> - <h3><a href="http://en.wikipedia.org/wiki/Comparison_of_webmail_providers" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;">Email</a></h3> + <h3><a href="<%= anon_url('http://en.wikipedia.org/wiki/Comparison_of_webmail_providers') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Email</a></h3> <p>Allows configuration of email notifications on a per show basis.</p> </div> <fieldset class="component-group-list"> diff --git a/gui/slick/interfaces/default/config_providers.tmpl b/gui/slick/interfaces/default/config_providers.tmpl index 1dd95505f6c00e358f2dc9f1100658f9211ecb7f..bf1074c159e948f19dfe60364ac8a8ecfa1289b9 100644 --- a/gui/slick/interfaces/default/config_providers.tmpl +++ b/gui/slick/interfaces/default/config_providers.tmpl @@ -1,6 +1,8 @@ #import sickbeard #from sickbeard.providers.generic import GenericProvider #from sickbeard.providers import thepiratebay +#from sickbeard.helpers import anon_url + #set global $title="Config - Providers" #set global $header="Search Providers" @@ -90,7 +92,7 @@ var show_nzb_providers = #if $sickbeard.USE_NZBS then "true" else "false"#; #set $curName = $curProvider.getID() <li class="ui-state-default" id="$curName"> <input type="checkbox" id="enable_$curName" class="provider_enabler" #if $curProvider.isEnabled() then "checked=\"checked\"" else ""#/> - <a href="$curProvider.url" class="imgLink" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;"><img src="$sbRoot/images/providers/$curProvider.imageName()" alt="$curProvider.name" title="$curProvider.name" width="16" height="16" style="vertical-align:middle;"/></a> + <a href="<%= anon_url(curProvider.url) %>" class="imgLink" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;"><img src="$sbRoot/images/providers/$curProvider.imageName()" alt="$curProvider.name" title="$curProvider.name" width="16" height="16" style="vertical-align:middle;"/></a> <span style="vertical-align:middle;">$curProvider.name</span> #if not $curProvider.supportsBacklog then "*" else ""# #if $curProvider.name == "EZRSS" then "**" else ""# diff --git a/gui/slick/interfaces/default/config_subtitles.tmpl b/gui/slick/interfaces/default/config_subtitles.tmpl index 45c6a0b1e46b46ee16e52e9f45cd94263e5220c2..420d3e54abe81dc1ad74a8fc6076d49b1f098fdd 100644 --- a/gui/slick/interfaces/default/config_subtitles.tmpl +++ b/gui/slick/interfaces/default/config_subtitles.tmpl @@ -1,5 +1,6 @@ #from sickbeard import subtitles #import sickbeard +#from sickbeard.helpers import anon_url #set global $title="Config - Subtitles" #set global $header="Subtitles" @@ -125,7 +126,8 @@ #set $curName = $curService.id <li class="ui-state-default" id="$curName"> <input type="checkbox" id="enable_$curName" class="service_enabler" #if $curService.enabled then "checked=\"checked\"" else ""#/> - <a href="$curService.url" class="imgLink" target="_new"> + #set $provider_url = $curService.url + <a href="<%= anon_url(provider_url) %>" class="imgLink" target="_new"> <img src="$sbRoot/images/subtitles/$curService.image" alt="$curService.name" title="$curService.name" width="16" height="16" style="vertical-align:middle;"/> </a> <span style="vertical-align:middle;">$curService.name.capitalize()</span> diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index c15cac492dcca47c0c842763b44fc71263ff41ad..88ab150f914fdd8cdd192152d947e970ae60e693 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -2,9 +2,11 @@ #from sickbeard import subtitles, sbdatetime, network_timezones #import sickbeard.helpers #from sickbeard.common import * +#from sickbeard.helpers import anon_url #from lib import subliminal #import os.path, os #import datetime + #set global $title=$show.name ##set global $header = '<a></a>' % #set global $topmenu="manageShows"# @@ -152,28 +154,29 @@ <div id="showCol"> <div id="showinfo"> - #if 'rating' in $show.imdb_info: - #set $rating_tip = str($show.imdb_info['rating']) + " / 10" + " Stars" + "<br />" + str($show.imdb_info['votes']) + " Votes" - <span class="imdbstars" qtip-content="$rating_tip">$show.imdb_info['rating']</span> - #end if +#if 'rating' in $show.imdb_info: + #set $rating_tip = str($show.imdb_info['rating']) + " / 10" + " Stars" + "<br />" + str($show.imdb_info['votes']) + " Votes" + <span class="imdbstars" qtip-content="$rating_tip">$show.imdb_info['rating']</span> +#end if - #if not $show.imdbid - <span>($show.startyear) - $show.runtime minutes - </span> - #else - #if 'country_codes' in $show.imdb_info: - #for $country in $show.imdb_info['country_codes'].split('|') - <img src="$sbRoot/images/flags/${$country}.png" width="16" height="11" style="margin-left: 3px; vertical-align:middle;" /> - #end for - #end if - #if 'year' in $show.imdb_info: - <span>($show.imdb_info['year']) - $show.imdb_info['runtimes'] minutes - </span> - #end if - <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; vertical-align:middle;"/></a> - #end if - <a href="$sickbeard.indexerApi($show.indexer).config["show_url"]$show.indexerid" onclick="window.open(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; vertical-align:middle;"/></a> - #if $xem_numbering or $xem_absolute_numbering: - <a href="http://thexem.de/search?q=$show.name" rel="noreferrer" onclick="window.open('${sickbeard.ANON_REDIRECT}' + this.href, '_blank'); return false;" title="http://thexem.de/search?q-$show.name"><img alt="[xem]" height="16" width="16" src="$sbRoot/images/xem.png" style="margin-top: -1px; vertical-align:middle;"/></a> - #end if +#set $_show = $show +#if not $show.imdbid + <span>($show.startyear) - $show.runtime minutes - </span> +#else + #if 'country_codes' in $show.imdb_info: + #for $country in $show.imdb_info['country_codes'].split('|') + <img src="$sbRoot/images/flags/${$country}.png" width="16" height="11" style="margin-left: 3px; vertical-align:middle;" /> + #end for + #end if + #if 'year' in $show.imdb_info: + <span>($show.imdb_info['year']) - $show.imdb_info['runtimes'] minutes - </span> + #end if + <a href="<%= anon_url('http://www.imdb.com/title/', _show.imdbid) %>" rel="noreferrer" onclick="window.open(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; vertical-align:middle;"/></a> +#end if + <a href="<%= anon_url(sickbeard.indexerApi(_show.indexer).config['show_url'], _show.indexerid) %>" onclick="window.open(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; vertical-align:middle;"/></a> +#if $xem_numbering or $xem_absolute_numbering: + <a href="<%= anon_url('http://thexem.de/search?q=', _show.name) %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;" title="http://thexem.de/search?q-$show.name"><img alt="[xem]" height="16" width="16" src="$sbRoot/images/xem.png" style="margin-top: -1px; vertical-align:middle;"/></a> +#end if </div> <div id="tags"> @@ -181,13 +184,13 @@ #if not $show.imdbid #if $show.genre: #for $genre in $show.genre[1:-1].split('|') - <a href="http://trakt.tv/shows/popular/${genre.lower()}" target="_blank" title="View other popular $genre shows on trakt.tv."><li>$genre</li></a> + <a href="<%= anon_url('http://trakt.tv/shows/popular/', genre.lower()) %>" target="_blank" title="View other popular $genre shows on trakt.tv."><li>$genre</li></a> #end for #end if #end if #if 'year' in $show.imdb_info: #for $imdbgenre in $show.imdb_info['genres'].replace('Sci-Fi','Science-Fiction').split('|') - <a href="http://trakt.tv/shows/popular/${imdbgenre.lower()}" target="_blank" title="View other popular $imdbgenre shows on trakt.tv."><li>$imdbgenre</li></a> + <a href="<%= anon_url('http://trakt.tv/shows/popular/', imdbgenre.lower()) %>" target="_blank" title="View other popular $imdbgenre shows on trakt.tv."><li>$imdbgenre</li></a> #end for #end if </ul> diff --git a/gui/slick/interfaces/default/home_massAddTable.tmpl b/gui/slick/interfaces/default/home_massAddTable.tmpl index b906dbfc86ffc8913417786a2c5d82c23b582cc9..920e56959a9c065769570aa2113867b6e23b2d68 100644 --- a/gui/slick/interfaces/default/home_massAddTable.tmpl +++ b/gui/slick/interfaces/default/home_massAddTable.tmpl @@ -1,4 +1,5 @@ #import sickbeard +#from sickbeard.helpers import anon_url <table id="addRootDirTable" class="sickbeardTable tablesorter"> <thead><tr><th class="col-checkbox"><input type="checkbox" id="checkAll" checked=checked></th><th>Directory</th><th width="20%">Show Name (tvshow.nfo)<th width="20%">Indexer</td></tr></thead> @@ -30,7 +31,7 @@ <td class="col-checkbox"><input type="checkbox" id="$show_id" class="dirCheck" checked=checked></td> <td><label for="$show_id">$curDir['display_dir']</label></td> #if $curDir['existing_info'][1] and $indexer > 0: - <td><a href="$sickbeard.indexerApi($indexer).config["show_url"]$curDir['existing_info'][0]">$curDir['existing_info'][1]</a></td> + <td><a href="<%= anon_url(sickbeard.indexerApi(indexer).config['show_url'], curDir['existing_info'][0]) %>">$curDir['existing_info'][1]</a></td> #else: <td>?</td> #end if diff --git a/gui/slick/interfaces/default/home_newShow.tmpl b/gui/slick/interfaces/default/home_newShow.tmpl index 6759140a269485f9fe441f9f46e47193925d6a97..3dea99e00c43efd083913e1ac3611f4aba9b8e95 100644 --- a/gui/slick/interfaces/default/home_newShow.tmpl +++ b/gui/slick/interfaces/default/home_newShow.tmpl @@ -1,5 +1,7 @@ #import os.path #import sickbeard +#from sickbeard.helpers import anon_url + #set global $header="New Show" #set global $title="New Show" @@ -36,7 +38,7 @@ <input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" /> #if $use_provided_info: - Show retrieved from existing metadata: <a href="$sickbeard.indexerApi($provided_indexer).config["show_url"]$provided_indexer_id">$provided_indexer_name</a> + Show retrieved from existing metadata: <a href="<%= anon_url(sickbeard.indexerApi(provided_indexer).config['show_url'], provided_indexer_id) %>">$provided_indexer_name</a> <input type="hidden" name="indexerLang" value="en" /> <input type="hidden" name="whichSeries" value="$provided_indexer_id" /> <input type="hidden" id="providedName" value="$provided_indexer_name" /> diff --git a/gui/slick/interfaces/default/home_trendingShows.tmpl b/gui/slick/interfaces/default/home_trendingShows.tmpl index 13f37bee5082e1c2ce5c6e47ac26f28b137e7208..011f170f6056a44e67b725ef1ae31cf85f9a0f27 100644 --- a/gui/slick/interfaces/default/home_trendingShows.tmpl +++ b/gui/slick/interfaces/default/home_trendingShows.tmpl @@ -3,6 +3,7 @@ #import re #from sickbeard.common import * #from sickbeard import sbdatetime +#from sickbeard.helpers import anon_url #set global $title='Trending Shows' #set global $header='Trending Shows' @@ -117,7 +118,7 @@ <div class="trakt_show" data-name="$cur_show['title']" data-rating="$cur_show['ratings']['percentage']" data-votes="$cur_show['ratings']['votes']"> <div class="traktContainer"> <div class="trakt-image"> - <a class="trakt-image" href="${cur_show['url']}" target="_blank"><img alt="" class="trakt-image" src="${image}" /></a> + <a class="trakt-image" href="<%= anon_url(cur_show['url']) %>" target="_blank"><img alt="" class="trakt-image" src="${image}" /></a> </div> <div class="show-title"> diff --git a/gui/slick/interfaces/default/inc_top.tmpl b/gui/slick/interfaces/default/inc_top.tmpl index ec1c7a8f1c5e53d8567aa2fe787d8b04362cac30..1e30f4461cffd0ed518f421bb75ad570e470cf71 100644 --- a/gui/slick/interfaces/default/inc_top.tmpl +++ b/gui/slick/interfaces/default/inc_top.tmpl @@ -78,10 +78,11 @@ #end if <script type="text/javascript" charset="utf-8"> <!-- - sbRoot = "$sbRoot"; // needed for browser.js & ajaxNotifications.js + sbRoot = '$sbRoot'; // needed for browser.js & ajaxNotifications.js //HTML for scrolltopcontrol, which is auto wrapped in DIV w/ ID="topcontrol" top_image_html = '<img src="$sbRoot/images/top.gif" width="31" height="11" alt="Jump to top" />'; themeSpinner = <%= '\'\'' if 'dark' != sickbeard.THEME_NAME else '\'-dark\'' %>; + anonURL = '<%= sickbeard.ANON_REDIRECT %>' //--> </script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.scrolltopcontrol-1.1.js"></script> diff --git a/gui/slick/js/configProviders.js b/gui/slick/js/configProviders.js index b7eb56af6f22e0035fb8aced99d192c793c4db0b..279ab952700dda6cdb989c33deb7b27ac2a0535e 100644 --- a/gui/slick/js/configProviders.js +++ b/gui/slick/js/configProviders.js @@ -65,7 +65,8 @@ $(document).ready(function(){ } if ($('#provider_order_list > #'+id).length == 0 && showProvider != false) { - var toAdd = '<li class="ui-state-default" id="'+id+'"> <input type="checkbox" id="enable_'+id+'" class="provider_enabler" CHECKED> <a href="'+url+'" class="imgLink" target="_new"><img src="'+sbRoot+'/images/providers/newznab.png" alt="'+name+'" width="16" height="16"></a> '+name+'</li>' + var toAdd = '<li class="ui-state-default" id="' + id + '"> <input type="checkbox" id="enable_' + id + '" class="provider_enabler" CHECKED> <a href="' + anonURL + url + '" class="imgLink" target="_new"><img src="' + sbRoot + + '/images/providers/newznab.png" alt="' + name + '" width="16" height="16"></a> ' + name + '</li>' $('#provider_order_list').append(toAdd); $('#provider_order_list').sortable("refresh"); @@ -84,7 +85,8 @@ $(document).ready(function(){ $(this).populateTorrentRssSection(); if ($('#provider_order_list > #'+id).length == 0) { - var toAdd = '<li class="ui-state-default" id="'+id+'"> <input type="checkbox" id="enable_'+id+'" class="provider_enabler" CHECKED> <a href="'+url+'" class="imgLink" target="_new"><img src="'+sbRoot+'/images/providers/torrentrss.png" alt="'+name+'" width="16" height="16"></a> '+name+'</li>' + var toAdd = '<li class="ui-state-default" id="' + id + '"> <input type="checkbox" id="enable_' + id + '" class="provider_enabler" CHECKED> <a href="' + anonURL + url + '" class="imgLink" target="_new"><img src="' + sbRoot + + '/images/providers/torrentrss.png" alt="' + name + '" width="16" height="16"></a> ' + name + '</li>' $('#provider_order_list').append(toAdd); $('#provider_order_list').sortable("refresh"); diff --git a/gui/slick/js/configSubtitles.js b/gui/slick/js/configSubtitles.js index 57100e347b782b4cbf25d4747b9d6ec510fea17a..034f204a6d59c5bd6ff403b4b5bc88aa3e3ec29c 100644 --- a/gui/slick/js/configSubtitles.js +++ b/gui/slick/js/configSubtitles.js @@ -21,7 +21,7 @@ $(document).ready(function(){ var newData = [isDefault, [name, url, key]]; if ($('#service_order_list > #'+id).length == 0 && showService != false) { - var toAdd = '<li class="ui-state-default" id="'+id+'"> <input type="checkbox" id="enable_'+id+'" class="service_enabler" CHECKED> <a href="'+url+'" class="imgLink" target="_new"><img src="'+sbRoot+'/images/services/newznab.gif" alt="'+name+'" width="16" height="16"></a> '+name+'</li>' + var toAdd = '<li class="ui-state-default" id="' + id + '"> <input type="checkbox" id="enable_' + id + '" class="service_enabler" CHECKED> <a href="' + anonURL + url + '" class="imgLink" target="_new"><img src="' + sbRoot + '/images/services/newznab.gif" alt="' + name + '" width="16" height="16"></a> ' + name + '</li>' $('#service_order_list').append(toAdd); $('#service_order_list').sortable("refresh"); diff --git a/gui/slick/js/newShow.js b/gui/slick/js/newShow.js index 4e0df7af60c2c2e890127aa2931facae45f1ead8..6018f360f6d842d39a120240553d7961fdfcb02f 100644 --- a/gui/slick/js/newShow.js +++ b/gui/slick/js/newShow.js @@ -70,9 +70,9 @@ $(document).ready(function () { resultStr += '<input type="radio" id="whichSeries" name="whichSeries" value="' + whichSeries + '"' + checked + ' /> '; if (data.langid && data.langid != "") { - resultStr += '<a href="'+ obj[2] + obj[3] + '&lid=' + data.langid + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>'; + resultStr += '<a href="' + anonURL + obj[2] + obj[3] + '&lid=' + data.langid + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>'; } else { - resultStr += '<a href="'+ obj[2] + obj[3] + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>'; + resultStr += '<a href="' + anonURL + obj[2] + obj[3] + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>'; } if (obj[5] !== null) { diff --git a/gui/slick/js/recommendedShows.js b/gui/slick/js/recommendedShows.js index d97fa773c9d669e8e350a2b119f19f0c59726dce..f2b9bd1fe652862816d666a8a18adbbfe79e1be7 100644 --- a/gui/slick/js/recommendedShows.js +++ b/gui/slick/js/recommendedShows.js @@ -19,7 +19,7 @@ $(document).ready(function () { var whichSeries = obj.join('|'); resultStr += '<input type="radio" id="whichSeries" name="whichSeries" value="' + whichSeries + '"' + checked + ' /> '; - resultStr += '<a href="' + obj[1] + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[2] + '</b></a>'; + resultStr += '<a href="' + anonURL + obj[1] + '" onclick="window.open(this.href, \'_blank\'); return false;"><b>' + obj[2] + '</b></a>'; if (obj[4] !== null) { var startDate = new Date(obj[4]); diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 21dd0c4a95baa31faa8fe3fcbe867b5562892cfe..bc3cb997ad2c02cd68ec59b7d98e0033c94c76d4 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -954,6 +954,13 @@ def check_url(url): return None +def anon_url(*url): + """ + Return a URL string consisting of the Anonymous redirect URL and an arbitrary number of values appended. + """ + return '' if None in url else '%s%s' % (sickbeard.ANON_REDIRECT, ''.join(str(s) for s in url)) + + """ Encryption ==========