diff --git a/gui/slick/images/providers/nzbs4u.png b/gui/slick/images/providers/nzbs4u.png deleted file mode 100644 index b2d709be95e5c81164609ff22f5d9f0b39a89ece..0000000000000000000000000000000000000000 Binary files a/gui/slick/images/providers/nzbs4u.png and /dev/null differ diff --git a/gui/slick/images/providers/nzbs4u_net.png b/gui/slick/images/providers/nzbs4u_net.png deleted file mode 100644 index b2d709be95e5c81164609ff22f5d9f0b39a89ece..0000000000000000000000000000000000000000 Binary files a/gui/slick/images/providers/nzbs4u_net.png and /dev/null differ diff --git a/gui/slick/images/providers/spots4u.png b/gui/slick/images/providers/spots4u.png deleted file mode 100644 index b2d709be95e5c81164609ff22f5d9f0b39a89ece..0000000000000000000000000000000000000000 Binary files a/gui/slick/images/providers/spots4u.png and /dev/null differ diff --git a/gui/slick/images/providers/spots4u_nl.png b/gui/slick/images/providers/spots4u_nl.png deleted file mode 100644 index b2d709be95e5c81164609ff22f5d9f0b39a89ece..0000000000000000000000000000000000000000 Binary files a/gui/slick/images/providers/spots4u_nl.png and /dev/null differ diff --git a/gui/slick/js/core.js b/gui/slick/js/core.js index 12675949b7794879d37ffe98c9e2ec12e7b1bdf9..2fb725650a49a358b5f11dc53e20c34cac136e50 100644 --- a/gui/slick/js/core.js +++ b/gui/slick/js/core.js @@ -3,7 +3,7 @@ var srRoot = getMeta('srRoot'), themeSpinner = getMeta('themeSpinner'), anonURL = getMeta('anonURL'), - topImageHtml = '<img src="' + srRoot + '/images/top.gif" width="31" height="11" alt="Jump to top" />', + topImageHtml = '<img src="' + srRoot + '/images/top.gif" width="31" height="11" alt="Jump to top" />', // jshint ignore:line loading = '<img src="' + srRoot + '/images/loading16' + themeSpinner + '.gif" height="16" width="16" />'; var configSuccess = function(){ @@ -1766,6 +1766,478 @@ var SICKRAGE = { console.log('This function need to be filled with ConfigProviders.js but can\'t be as we\'ve got scope issues currently.'); } }, + home: { + init: function(){ + + }, + index: function(){ + // Resets the tables sorting, needed as we only use a single call for both tables in tablesorter + $('.resetsorting').on('click', function(){ + $('table').trigger('filterReset'); + }); + + // This needs to be refined to work a little faster. + $('.progressbar').each(function(){ + var percentage = $(this).data('progress-percentage'); + var classToAdd = percentage === 100 ? 100 : percentage > 80 ? 80 : percentage > 60 ? 60 : percentage > 40 ? 40 : 20; + $(this).progressbar({ value: percentage }); + if($(this).data('progress-text')) { + $(this).append('<div class="progressbarText" title="' + $(this).data('progress-tip') + '">' + $(this).data('progress-text') + '</div>'); + } + $(this).find('.ui-progressbar-value').addClass('progress-' + classToAdd); + }); + + $("img#network").on('error', function(){ + $(this).parent().text($(this).attr('alt')); + $(this).remove(); + }); + + $("#showListTableShows:has(tbody tr), #showListTableAnime:has(tbody tr)").tablesorter({ + sortList: [[7,1],[2,0]], + textExtraction: { + 0: function(node) { return $(node).find('time').attr('datetime'); }, + 1: function(node) { return $(node).find('time').attr('datetime'); }, + 3: function(node) { return $(node).find("span").prop("title").toLowerCase(); }, + 4: function(node) { return $(node).find("span").text().toLowerCase(); }, + 5: function(node) { return $(node).find("span:first").text(); }, + 6: function(node) { return $(node).find("img").attr("alt"); } + }, + widgets: ['saveSort', 'zebra', 'stickyHeaders', 'filter', 'columnSelector'], + headers: (function(){ + if(metaToBool('sickbeard.FILTER_ROW')){ + return { + 0: { sorter: 'realISODate' }, + 1: { sorter: 'realISODate' }, + 2: { sorter: 'loadingNames' }, + 4: { sorter: 'quality' }, + 5: { sorter: 'eps' }, + 6: { filter : 'parsed' } + }; + } else { + return { + 0: { sorter: 'realISODate' }, + 1: { sorter: 'realISODate' }, + 2: { sorter: 'loadingNames' }, + 4: { sorter: 'quality' }, + 5: { sorter: 'eps' } + }; + } + }()), + widgetOptions: (function(){ + if(metaToBool('sickbeard.FILTER_ROW')){ + return { + filter_columnFilters: true, // jshint ignore:line + filter_hideFilters : true, // jshint ignore:line + filter_saveFilters : true, // jshint ignore:line + filter_functions : { // jshint ignore:line + 5:function(e, n, f) { + var test = false; + var pct = Math.floor((n % 1) * 1000); + if (f === '') { + test = true; + } else { + var result = f.match(/(<|<=|>=|>)\s(\d+)/i); + if (result) { + if (result[1] === "<") { + if (pct < parseInt(result[2])) { + test = true; + } + } else if (result[1] === "<=") { + if (pct <= parseInt(result[2])) { + test = true; + } + } else if (result[1] === ">=") { + if (pct >= parseInt(result[2])) { + test = true; + } + } else if (result[1] === ">") { + if (pct > parseInt(result[2])) { + test = true; + } + } + } + + result = f.match(/(\d+)\s(-|to)\s(\d+)/i); + if (result) { + if ((result[2] === "-") || (result[2] === "to")) { + if ((pct >= parseInt(result[1])) && (pct <= parseInt(result[3]))) { + test = true; + } + } + } + + result = f.match(/(=)?\s?(\d+)\s?(=)?/i); + if (result) { + if ((result[1] === "=") || (result[3] === "=")) { + if (parseInt(result[2]) === pct) { + test = true; + } + } + } + + if (!isNaN(parseFloat(f)) && isFinite(f)) { + if (parseInt(f) === pct) { + test = true; + } + } + } + return test; + } + }, + 'columnSelector_mediaquery': false + }; + } else { + return { + 'filter_columnFilters': false + }; + } + }()), + sortStable: true, + sortAppend: [[2,0]] + }); + + if ($("#showListTableShows").find("tbody").find("tr").size() > 0){ + $.tablesorter.filter.bindSearch( "#showListTableShows", $('.search') ); + } + + if(metaToBool('sickbeard.ANIME_SPLIT_HOME')){ + if($("#showListTableAnime").find("tbody").find("tr").size() > 0){ + $.tablesorter.filter.bindSearch( "#showListTableAnime", $('.search') ); + } + } + + $.each([$('#container'), $('#container-anime')], function (){ + this.isotope({ + itemSelector: '.show', + sortBy : getMeta('sickbeard.POSTER_SORTBY'), + sortAscending: getMeta('sickbeard.POSTER_SORTDIR'), + layoutMode: 'masonry', + masonry: { + columnWidth: 13, + isFitWidth: true + }, + getSortData: { + name: function(itemElem){ + var name = $(itemElem).attr('data-name'); + return (metaToBool('sickbeard.SORT_ARTICLE') ? (name || '') : (name || '').replace(/^(The|A|An)\s/i,'')); + }, + network: '[data-network]', + date: function(itemElem){ + var date = $(itemElem).attr('data-date'); + return date.length && parseInt(date, 10) || Number.POSITIVE_INFINITY; + }, + progress: function(itemElem){ + var progress = $(itemElem).attr('data-progress'); + return progress.length && parseInt(progress, 10) || Number.NEGATIVE_INFINITY; + } + } + }); + }); + + $('#postersort').on('change', function(){ + $('#container, #container-anime').isotope({sortBy: $(this).val()}); + $.get($(this).find('option[value=' + $(this).val() +']').attr('data-sort')); + }); + + $('#postersortdirection').on('change', function(){ + $('#container, #container-anime').isotope({sortAscending: ($(this).val() === 'true')}); + $.get($(this).find('option[value=' + $(this).val() +']').attr('data-sort')); + }); + + $('#popover').popover({ + placement: 'bottom', + html: true, // required if content has HTML + content: '<div id="popover-target"></div>' + }).on('shown.bs.popover', function () { // bootstrap popover event triggered when the popover opens + // call this function to copy the column selection code into the popover + $.tablesorter.columnSelector.attachTo( $('#showListTableShows'), '#popover-target'); + if(metaToBool('sickbeard.ANIME_SPLIT_HOME')){ + $.tablesorter.columnSelector.attachTo( $('#showListTableAnime'), '#popover-target'); + } + + }); + }, + displayShow: function() { + $('#srRoot').ajaxEpSearch({'colorRow': true}); + + $('#srRoot').ajaxEpSubtitlesSearch(); + + $('#seasonJump').on('change', function(){ + var id = $('#seasonJump option:selected').val(); + if (id && id !== 'jump') { + var season = $('#seasonJump option:selected').data('season'); + $('html,body').animate({scrollTop: $('[name ="' + id.substring(1) + '"]').offset().top - 50}, 'slow'); + $('#collapseSeason-' + season).collapse('show'); + location.hash = id; + } + $(this).val('jump'); + }); + + $("#prevShow").on('click', function(){ + $('#pickShow option:selected').prev('option').prop('selected', 'selected'); + $("#pickShow").change(); + }); + + $("#nextShow").on('click', function(){ + $('#pickShow option:selected').next('option').prop('selected', 'selected'); + $("#pickShow").change(); + }); + + $('#changeStatus').on('click', function(){ + var srRoot = $('#srRoot').val(); + var epArr = []; + + $('.epCheck').each(function () { + if (this.checked === true) { + epArr.push($(this).attr('id')); + } + }); + + if (epArr.length === 0) { return false; } + + window.location.href = srRoot + '/home/setStatus?show=' + $('#showID').attr('value') + '&eps=' + epArr.join('|') + '&status=' + $('#statusSelect').val(); + }); + + $('.seasonCheck').on('click', function(){ + var seasCheck = this; + var seasNo = $(seasCheck).attr('id'); + + $('#collapseSeason-' + seasNo).collapse('show'); + $('.epCheck:visible').each(function () { + var epParts = $(this).attr('id').split('x'); + if (epParts[0] === seasNo) { + this.checked = seasCheck.checked; + } + }); + }); + + var lastCheck = null; + $('.epCheck').on('click', function (event) { + + if (!lastCheck || !event.shiftKey) { + lastCheck = this; + return; + } + + var check = this; + var found = 0; + + $('.epCheck').each(function() { + switch (found) { + case 2: + return false; + case 1: + this.checked = lastCheck.checked; + } + + if (this === check || this === lastCheck) { + found++; + } + }); + }); + + // selects all visible episode checkboxes. + $('.seriesCheck').on('click', function () { + $('.epCheck:visible').each(function () { + this.checked = true; + }); + $('.seasonCheck:visible').each(function () { + this.checked = true; + }); + }); + + // clears all visible episode checkboxes and the season selectors + $('.clearAll').on('click', function () { + $('.epCheck:visible').each(function () { + this.checked = false; + }); + $('.seasonCheck:visible').each(function () { + this.checked = false; + }); + }); + + // handle the show selection dropbox + $('#pickShow').on('change', function () { + var srRoot = $('#srRoot').val(); + var val = $(this).val(); + if (val === 0) { + return; + } + window.location.href = srRoot + '/home/displayShow?show=' + val; + }); + + // show/hide different types of rows when the checkboxes are changed + $("#checkboxControls input").change(function () { + var whichClass = $(this).attr('id'); + $(this).showHideRows(whichClass); + }); + + // initially show/hide all the rows according to the checkboxes + $("#checkboxControls input").each(function() { + var status = $(this).prop('checked'); + $("tr." + $(this).attr('id')).each(function() { + if(status) { + $(this).show(); + } else { + $(this).hide(); + } + }); + }); + + $.fn.showHideRows = function(whichClass) { + var status = $('#checkboxControls > input, #' + whichClass).prop('checked'); + $("tr." + whichClass).each(function() { + if (status) { + $(this).show(); + } else { + $(this).hide(); + } + }); + + // hide season headers with no episodes under them + $('tr.seasonheader').each(function () { + var numRows = 0; + var seasonNo = $(this).attr('id'); + $('tr.' + seasonNo + ' :visible').each(function () { + numRows++; + }); + if (numRows === 0) { + $(this).hide(); + $('#' + seasonNo + '-cols').hide(); + } else { + $(this).show(); + $('#' + seasonNo + '-cols').show(); + } + }); + }; + + function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) { + var srRoot = $('#srRoot').val(); + var showId = $('#showID').val(); + var indexer = $('#indexer').val(); + + if (sceneSeason === '') { sceneSeason = null; } + if (sceneEpisode === '') { sceneEpisode = null; } + + $.getJSON(srRoot + '/home/setSceneNumbering',{ + 'show': showId, + 'indexer': indexer, + 'forSeason': forSeason, + 'forEpisode': forEpisode, + 'sceneSeason': sceneSeason, + 'sceneEpisode': sceneEpisode + }, function(data) { + // Set the values we get back + if (data.sceneSeason === null || data.sceneEpisode === null) { + $('#sceneSeasonXEpisode_' + showId + '_' + forSeason + '_' + forEpisode).val(''); + } else { + $('#sceneSeasonXEpisode_' + showId + '_' + forSeason + '_' + forEpisode).val(data.sceneSeason + 'x' + data.sceneEpisode); + } + if (!data.success) { + if (data.errorMessage) { + alert(data.errorMessage); + } else { + alert('Update failed.'); + } + } + }); + } + + function setAbsoluteSceneNumbering(forAbsolute, sceneAbsolute) { + var srRoot = $('#srRoot').val(); + var showId = $('#showID').val(); + var indexer = $('#indexer').val(); + + if (sceneAbsolute === '') { sceneAbsolute = null; } + + $.getJSON(srRoot + '/home/setSceneNumbering', { + 'show': showId, + 'indexer': indexer, + 'forAbsolute': forAbsolute, + 'sceneAbsolute': sceneAbsolute + }, + function(data) { + // Set the values we get back + if (data.sceneAbsolute === null) { + $('#sceneAbsolute_' + showId + '_' + forAbsolute).val(''); + } else { + $('#sceneAbsolute_' + showId + '_' + forAbsolute).val(data.sceneAbsolute); + } + if (!data.success) { + if (data.errorMessage) { + alert(data.errorMessage); + } else { + alert('Update failed.'); + } + } + }); + } + + $('.sceneSeasonXEpisode').on('change', function() { + // Strip non-numeric characters + $(this).val($(this).val().replace(/[^0-9xX]*/g, '')); + var forSeason = $(this).attr('data-for-season'); + var forEpisode = $(this).attr('data-for-episode'); + var m = $(this).val().match(/^(\d+)x(\d+)$/i); + var sceneSeason = null, sceneEpisode = null; + if (m) { + sceneSeason = m[1]; + sceneEpisode = m[2]; + } + setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode); + }); + + $('.sceneAbsolute').on('change', function() { + // Strip non-numeric characters + $(this).val($(this).val().replace(/[^0-9xX]*/g, '')); + var forAbsolute = $(this).attr('data-for-absolute'); + + var m = $(this).val().match(/^(\d{1,3})$/i); + var sceneAbsolute = null; + if (m) { + sceneAbsolute = m[1]; + } + setAbsoluteSceneNumbering(forAbsolute, sceneAbsolute); + }); + + $('.addQTip').each(function () { + $(this).css({'cursor':'help', 'text-shadow':'0px 0px 0.5px #666'}); + $(this).qtip({ + show: {solo:true}, + position: {viewport:$(window), my:'left center', adjust:{ y: -10, x: 2 }}, + style: {tip:{corner:true, method:'polygon'}, classes:'qtip-rounded qtip-shadow ui-tooltip-sb'} + }); + }); + $.fn.generateStars = function() { + return this.each(function(i,e){$(e).html($('<span/>').width($(e).text()*12));}); + }; + + $('.imdbstars').generateStars(); + + $("#showTable, #animeTable").tablesorter({ + widgets: ['saveSort', 'stickyHeaders', 'columnSelector'], + widgetOptions : { + columnSelector_saveColumns: true, // jshint ignore:line + columnSelector_layout : '<br><label><input type="checkbox">{name}</label>', // jshint ignore:line + columnSelector_mediaquery: false, // jshint ignore:line + columnSelector_cssChecked : 'checked' // jshint ignore:line + } + }); + + $('#popover').popover({ + placement: 'bottom', + html: true, // required if content has HTML + content: '<div id="popover-target"></div>' + }) + // bootstrap popover event triggered when the popover opens + .on('shown.bs.popover', function (){ + $.tablesorter.columnSelector.attachTo($("#showTable, #animeTable"), '#popover-target'); + }); + }, + postProcess: function() { + $('#episodeDir').fileBrowser({ title: 'Select Unprocessed Episode Folder', key: 'postprocessPath' }); + } + }, manage: { init: function() { $.makeEpisodeRow = function(indexerId, season, episode, name, checked) { @@ -1853,6 +2325,53 @@ var SICKRAGE = { $('#limit').on('change', function(){ window.location.href = srRoot + '/manage/failedDownloads/?limit=' + $(this).val(); }); + + $('#submitMassRemove').on('click', function(){ + var removeArr = []; + + $('.removeCheck').each(function() { + if (this.checked === true) { + removeArr.push($(this).attr('id').split('-')[1]); + } + }); + + if (removeArr.length === 0) { return false; } + + window.location.href = srRoot + '/manage/failedDownloads?toRemove='+removeArr.join('|'); + }); + + $('.bulkCheck').on('click', function(){ + var bulkCheck = this; + var whichBulkCheck = $(bulkCheck).attr('id'); + + $('.'+whichBulkCheck+':visible').each(function(){ + this.checked = bulkCheck.checked; + }); + }); + + if($('.removeCheck').length){ + $('.removeCheck').each(function(name) { + var lastCheck = null; + $(name).click(function(event) { + if(!lastCheck || !event.shiftKey) { + lastCheck = this; + return; + } + + var check = this; + var found = 0; + + $(name+':visible').each(function() { + switch (found) { + case 2: return false; + case 1: this.checked = lastCheck.checked; + } + + if (this === check || this === lastCheck) { found++; } + }); + }); + }); + } }, massEdit: function() { $('#location').fileBrowser({ title: 'Select Show Location' }); @@ -1971,6 +2490,51 @@ var SICKRAGE = { }); }); } + }, + history: { + init: function() { + + }, + index: function() { + $("#historyTable:has(tbody tr)").tablesorter({ + widgets: ['zebra', 'filter'], + sortList: [[0,1]], + textExtraction: (function(){ + if(isMeta('sickbeard.HISTORY_LAYOUT', ['detailed'])){ + return { + 0: function(node) { return $(node).find('time').attr('datetime'); }, + 4: function(node) { return $(node).find("span").text().toLowerCase(); } + }; + } else { + return { + 0: function(node) { return $(node).find('time').attr('datetime'); }, + 1: function(node) { return $(node).find("span").text().toLowerCase(); }, + 2: function(node) { return $(node).attr("provider").toLowerCase(); }, + 5: function(node) { return $(node).attr("quality").toLowerCase(); } + }; + } + }()), + headers: (function(){ + if(isMeta('sickbeard.HISTORY_LAYOUT', ['detailed'])){ + return { + 0: { sorter: 'realISODate' }, + 4: { sorter: 'quality' } + }; + } else { + return { + 0: { sorter: 'realISODate' }, + 4: { sorter: false }, + 5: { sorter: 'quality' } + }; + } + }()) + }); + + $('#history_limit').on('change', function() { + var url = srRoot + '/history/?limit=' + $(this).val(); + window.location.href = url; + }); + } } }; diff --git a/gui/slick/js/core.min.js b/gui/slick/js/core.min.js index b0af1a1280876c5a80447f4db0f5d5b8cac1cb88..760b08a88b139929b632e36e4cbb084ab59dc2be 100644 Binary files a/gui/slick/js/core.min.js and b/gui/slick/js/core.min.js differ diff --git a/gui/slick/js/failedDownloads.js b/gui/slick/js/failedDownloads.js deleted file mode 100644 index 15be420a1861542d648243d4724378cc4d07819e..0000000000000000000000000000000000000000 --- a/gui/slick/js/failedDownloads.js +++ /dev/null @@ -1,49 +0,0 @@ -$(document).ready(function(){ - $('#submitMassRemove').on('click', function(){ - var removeArr = []; - - $('.removeCheck').each(function() { - if (this.checked === true) { - removeArr.push($(this).attr('id').split('-')[1]); - } - }); - - if (removeArr.length === 0) { return false; } - - window.location.href = srRoot + '/manage/failedDownloads?toRemove='+removeArr.join('|'); - }); - - $('.bulkCheck').on('click', function(){ - var bulkCheck = this; - var whichBulkCheck = $(bulkCheck).attr('id'); - - $('.'+whichBulkCheck+':visible').each(function(){ - this.checked = bulkCheck.checked; - }); - }); - - if($('.removeCheck').length){ - $('.removeCheck').each(function(name) { - var lastCheck = null; - $(name).click(function(event) { - if(!lastCheck || !event.shiftKey) { - lastCheck = this; - return; - } - - var check = this; - var found = 0; - - $(name+':visible').each(function() { - switch (found) { - case 2: return false; - case 1: this.checked = lastCheck.checked; - } - - if (this === check || this === lastCheck) { found++; } - }); - }); - }); - } - -}); diff --git a/gui/slick/js/lib/jquery.form.min.js b/gui/slick/js/lib/jquery.form.min.js new file mode 100644 index 0000000000000000000000000000000000000000..7321a3b06c5f8c516e0f3a433a1229b952d6ca5e Binary files /dev/null and b/gui/slick/js/lib/jquery.form.min.js differ diff --git a/gui/slick/js/new/displayShow.js b/gui/slick/js/new/displayShow.js deleted file mode 100644 index dc83839e81d842a9384c5050a03c2750f57d8cbe..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/displayShow.js +++ /dev/null @@ -1,278 +0,0 @@ -$(document).ready(function(){ - - $('#srRoot').ajaxEpSearch({'colorRow': true}); - - $('#srRoot').ajaxEpSubtitlesSearch(); - - $('#seasonJump').on('change', function(){ - var id = $('#seasonJump option:selected').val(); - if (id && id !== 'jump') { - var season = $('#seasonJump option:selected').data('season'); - $('html,body').animate({scrollTop: $('[name ="' + id.substring(1) + '"]').offset().top - 50}, 'slow'); - $('#collapseSeason-' + season).collapse('show'); - location.hash = id; - } - $(this).val('jump'); - }); - - $("#prevShow").on('click', function(){ - $('#pickShow option:selected').prev('option').prop('selected', 'selected'); - $("#pickShow").change(); - }); - - $("#nextShow").on('click', function(){ - $('#pickShow option:selected').next('option').prop('selected', 'selected'); - $("#pickShow").change(); - }); - - $('#changeStatus').on('click', function(){ - var srRoot = $('#srRoot').val(); - var epArr = []; - - $('.epCheck').each(function () { - if (this.checked === true) { - epArr.push($(this).attr('id')); - } - }); - - if (epArr.length === 0) { return false; } - - window.location.href = srRoot + '/home/setStatus?show=' + $('#showID').attr('value') + '&eps=' + epArr.join('|') + '&status=' + $('#statusSelect').val(); - }); - - $('.seasonCheck').on('click', function(){ - var seasCheck = this; - var seasNo = $(seasCheck).attr('id'); - - $('#collapseSeason-' + seasNo).collapse('show'); - $('.epCheck:visible').each(function () { - var epParts = $(this).attr('id').split('x'); - if (epParts[0] === seasNo) { - this.checked = seasCheck.checked; - } - }); - }); - - var lastCheck = null; - $('.epCheck').on('click', function (event) { - - if (!lastCheck || !event.shiftKey) { - lastCheck = this; - return; - } - - var check = this; - var found = 0; - - $('.epCheck').each(function() { - switch (found) { - case 2: - return false; - case 1: - this.checked = lastCheck.checked; - } - - if (this === check || this === lastCheck) { - found++; - } - }); - }); - - // selects all visible episode checkboxes. - $('.seriesCheck').on('click', function () { - $('.epCheck:visible').each(function () { - this.checked = true; - }); - $('.seasonCheck:visible').each(function () { - this.checked = true; - }); - }); - - // clears all visible episode checkboxes and the season selectors - $('.clearAll').on('click', function () { - $('.epCheck:visible').each(function () { - this.checked = false; - }); - $('.seasonCheck:visible').each(function () { - this.checked = false; - }); - }); - - // handle the show selection dropbox - $('#pickShow').on('change', function () { - var srRoot = $('#srRoot').val(); - var val = $(this).val(); - if (val === 0) { - return; - } - window.location.href = srRoot + '/home/displayShow?show=' + val; - }); - - // show/hide different types of rows when the checkboxes are changed - $("#checkboxControls input").change(function () { - var whichClass = $(this).attr('id'); - $(this).showHideRows(whichClass); - }); - - // initially show/hide all the rows according to the checkboxes - $("#checkboxControls input").each(function() { - var status = $(this).prop('checked'); - $("tr." + $(this).attr('id')).each(function() { - if(status) { - $(this).show(); - } else { - $(this).hide(); - } - }); - }); - - $.fn.showHideRows = function(whichClass) { - var status = $('#checkboxControls > input, #' + whichClass).prop('checked'); - $("tr." + whichClass).each(function() { - if (status) { - $(this).show(); - } else { - $(this).hide(); - } - }); - - // hide season headers with no episodes under them - $('tr.seasonheader').each(function () { - var numRows = 0; - var seasonNo = $(this).attr('id'); - $('tr.' + seasonNo + ' :visible').each(function () { - numRows++; - }); - if (numRows === 0) { - $(this).hide(); - $('#' + seasonNo + '-cols').hide(); - } else { - $(this).show(); - $('#' + seasonNo + '-cols').show(); - } - }); - }; - - function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) { - var srRoot = $('#srRoot').val(); - var showId = $('#showID').val(); - var indexer = $('#indexer').val(); - - if (sceneSeason === '') { sceneSeason = null; } - if (sceneEpisode === '') { sceneEpisode = null; } - - $.getJSON(srRoot + '/home/setSceneNumbering',{ - 'show': showId, - 'indexer': indexer, - 'forSeason': forSeason, - 'forEpisode': forEpisode, - 'sceneSeason': sceneSeason, - 'sceneEpisode': sceneEpisode - }, function(data) { - // Set the values we get back - if (data.sceneSeason === null || data.sceneEpisode === null) { - $('#sceneSeasonXEpisode_' + showId + '_' + forSeason + '_' + forEpisode).val(''); - } else { - $('#sceneSeasonXEpisode_' + showId + '_' + forSeason + '_' + forEpisode).val(data.sceneSeason + 'x' + data.sceneEpisode); - } - if (!data.success) { - if (data.errorMessage) { - alert(data.errorMessage); - } else { - alert('Update failed.'); - } - } - }); - } - - function setAbsoluteSceneNumbering(forAbsolute, sceneAbsolute) { - var srRoot = $('#srRoot').val(); - var showId = $('#showID').val(); - var indexer = $('#indexer').val(); - - if (sceneAbsolute === '') { sceneAbsolute = null; } - - $.getJSON(srRoot + '/home/setSceneNumbering', { - 'show': showId, - 'indexer': indexer, - 'forAbsolute': forAbsolute, - 'sceneAbsolute': sceneAbsolute - }, - function(data) { - // Set the values we get back - if (data.sceneAbsolute === null) { - $('#sceneAbsolute_' + showId + '_' + forAbsolute).val(''); - } else { - $('#sceneAbsolute_' + showId + '_' + forAbsolute).val(data.sceneAbsolute); - } - if (!data.success) { - if (data.errorMessage) { - alert(data.errorMessage); - } else { - alert('Update failed.'); - } - } - }); - } - - $('.sceneSeasonXEpisode').on('change', function() { - // Strip non-numeric characters - $(this).val($(this).val().replace(/[^0-9xX]*/g, '')); - var forSeason = $(this).attr('data-for-season'); - var forEpisode = $(this).attr('data-for-episode'); - var m = $(this).val().match(/^(\d+)x(\d+)$/i); - var sceneSeason = null, sceneEpisode = null; - if (m) { - sceneSeason = m[1]; - sceneEpisode = m[2]; - } - setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode); - }); - - $('.sceneAbsolute').on('change', function() { - // Strip non-numeric characters - $(this).val($(this).val().replace(/[^0-9xX]*/g, '')); - var forAbsolute = $(this).attr('data-for-absolute'); - - var m = $(this).val().match(/^(\d{1,3})$/i); - var sceneAbsolute = null; - if (m) { - sceneAbsolute = m[1]; - } - setAbsoluteSceneNumbering(forAbsolute, sceneAbsolute); - }); - - $('.addQTip').each(function () { - $(this).css({'cursor':'help', 'text-shadow':'0px 0px 0.5px #666'}); - $(this).qtip({ - show: {solo:true}, - position: {viewport:$(window), my:'left center', adjust:{ y: -10, x: 2 }}, - style: {tip:{corner:true, method:'polygon'}, classes:'qtip-rounded qtip-shadow ui-tooltip-sb'} - }); - }); - $.fn.generateStars = function() { - return this.each(function(i,e){$(e).html($('<span/>').width($(e).text()*12));}); - }; - - $('.imdbstars').generateStars(); - - $("#showTable, #animeTable").tablesorter({ - widgets: ['saveSort', 'stickyHeaders', 'columnSelector'], - widgetOptions : { - columnSelector_saveColumns: true, // jshint ignore:line - columnSelector_layout : '<br><label><input type="checkbox">{name}</label>', // jshint ignore:line - columnSelector_mediaquery: false, // jshint ignore:line - columnSelector_cssChecked : 'checked' // jshint ignore:line - } - }); - - $('#popover').popover({ - placement: 'bottom', - html: true, // required if content has HTML - content: '<div id="popover-target"></div>' - }) - // bootstrap popover event triggered when the popover opens - .on('shown.bs.popover', function (){ - $.tablesorter.columnSelector.attachTo($("#showTable, #animeTable"), '#popover-target'); - }); -}); diff --git a/gui/slick/js/new/history.js b/gui/slick/js/new/history.js deleted file mode 100644 index d4a666bcfa6d8018166fe4efcefdcb28bc50c28a..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/history.js +++ /dev/null @@ -1,40 +0,0 @@ -$(document).ready(function(){ - $("#historyTable:has(tbody tr)").tablesorter({ - widgets: ['zebra', 'filter'], - sortList: [[0,1]], - textExtraction: (function(){ - if(isMeta('sickbeard.HISTORY_LAYOUT', ['detailed'])){ - return { - 0: function(node) { return $(node).find('time').attr('datetime'); }, - 4: function(node) { return $(node).find("span").text().toLowerCase(); } - }; - } else { - return { - 0: function(node) { return $(node).find('time').attr('datetime'); }, - 1: function(node) { return $(node).find("span").text().toLowerCase(); }, - 2: function(node) { return $(node).attr("provider").toLowerCase(); }, - 5: function(node) { return $(node).attr("quality").toLowerCase(); } - }; - } - }()), - headers: (function(){ - if(isMeta('sickbeard.HISTORY_LAYOUT', ['detailed'])){ - return { - 0: { sorter: 'realISODate' }, - 4: { sorter: 'quality' } - }; - } else { - return { - 0: { sorter: 'realISODate' }, - 4: { sorter: false }, - 5: { sorter: 'quality' } - }; - } - }()) - }); - - $('#history_limit').on('change', function() { - var url = srRoot + '/history/?limit=' + $(this).val(); - window.location.href = url; - }); -}); diff --git a/gui/slick/js/new/home.js b/gui/slick/js/new/home.js deleted file mode 100644 index 1df0a5edb2e506fc43b6603010f9049499b6a367..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/home.js +++ /dev/null @@ -1,195 +0,0 @@ -$(document).ready(function(){ - // Resets the tables sorting, needed as we only use a single call for both tables in tablesorter - $('.resetsorting').on('click', function(){ - $('table').trigger('filterReset'); - }); - - // This needs to be refined to work a little faster. - $('.progressbar').each(function(progressbar){ - var showId = $(this).data('show-id'); - var percentage = $(this).data('progress-percentage'); - var classToAdd = percentage === 100 ? 100 : percentage > 80 ? 80 : percentage > 60 ? 60 : percentage > 40 ? 40 : 20; - $(this).progressbar({ value: percentage }); - if($(this).data('progress-text')) { - $(this).append('<div class="progressbarText" title="' + $(this).data('progress-tip') + '">' + $(this).data('progress-text') + '</div>'); - } - $(this).find('.ui-progressbar-value').addClass('progress-' + classToAdd); - }); - - $("img#network").on('error', function(){ - $(this).parent().text($(this).attr('alt')); - $(this).remove(); - }); - - $("#showListTableShows:has(tbody tr), #showListTableAnime:has(tbody tr)").tablesorter({ - sortList: [[7,1],[2,0]], - textExtraction: { - 0: function(node) { return $(node).find('time').attr('datetime'); }, - 1: function(node) { return $(node).find('time').attr('datetime'); }, - 3: function(node) { return $(node).find("span").prop("title").toLowerCase(); }, - 4: function(node) { return $(node).find("span").text().toLowerCase(); }, - 5: function(node) { return $(node).find("span:first").text(); }, - 6: function(node) { return $(node).find("img").attr("alt"); } - }, - widgets: ['saveSort', 'zebra', 'stickyHeaders', 'filter', 'columnSelector'], - headers: (function(){ - if(metaToBool('sickbeard.FILTER_ROW')){ - return { - 0: { sorter: 'realISODate' }, - 1: { sorter: 'realISODate' }, - 2: { sorter: 'loadingNames' }, - 4: { sorter: 'quality' }, - 5: { sorter: 'eps' }, - 6: { filter : 'parsed' } - }; - } else { - return { - 0: { sorter: 'realISODate' }, - 1: { sorter: 'realISODate' }, - 2: { sorter: 'loadingNames' }, - 4: { sorter: 'quality' }, - 5: { sorter: 'eps' } - }; - } - }()), - widgetOptions: (function(){ - if(metaToBool('sickbeard.FILTER_ROW')){ - return { - filter_columnFilters: true, // jshint ignore:line - filter_hideFilters : true, // jshint ignore:line - filter_saveFilters : true, // jshint ignore:line - filter_functions : { // jshint ignore:line - 5:function(e, n, f, i, r, c) { - var test = false; - var pct = Math.floor((n % 1) * 1000); - if (f === '') { - test = true; - } else { - var result = f.match(/(<|<=|>=|>)\s(\d+)/i); - if (result) { - if (result[1] === "<") { - if (pct < parseInt(result[2])) { - test = true; - } - } else if (result[1] === "<=") { - if (pct <= parseInt(result[2])) { - test = true; - } - } else if (result[1] === ">=") { - if (pct >= parseInt(result[2])) { - test = true; - } - } else if (result[1] === ">") { - if (pct > parseInt(result[2])) { - test = true; - } - } - } - - result = f.match(/(\d+)\s(-|to)\s(\d+)/i); - if (result) { - if ((result[2] === "-") || (result[2] === "to")) { - if ((pct >= parseInt(result[1])) && (pct <= parseInt(result[3]))) { - test = true; - } - } - } - - result = f.match(/(=)?\s?(\d+)\s?(=)?/i); - if (result) { - if ((result[1] === "=") || (result[3] === "=")) { - if (parseInt(result[2]) === pct) { - test = true; - } - } - } - - if (!isNaN(parseFloat(f)) && isFinite(f)) { - if (parseInt(f) === pct) { - test = true; - } - } - } - return test; - } - }, - columnSelector_mediaquery: false - }; - } else { - return { - filter_columnFilters: false - }; - } - }()), - sortStable: true, - sortAppend: [[2,0]] - }); - - if ($("#showListTableShows").find("tbody").find("tr").size() > 0){ - $.tablesorter.filter.bindSearch( "#showListTableShows", $('.search') ); - } - - if(metaToBool('sickbeard.ANIME_SPLIT_HOME')){ - if($("#showListTableAnime").find("tbody").find("tr").size() > 0){ - $.tablesorter.filter.bindSearch( "#showListTableAnime", $('.search') ); - } - } - - var $container = [$('#container'), $('#container-anime')]; - - $.each($container, function (j){ - this.isotope({ - itemSelector: '.show', - sortBy : getMeta('sickbeard.POSTER_SORTBY'), - sortAscending: getMeta('sickbeard.POSTER_SORTDIR'), - layoutMode: 'masonry', - masonry: { - columnWidth: 13, - isFitWidth: true - }, - getSortData: { - name: function(itemElem){ - var name = $(itemElem).attr('data-name'); - return (metaToBool('sickbeard.SORT_ARTICLE') ? (name || '') : (name || '').replace(/^(The|A|An)\s/i,'')); - }, - network: '[data-network]', - date: function(itemElem){ - var date = $(itemElem).attr('data-date'); - return date.length && parseInt(date, 10) || Number.POSITIVE_INFINITY; - }, - progress: function(itemElem){ - var progress = $(itemElem).attr('data-progress'); - return progress.length && parseInt(progress, 10) || Number.NEGATIVE_INFINITY; - } - } - }); - }); - - $('#postersort').on('change', function(){ - var sortValue = this.value; - $('#container').isotope({sortBy: sortValue}); - $('#container-anime').isotope({sortBy: sortValue}); - $.get(this.options[this.selectedIndex].getAttribute('data-sort')); - }); - - $('#postersortdirection').on('change', function(){ - var sortDirection = this.value; - sortDirection = sortDirection == 'true'; - $('#container').isotope({sortAscending: sortDirection}); - $('#container-anime').isotope({sortAscending: sortDirection}); - $.get(this.options[this.selectedIndex].getAttribute('data-sort')); - }); - - $('#popover').popover({ - placement: 'bottom', - html: true, // required if content has HTML - content: '<div id="popover-target"></div>' - }).on('shown.bs.popover', function () { // bootstrap popover event triggered when the popover opens - // call this function to copy the column selection code into the popover - $.tablesorter.columnSelector.attachTo( $('#showListTableShows'), '#popover-target'); - if(metaToBool('sickbeard.ANIME_SPLIT_HOME')){ - $.tablesorter.columnSelector.attachTo( $('#showListTableAnime'), '#popover-target'); - } - - }); -}); diff --git a/gui/slick/js/new/home_postprocess.js b/gui/slick/js/new/home_postprocess.js deleted file mode 100644 index 1449181d942143c4692485c5e009fc37d57a2b28..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/home_postprocess.js +++ /dev/null @@ -1 +0,0 @@ -$('#episodeDir').fileBrowser({ title: 'Select Unprocessed Episode Folder', key: 'postprocessPath' }); diff --git a/gui/slick/js/new/manage.js b/gui/slick/js/new/manage.js deleted file mode 100644 index b8ac98a50fce09876c400f10b515d03bd9cbfc20..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/manage.js +++ /dev/null @@ -1,2 +0,0 @@ -$(document).ready(function(){ - }); diff --git a/gui/slick/js/new/manage_backlogOverview.js b/gui/slick/js/new/manage_backlogOverview.js deleted file mode 100644 index 38637c688885a101f0267ee66b3cfe8b4442465d..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/manage_backlogOverview.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function(){ - -}); diff --git a/gui/slick/js/new/manage_failedDownloads.js b/gui/slick/js/new/manage_failedDownloads.js deleted file mode 100644 index 38637c688885a101f0267ee66b3cfe8b4442465d..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/manage_failedDownloads.js +++ /dev/null @@ -1,3 +0,0 @@ -$(document).ready(function(){ - -}); diff --git a/gui/slick/js/new/manage_massEdit.js b/gui/slick/js/new/manage_massEdit.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/gui/slick/views/displayShow.mako b/gui/slick/views/displayShow.mako index 44f17cb44c6297167110ced14810cb98fc0fe35d..b8da99c0f5e6a59ac9ade423dcac79608dac2e51 100644 --- a/gui/slick/views/displayShow.mako +++ b/gui/slick/views/displayShow.mako @@ -13,7 +13,6 @@ %> <%block name="scripts"> <script type="text/javascript" src="${srRoot}/js/lib/jquery.bookmarkscroll.js?${sbPID}"></script> -<script type="text/javascript" src="${srRoot}/js/new/displayShow.js"></script> <script type="text/javascript" src="${srRoot}/js/plotTooltip.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/sceneExceptionsTooltip.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/ratingTooltip.js?${sbPID}"></script> diff --git a/gui/slick/views/home.mako b/gui/slick/views/home.mako index b386eaa955d0b5fab52ce625270da3c30ec2a2c4..9b02a63f37a2bb581488952e6639657a60231760 100644 --- a/gui/slick/views/home.mako +++ b/gui/slick/views/home.mako @@ -9,9 +9,6 @@ <%block name="metas"> <meta data-var="max_download_count" data-content="${max_download_count}"> </%block> -<%block name="scripts"> -<script type="text/javascript" src="${srRoot}/js/new/home.js?${sbPID}"></script> -</%block> <%block name="content"> <%namespace file="/inc_defs.mako" import="renderQualityPill"/> % if not header is UNDEFINED: diff --git a/gui/slick/views/home_postprocess.mako b/gui/slick/views/home_postprocess.mako index 67011997769ef229e0af7e37a36d1c411102dadb..795c3d3cddafa387d8b9a14801068b37554ec5cb 100644 --- a/gui/slick/views/home_postprocess.mako +++ b/gui/slick/views/home_postprocess.mako @@ -16,13 +16,13 @@ <div id="postProcess"> <form name="processForm" method="post" action="processEpisode" style="line-height: 40px;"> <table> - <input type="hidden" id="type" name="proc_type" value="manual"> + <input type="hidden" id="type" name="type" value="manual"> <tr> <td style="padding-right:10px;"> <b>Enter the folder containing the episode:</b> </td> <td> - <input type="text" name="proc_dir" id="episodeDir" class="form-control form-control-inline input-sm input350" /> + <input type="text" name="dir" id="episodeDir" class="form-control form-control-inline input-sm input350" /> </td> </tr> <tr> diff --git a/gui/slick/views/layouts/main.mako b/gui/slick/views/layouts/main.mako index 1a2d40f0796db9dd76de826fd04fcbabdf859095..ea3cd4ab10e06a9dde3084fbbb941b820dd61bdd 100644 --- a/gui/slick/views/layouts/main.mako +++ b/gui/slick/views/layouts/main.mako @@ -312,6 +312,7 @@ </footer> <script type="text/javascript" src="${srRoot}/js/vender.min.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/lib/jquery.cookiejar.js?${sbPID}"></script> + <script type="text/javascript" src="${srRoot}/js/lib/jquery.form.min.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/lib/jquery.json-2.2.min.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/lib/jquery.selectboxes.min.js?${sbPID}"></script> <script type="text/javascript" src="${srRoot}/js/lib/formwizard.js?${sbPID}"></script><!-- Can't be added to bower --> diff --git a/gui/slick/views/manage_failedDownloads.mako b/gui/slick/views/manage_failedDownloads.mako index 4c56c324b870d8f7b7ab06b56a10ed04d371aeb0..bac45ec04062b86ec34972a6f6ae6754fe47775e 100644 --- a/gui/slick/views/manage_failedDownloads.mako +++ b/gui/slick/views/manage_failedDownloads.mako @@ -9,10 +9,6 @@ from sickbeard.common import SKIPPED, WANTED, UNAIRED, ARCHIVED, IGNORED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, FAILED from sickbeard.common import Quality, qualityPresets, qualityPresetStrings, statusStrings, Overview %> -<%block name="scripts"> -<script type="text/javascript" src="${srRoot}/js/new/manage_failedDownloads.js"></script> -<script type="text/javascript" src="${srRoot}/js/failedDownloads.js?${sbPID}"></script> -</%block> <%block name="content"> % if not header is UNDEFINED: <h1 class="header">${header}</h1> diff --git a/sickbeard/providers/btdigg.py b/sickbeard/providers/btdigg.py index 70ee530ed0ef56819f98e85d805f3d43fcdf3140..798b3614ffb512cb8abae73ea379e13a75cf6192 100644 --- a/sickbeard/providers/btdigg.py +++ b/sickbeard/providers/btdigg.py @@ -97,12 +97,13 @@ class BTDiggCache(tvcache.TVCache): tvcache.TVCache.__init__(self, provider_obj) - # set this 0 to suppress log line, since we aren't updating it anyways - self.minTime = 0 + # Cache results for a hour ,since BTDigg takes some time to crawl + self.minTime = 60 def _getRSSData(self): - # no rss for btdigg, can't search with empty string - # newest results are always > 1 day since added anyways - return {'entries': {}} + + # Use x264 for RSS search since most results will use that codec and since the site doesnt have latest results search + search_params = {'RSS': ['x264']} + return {'entries': self.provider._doSearch(search_params)} provider = BTDIGGProvider() diff --git a/sickbeard/providers/libertalia.py b/sickbeard/providers/libertalia.py index 4a4b9b6b4c097cd83d0bcb1951bfd37cc55d1f6e..dc2a9a5141570b2c3774eead9bd91bdf2a026c47 100644 --- a/sickbeard/providers/libertalia.py +++ b/sickbeard/providers/libertalia.py @@ -99,7 +99,7 @@ class LibertaliaProvider(generic.TorrentProvider): with BS4Parser(data, features=["html5lib", "permissive"]) as html: resultsTable = html.find("table", {"class" : "torrent_table"}) if resultsTable: - rows = resultsTable.findAll("tr", {"class" : re.compile("torrent_row(.*)?")}) + rows = resultsTable.findAll("tr", {"class" : re.compile("torrent_row.*")}) for row in rows: # bypass first row because title only diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 9388ec6ad8adc09cba591844e0517f8a17c3896a..6999fb4ef6527ecc6927084fe00b245d45650141 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -2020,7 +2020,7 @@ class TVEpisode(object): elif self.show.air_by_date: return self._format_pattern('%SN - %AD - %EN') - return self._format_pattern('%SN - %Sx%0E - %EN') + return self._format_pattern('%SN - S%0SE%0E - %EN') def _ep_name(self): """ diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index b53917465e50a892f89540eadf258ad1c232334d..1d566da15b826afc308bc63724b71a2e06322df8 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1834,8 +1834,10 @@ class Home(WebRoot): t = PageTemplate(rh=self, filename="testRename.mako") submenu = [{'title': 'Edit', 'path': 'home/editShow?show=%d' % showObj.indexerid, 'icon': 'ui-icon ui-icon-pencil'}] - return t.render(submenu=submenu, ep_obj_list=ep_obj_rename_list, show=showObj, title='Preview Rename', header='Preview Rename', - controller="home", action="previewRename") + return t.render(submenu=submenu, ep_obj_list=ep_obj_rename_list, + show=showObj, title='Preview Rename', + header='Preview Rename', + controller="home", action="previewRename") def doRename(self, show=None, eps=None): if show is None or eps is None: @@ -2177,10 +2179,12 @@ class HomePostProcess(Home): def index(self): t = PageTemplate(rh=self, filename="home_postprocess.mako") - return t.render(title='Post Processing', header='Post Processing', topmenu='home', controller="postprocess", action="index") + return t.render(title='Post Processing', header='Post Processing', topmenu='home', controller="home", action="postProcess") - def processEpisode(self, proc_dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None, - is_priority=None, delete_on="0", failed="0", proc_type="auto", *args, **kwargs): + # TODO: PR to NZBtoMedia so that we can rename dir to proc_dir, and type to proc_type. Using names of builtins as var names is bad + # pylint: disable=W0622 + def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None, + is_priority=None, delete_on="0", failed="0", type="auto", *args, **kwargs): def argToBool(argument): if isinstance(argument, basestring): @@ -2195,14 +2199,14 @@ class HomePostProcess(Home): return argument - if not proc_dir: + if not dir: return self.redirect("/home/postprocess/") else: nzbName = ss(nzbName) if nzbName else nzbName result = processTV.processDir( - ss(proc_dir), nzbName, process_method=process_method, force=argToBool(force), - is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=proc_type + ss(dir), nzbName, process_method=process_method, force=argToBool(force), + is_priority=argToBool(is_priority), delete_on=argToBool(delete_on), failed=argToBool(failed), proc_type=type ) if quiet is not None and int(quiet) == 1: @@ -2332,7 +2336,7 @@ class HomeAddShows(Home): # default to TVDB if indexer was not detected if show_name and not (indexer or indexer_id): - (sn, idxr, i) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id) + (_, idxr, i) = helpers.searchIndexerForShowID(show_name, indexer, indexer_id) # set indexer and indexer_id from found info if not indexer and idxr: @@ -2400,7 +2404,7 @@ class HomeAddShows(Home): posts them to addNewShow """ t = PageTemplate(rh=self, filename="home_recommendedShows.mako") - return t.render(title="Recommended Shows", header="Recommended Shows", enable_anime_options=False, controller="home", action="addShows|recommendedShows") + return t.render(title="Recommended Shows", header="Recommended Shows", enable_anime_options=False) def getRecommendedShows(self): t = PageTemplate(rh=self, filename="trendingShows.mako") @@ -2910,8 +2914,9 @@ class Manage(Home, WebRoot): t = PageTemplate(rh=self, filename="manage_subtitleMissed.mako") if not whichSubs: - return t.render(whichSubs=whichSubs, title='Episode Overview', header='Episode Overview', topmenu='manage', - controller="manage", action="subtitleMissed") + return t.render(whichSubs=whichSubs, title='Episode Overview', + header='Episode Overview', topmenu='manage', + controller="manage", action="subtitleMissed") myDB = db.DBConnection() status_results = myDB.select( @@ -3431,7 +3436,8 @@ class Manage(Home, WebRoot): t = PageTemplate(rh=self, filename="manage_failedDownloads.mako") - return t.render(limit=limit, failedResults=sqlResults, title='Failed Downloads', header='Failed Downloads', topmenu='manage') + return t.render(limit=limit, failedResults=sqlResults, title='Failed Downloads', header='Failed Downloads', topmenu='manage', + controller="manage", action="failedDownloads") @route('/manage/manageSearches(/?.*)') @@ -3446,7 +3452,8 @@ class ManageSearches(Manage): return t.render(backlogPaused=sickbeard.searchQueueScheduler.action.is_backlog_paused(), backlogRunning=sickbeard.searchQueueScheduler.action.is_backlog_in_progress(), dailySearchStatus=sickbeard.dailySearchScheduler.action.amActive, findPropersStatus=sickbeard.properFinderScheduler.action.amActive, queueLength=sickbeard.searchQueueScheduler.action.queue_length(), - title='Manage Searches', header='Manage Searches', topmenu='manage') + title='Manage Searches', header='Manage Searches', topmenu='manage', + controller="manage", action="manageSearches") def forceBacklog(self): # force it to run the next time it looks @@ -3548,7 +3555,8 @@ class History(WebRoot): {'title': 'Trim History', 'path': 'history/trimHistory', 'icon': 'ui-icon ui-icon-trash', 'class': 'trimhistory', 'confirm': True}, ] - return t.render(historyResults=data, compactResults=compact, limit=limit, submenu=submenu, title='History', header='History', topmenu="history") + return t.render(historyResults=data, compactResults=compact, limit=limit, submenu=submenu, title='History', header='History', topmenu="history", + controller="history", action="index") def clearHistory(self): self.history.clear() @@ -3599,8 +3607,9 @@ class ConfigGeneral(Config): def index(self): t = PageTemplate(rh=self, filename="config_general.mako") - return t.render(title='Config - General', header='General Configuration', topmenu='config', submenu=self.ConfigMenu(), - controller="config", action="index") + return t.render(title='Config - General', header='General Configuration', + topmenu='config', submenu=self.ConfigMenu(), + controller="config", action="index") @staticmethod def generateApiKey(): @@ -3764,8 +3773,9 @@ class ConfigBackupRestore(Config): def index(self): t = PageTemplate(rh=self, filename="config_backuprestore.mako") - return t.render(submenu=self.ConfigMenu(), title='Config - Backup/Restore', header='Backup/Restore', topmenu='config', - controller="config", action="backupRestore") + return t.render(submenu=self.ConfigMenu(), title='Config - Backup/Restore', + header='Backup/Restore', topmenu='config', + controller="config", action="backupRestore") @staticmethod def backup(backupDir=None): @@ -3826,8 +3836,9 @@ class ConfigSearch(Config): def index(self): t = PageTemplate(rh=self, filename="config_search.mako") - return t.render(submenu=self.ConfigMenu(), title='Config - Episode Search', header='Search Settings', topmenu='config', - controller="config", action="search") + return t.render(submenu=self.ConfigMenu(), title='Config - Episode Search', + header='Search Settings', topmenu='config', + controller="config", action="search") 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_category_anime=None, sab_category_backlog=None, sab_category_anime_backlog=None, sab_host=None, nzbget_username=None, @@ -4125,8 +4136,9 @@ class ConfigProviders(Config): def index(self): t = PageTemplate(rh=self, filename="config_providers.mako") - return t.render(submenu=self.ConfigMenu(), title='Config - Providers', header='Search Providers', topmenu='config', - controller="config", action="providers") + return t.render(submenu=self.ConfigMenu(), title='Config - Providers', + header='Search Providers', topmenu='config', + controller="config", action="providers") @staticmethod def canAddNewznabProvider(name): @@ -4682,7 +4694,7 @@ class ConfigNotifications(Config): sickbeard.PLEX_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(plex_notify_onsubtitledownload) sickbeard.PLEX_UPDATE_LIBRARY = config.checkbox_to_value(plex_update_library) sickbeard.PLEX_HOST = config.clean_hosts(plex_host) - sickbeard.PLEX_SERVER_HOST = config.clean_host(plex_server_host) + sickbeard.PLEX_SERVER_HOST = config.clean_hosts(plex_server_host) sickbeard.PLEX_SERVER_TOKEN = config.clean_host(plex_server_token) sickbeard.PLEX_USERNAME = plex_username sickbeard.PLEX_PASSWORD = plex_password @@ -4843,8 +4855,9 @@ class ConfigSubtitles(Config): def index(self): t = PageTemplate(rh=self, filename="config_subtitles.mako") - return t.render(submenu=self.ConfigMenu(), title='Config - Subtitles', header='Subtitles', topmenu='config', - controller="config", action="subtitles") + return t.render(submenu=self.ConfigMenu(), title='Config - Subtitles', + header='Subtitles', topmenu='config', + controller="config", action="subtitles") def saveSubtitles(self, use_subtitles=None, subtitles_plugins=None, subtitles_languages=None, subtitles_dir=None, service_order=None, subtitles_history=None, subtitles_finder_frequency=None, @@ -4905,8 +4918,9 @@ class ConfigAnime(Config): t = PageTemplate(rh=self, filename="config_anime.mako") - return t.render(submenu=self.ConfigMenu(), title='Config - Anime', header='Anime', topmenu='config', - controller="config", action="anime") + return t.render(submenu=self.ConfigMenu(), title='Config - Anime', + header='Anime', topmenu='config', + controller="config", action="anime") def saveAnime(self, use_anidb=None, anidb_username=None, anidb_password=None, anidb_use_mylist=None, split_home=None): @@ -4953,8 +4967,9 @@ class ErrorLogs(WebRoot): level = logger.ERROR t = PageTemplate(rh=self, filename="errorlogs.mako") - return t.render(header="Logs & Errors", title="Logs & Errors", topmenu="system", submenu=self.ErrorLogsMenu(level), logLevel=level, - controller="errorlogs", action="index") + return t.render(header="Logs & Errors", title="Logs & Errors", + topmenu="system", submenu=self.ErrorLogsMenu(level), + logLevel=level, controller="errorlogs", action="index") @staticmethod def haveErrors():