diff --git a/gui/slick/css/browser.css b/gui/slick/css/browser.css index 2a3ae33d679e50735283b2ea5c0e1fd74968e7f5..b3f5fb509eef604b91b8ee28f5c804040fc5aea4 100644 --- a/gui/slick/css/browser.css +++ b/gui/slick/css/browser.css @@ -3,6 +3,10 @@ overflow-y: auto; } +#fileBrowserDialog h2 { + font-size: 20px; +} + #fileBrowserDialog ul { margin: 0; padding: 0; @@ -20,7 +24,7 @@ } #fileBrowserDialog ul li a:hover { - color: #09A2FF; + color: #00f; background: none; } @@ -29,8 +33,6 @@ float: left; } - -/* jQuery-UI autocomplete overrides to make it look more like the old autocomplete */ .ui-autocomplete { max-height: 180px; overflow-y: auto; @@ -39,21 +41,3 @@ /* add padding to account for vertical scrollbar */ padding-right: 20px; } - -* html .ui-autocomplete { - height: 180px; -} - -.ui-menu .ui-menu-item { - background-color: #eeeeee; -} - -.ui-menu .ui-menu-item-alternate{ - background-color: #ffffff; -} - -.ui-menu a.ui-state-hover{ - background: none; - background-color: #0A246A; - color: #ffffff; -} diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css index b4d7e261be368dce1e1ae17700cfb154f6e52155..119a4f9e7371b2df5098d29f3be9c7b34a144516 100644 --- a/gui/slick/css/style.css +++ b/gui/slick/css/style.css @@ -189,6 +189,15 @@ inc_top.mako background: #eceadf url("../css/lib/images/ui-bg_fine-grain_10_eceadf_60x60.png") 50% 50% repeat !important; } +/* restore 1.8.x resize handle on dialog button pane */ +.ui-dialog .ui-resizable-se { + width: 14px; + height: 14px; + right: 3px; + bottom: 3px; + background-position: -80px -224px; +} + .ui-accordion-content, .ui-tabs-panel { background: #ededed !important; @@ -2640,50 +2649,6 @@ input sizing (for config pages) margin-top: -4px; } -/* ======================================================================= -browser.css overrides -========================================================================== */ - -#fileBrowserDialog { - overflow-y: auto; -} - -#fileBrowserDialog ul li a:hover { - color: #00f; - background: none; -} - -#fileBrowserDialog h2 { - font-size: 20px; -} - -.ui-autocomplete { - max-height: 180px; - overflow-x: hidden; - overflow-y: auto; -} - -/* IE6 hack since it doesn't support max-height */ -* html .ui-autocomplete { - height: 180px; - padding-right: 20px; -} - -.ui-autocomplete .ui-menu-item .ui-state-focus { - color: #fff; - background: none; - background-color: #0a246a; -} - -/* restore 1.8.x resize handle on dialog button pane */ -.ui-dialog .ui-resizable-se { - width: 14px; - height: 14px; - right: 3px; - bottom: 3px; - background-position: -80px -224px; -} - /* ======================================================================= formWizard.css ========================================================================== */ diff --git a/gui/slick/js/browser.js b/gui/slick/js/browser.js index 028d5035eafb25de514af390f193bcdc23375d48..6a8b7f4e09910391c733070989dd23767bae6097 100644 --- a/gui/slick/js/browser.js +++ b/gui/slick/js/browser.js @@ -60,7 +60,7 @@ fileBrowserDialog = $('<div id="fileBrowserDialog" style="display:hidden"></div>').appendTo('body').dialog({ dialogClass: 'browserDialog', title: options.title, - position: ['center', 40], + position: { my: 'center top', at: 'center top+60', of: window }, minWidth: Math.min($(document).width() - 80, 650), height: Math.min($(document).height() - 80, $(window).height() - 80), maxHeight: Math.min($(document).height() - 80, $(window).height() - 80), @@ -129,7 +129,6 @@ }, open: function (event, ui) { $(".ui-autocomplete li.ui-menu-item a").removeClass("ui-corner-all"); - $(".ui-autocomplete li.ui-menu-item:odd a").addClass("ui-menu-item-alternate"); } }) .data("ui-autocomplete")._renderItem = function (ul, item) { diff --git a/gui/slick/js/core.js b/gui/slick/js/core.js index 2fb725650a49a358b5f11dc53e20c34cac136e50..8b4aa6f88e8f2f275b729149742716d7bf1f5de7 100644 --- a/gui/slick/js/core.js +++ b/gui/slick/js/core.js @@ -380,7 +380,7 @@ var SICKRAGE = { var growl = {}; growl.host = $.trim($('#growl_host').val()); growl.password = $.trim($('#growl_password').val()); - if (!growl.ost) { + if (!growl.host) { $('#testGrowl-result').html('Please fill out the necessary fields above.'); $('#growl_host').addClass('warning'); return; @@ -398,7 +398,7 @@ var SICKRAGE = { var prowl = {}; prowl.api = $.trim($('#prowl_api').val()); prowl.priority = $('#prowl_priority').val(); - if (!prowl.ai) { + if (!prowl.api) { $('#testProwl-result').html('Please fill out the necessary fields above.'); $('#prowl_api').addClass('warning'); return; @@ -1531,7 +1531,7 @@ var SICKRAGE = { } }; - $.fn.torrentMethodHandler = function() { + $.torrentMethodHandler = function() { $('#options_torrent_clients').hide(); $('#options_torrent_blackhole').hide(); @@ -2236,6 +2236,23 @@ var SICKRAGE = { }, postProcess: function() { $('#episodeDir').fileBrowser({ title: 'Select Unprocessed Episode Folder', key: 'postprocessPath' }); + }, + status: function() { + $("#schedulerStatusTable").tablesorter({ + widgets: ['saveSort', 'zebra'], + textExtraction: { + 5: function(node) { return $(node).data('seconds'); }, + 6: function(node) { return $(node).data('seconds'); } + }, + headers: { + 5: { sorter: 'digit' }, + 6: { sorter: 'digit' } + } + }); + $("#queueStatusTable").tablesorter({ + widgets: ['saveSort', 'zebra'], + sortList: [[3,0], [4,0], [2,1]] + }); } }, manage: { @@ -2535,6 +2552,102 @@ var SICKRAGE = { window.location.href = url; }); } + }, + errorlogs: { + init: function() { + + }, + index: function() { + + }, + viewlogs: function() { + $('#minLevel,#logFilter,#logSearch').on('keyup change', _.debounce(function () { + if ($('#logSearch').val().length > 0){ + $('#logFilter option[value="<NONE>"]').prop('selected', true); + $('#minLevel option[value=5]').prop('selected', true); + } + $('#minLevel').prop('disabled', true); + $('#logFilter').prop('disabled', true); + document.body.style.cursor='wait'; + var url = srRoot + '/errorlogs/viewlog/?minLevel='+$('select[name=minLevel]').val()+'&logFilter='+$('select[name=logFilter]').val()+'&logSearch='+$('#logSearch').val(); + $.get(url, function(data){ + history.pushState('data', '', url); + $('pre').html($(data).find('pre').html()); + $('#minLevel').prop('disabled', false); + $('#logFilter').prop('disabled', false); + document.body.style.cursor='default'; + }); + }, 500)); + } + }, + schedule: { + init: function() { + + }, + index: function() { + if(isMeta('sickbeard.COMING_EPS_LAYOUT', ['list'])){ + var sortCodes = {'date': 0, 'show': 2, 'network': 5}; + var sort = getMeta('sickbeard.COMING_EPS_SORT'); + var sortList = (sort in sortCodes) ? [[sortCodes[sort], 0]] : [[0, 0]]; + + $('#showListTable:has(tbody tr)').tablesorter({ + widgets: ['stickyHeaders', 'filter', 'columnSelector', 'saveSort'], + sortList: sortList, + textExtraction: { + 0: function(node) { return $(node).find('time').attr('datetime'); }, + 1: function(node) { return $(node).find('time').attr('datetime'); }, + 7: function(node) { return $(node).find('span').text().toLowerCase(); } + }, + headers: { + 0: { sorter: 'realISODate' }, + 1: { sorter: 'realISODate' }, + 2: { sorter: 'loadingNames' }, + 4: { sorter: 'loadingNames' }, + 7: { sorter: 'quality' }, + 8: { sorter: false }, + 9: { sorter: false } + }, + widgetOptions: (function() { + if (metaToBool('sickbeard.FILTER_ROW')) { + return { + 'filter_columnFilters': true, + 'filter_hideFilters': true, + 'filter_saveFilters': true, + 'columnSelector_mediaquery': false + }; + } else { + return { + 'filter_columnFilters': false, + 'columnSelector_mediaquery': false + }; + } + }()) + }); + + $('#srRoot').ajaxEpSearch(); + } + + if(isMeta('sickbeard.COMING_EPS_LAYOUT', ['banner', 'poster'])){ + $('#srRoot').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'); + }); + }); + }); + } + + $('#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( $('#showListTable'), '#popover-target'); + }); + } } }; diff --git a/gui/slick/js/core.min.js b/gui/slick/js/core.min.js index 760b08a88b139929b632e36e4cbb084ab59dc2be..d2a846defd11f043b320502e71c8617dea6c4705 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/new/errorlogs.js b/gui/slick/js/new/errorlogs.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/gui/slick/js/new/schedule.js b/gui/slick/js/new/schedule.js deleted file mode 100644 index a3b0883ecb474f22158c979f66fdc00babab0b5f..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/schedule.js +++ /dev/null @@ -1,64 +0,0 @@ -$(document).ready(function(){ - if(isMeta('sickbeard.COMING_EPS_LAYOUT', ['list'])){ - var sortCodes = {'date': 0, 'show': 2, 'network': 5}; - var sort = getMeta('sickbeard.COMING_EPS_SORT'); - var sortList = (sort in sortCodes) ? [[sortCodes[sort], 0]] : [[0, 0]]; - - $('#showListTable:has(tbody tr)').tablesorter({ - widgets: ['stickyHeaders', 'filter', 'columnSelector', 'saveSort'], - sortList: sortList, - textExtraction: { - 0: function(node) { return $(node).find('time').attr('datetime'); }, - 1: function(node) { return $(node).find('time').attr('datetime'); }, - 7: function(node) { return $(node).find('span').text().toLowerCase(); } - }, - headers: { - 0: { sorter: 'realISODate' }, - 1: { sorter: 'realISODate' }, - 2: { sorter: 'loadingNames' }, - 4: { sorter: 'loadingNames' }, - 7: { sorter: 'quality' }, - 8: { sorter: false }, - 9: { sorter: false } - }, - widgetOptions: (function() { - if (metaToBool('sickbeard.FILTER_ROW')) { - return { - filter_columnFilters: true, - filter_hideFilters: true, - filter_saveFilters: true, - columnSelector_mediaquery: false - }; - } else { - return { - filter_columnFilters: false, - columnSelector_mediaquery: false - }; - } - }()) - }); - - $('#srRoot').ajaxEpSearch(); - } - - if(isMeta('sickbeard.COMING_EPS_LAYOUT', ['banner', 'poster'])){ - $('#srRoot').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'); - }); - }); - }); - } - - $('#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( $('#showListTable'), '#popover-target'); - }); -}); diff --git a/gui/slick/js/new/status.js b/gui/slick/js/new/status.js deleted file mode 100644 index 3c3c461cd66050c43490bd4083a0db5ee59e5a8a..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/status.js +++ /dev/null @@ -1,9 +0,0 @@ -$(document).ready(function() { - $("#schedulerStatusTable").tablesorter({ - widgets: ['saveSort', 'zebra'] - }); - $("#queueStatusTable").tablesorter({ - widgets: ['saveSort', 'zebra'], - sortList: [[3,0], [4,0], [2,1]] - }); -}); diff --git a/gui/slick/js/new/viewlogs.js b/gui/slick/js/new/viewlogs.js deleted file mode 100644 index d8437eebf8e11c4cf0a49cb90e64ed9f60777b3d..0000000000000000000000000000000000000000 --- a/gui/slick/js/new/viewlogs.js +++ /dev/null @@ -1,19 +0,0 @@ -$(document).ready(function(){ - $('#minLevel,#logFilter,#logSearch').on('keyup change', _.debounce(function (e) { - if ($('#logSearch').val().length > 0){ - $('#logFilter option[value="<NONE>"]').prop('selected', true); - $('#minLevel option[value=5]').prop('selected', true); - } - $('#minLevel').prop('disabled', true); - $('#logFilter').prop('disabled', true); - document.body.style.cursor='wait'; - var url = srRoot + '/errorlogs/viewlog/?minLevel='+$('select[name=minLevel]').val()+'&logFilter='+$('select[name=logFilter]').val()+'&logSearch='+$('#logSearch').val(); - $.get(url, function(data){ - history.pushState('data', '', url); - $('pre').html($(data).find('pre').html()); - $('#minLevel').prop('disabled', false); - $('#logFilter').prop('disabled', false); - document.body.style.cursor='default'; - }); - }, 500)); -}); diff --git a/gui/slick/views/layouts/main.mako b/gui/slick/views/layouts/main.mako index ea3cd4ab10e06a9dde3084fbbb941b820dd61bdd..0445d953b550b2be83025bfb811c57b0c268d4f7 100644 --- a/gui/slick/views/layouts/main.mako +++ b/gui/slick/views/layouts/main.mako @@ -306,7 +306,7 @@ % endif Load time: <span class="footerhighlight">${"%.4f" % (time() - sbStartTime)}s</span> / Mako: <span class="footerhighlight">${"%.4f" % (time() - makoStartTime)}s</span> | Branch: <span class="footerhighlight">${sickbeard.BRANCH}</span> | - Now: <span class="footerhighlight">${datetime.datetime.now(network_timezones.sb_timezone)}</span> + Now: <span class="footerhighlight">${datetime.datetime.now(network_timezones.sb_timezone).strftime(sickbeard.DATE_PRESET+" "+sickbeard.TIME_PRESET)}</span> </div> </div> </footer> diff --git a/gui/slick/views/status.mako b/gui/slick/views/status.mako index 9162b62ae9314a18a10554983c4dca2e7169a996..35ae7ec4181fe18f6e8e470df95e6d1d78cf2288 100644 --- a/gui/slick/views/status.mako +++ b/gui/slick/views/status.mako @@ -95,10 +95,10 @@ <td align="right"></td> % endif <% cycleTime = (service.cycleTime.microseconds + (service.cycleTime.seconds + service.cycleTime.days * 24 * 3600) * 10**6) / 10**6 %> - <td align="right">${helpers.pretty_time_delta(cycleTime)}</td> + <td align="right" data-seconds="${cycleTime}">${helpers.pretty_time_delta(cycleTime)}</td> % if service.enable: <% timeLeft = (service.timeLeft().microseconds + (service.timeLeft().seconds + service.timeLeft().days * 24 * 3600) * 10**6) / 10**6 %> - <td align="right">${helpers.pretty_time_delta(timeLeft)}</td> + <td align="right" data-seconds="${timeLeft}">${helpers.pretty_time_delta(timeLeft)}</td> % else: <td></td> % endif diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index e22bb3639a24a304f283162ba98caad064569849..ee3f0693df2f5176e85c8f06ed10a3a27fa8dd5a 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -37,7 +37,7 @@ class NameParser(object): NORMAL_REGEX = 1 ANIME_REGEX = 2 - def __init__(self, file_name=True, showObj=None, tryIndexers=False, naming_pattern=False): + def __init__(self, file_name=True, showObj=None, tryIndexers=False, naming_pattern=False, parse_method = None): self.file_name = file_name self.showObj = showObj @@ -45,9 +45,9 @@ class NameParser(object): self.naming_pattern = naming_pattern - if self.showObj and not self.showObj.is_anime: + if (self.showObj and not self.showObj.is_anime) or parse_method == 'normal': self._compile_regexes(self.NORMAL_REGEX) - elif self.showObj and self.showObj.is_anime: + elif (self.showObj and self.showObj.is_anime) or parse_method == 'anime': self._compile_regexes(self.ANIME_REGEX) else: self._compile_regexes(self.ALL_REGEX) diff --git a/sickbeard/providers/btdigg.py b/sickbeard/providers/btdigg.py index 798b3614ffb512cb8abae73ea379e13a75cf6192..c463f97755b5c1baea76b15cd597c9524ca0a773 100644 --- a/sickbeard/providers/btdigg.py +++ b/sickbeard/providers/btdigg.py @@ -1,25 +1,26 @@ +# coding=utf-8 # Author: Jodi Jones <venom@gen-x.co.nz> # URL: http://code.google.com/p/sickbeard/ -# -# Ported to sickrage by: matigonkas +# Rewrite: Gonçalo <matigonkas@outlook.com> +# URL: https://github.com/SickRage/SickRage # # This file is part of SickRage. # -# Sick Beard is free software: you can redistribute it and/or modify +# SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# Sick Beard is distributed in the hope that it will be useful, +# SickRage is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. +# along with SickRage. If not, see <http://www.gnu.org/licenses/>. from sickbeard.providers import generic - +from urllib import urlencode from sickbeard import logger from sickbeard import tvcache @@ -32,16 +33,21 @@ class BTDIGGProvider(generic.TorrentProvider): self.public = True self.ratio = 0 self.urls = {'url': u'https://btdigg.org/', - 'api': u'https://api.btdigg.org/'} + 'api': u'https://api.btdigg.org/api/private-341ada3245790954/s02'} self.url = self.urls['url'] + # Unsupported + # self.minseed = 1 + # self.minleech = 0 + self.cache = BTDiggCache(self) def _doSearch(self, search_strings, search_mode='eponly', epcount=0, age=0, epObj=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} + search_params = {'p': 1} for mode in search_strings.keys(): logger.log(u"Search Mode: %s" % mode, logger.DEBUG) @@ -50,7 +56,10 @@ class BTDIGGProvider(generic.TorrentProvider): if mode is not 'RSS': logger.log(u"Search string: %s" % search_string, logger.DEBUG) - searchURL = self.urls['api'] + "api/private-341ada3245790954/s02?q=" + search_string + "&p=0&order=1" + search_params['q'] = search_string.encode('utf-8') + search_params['order'] = '1' if mode is not 'RSS' else '2' + + searchURL = self.urls['api'] + '?' + urlencode(search_params) logger.log(u"Search URL: %s" % searchURL, logger.DEBUG) jdata = self.getURL(searchURL, json=True) @@ -70,7 +79,7 @@ class BTDIGGProvider(generic.TorrentProvider): if not all([title, download_url]): continue - # Filter unseeded torrent + # Filter unseeded torrent (Unsupported) # if seeders < self.minseed or leechers < self.minleech: # if mode is not 'RSS': # logger.log(u"Discarding torrent because it doesn't meet the minimum seeders or leechers: {0} (S:{1} L:{2})".format(title, seeders, leechers), logger.DEBUG) @@ -82,8 +91,8 @@ class BTDIGGProvider(generic.TorrentProvider): items[mode].append(item) - # For each search mode sort all the items by seeders if available - items[mode].sort(key=lambda tup: tup[3], reverse=True) + # For each search mode sort all the items by seeders if available (Unsupported) + # items[mode].sort(key=lambda tup: tup[3], reverse=True) results += items[mode] @@ -97,13 +106,13 @@ class BTDiggCache(tvcache.TVCache): tvcache.TVCache.__init__(self, provider_obj) - # Cache results for a hour ,since BTDigg takes some time to crawl - self.minTime = 60 + # Cache results for a 30min ,since BTDigg takes some time to crawl + self.minTime = 30 def _getRSSData(self): - # 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']} + # Use this hacky way for RSS search since most results will use this codecs + search_params = {'RSS': ['x264', 'x264.HDTV', '720.HDTV.x264']} return {'entries': self.provider._doSearch(search_params)} provider = BTDIGGProvider() diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 61a9dc5bd0890b6a175d2e9d721d496d2b4b4d8d..37c992b75956101ae95fcbe510ec56d0d9095392 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -364,7 +364,7 @@ class GenericProvider(object): # parse the file name try: - myParser = NameParser(False) + myParser = NameParser(parse_method=('normal', 'anime')[show.is_anime]) parse_result = myParser.parse(title) except InvalidNameException: logger.log(u"Unable to parse the filename " + title + " into a valid episode", logger.DEBUG) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index c35ab144898ce169d9cfd2fee6840a69b84f7804..12d42c81647d538024037ad616a8fa9fbb755994 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -502,7 +502,8 @@ class WebRoot(WebHandler): t = PageTemplate(rh=self, filename='schedule.mako') return t.render(submenu=submenu, next_week=next_week1, today=today, results=results, layout=layout, - title='Schedule', header='Schedule', topmenu='schedule') + title='Schedule', header='Schedule', topmenu='schedule', + controller="schedule", action="index") class CalendarHandler(BaseHandler): @@ -1077,7 +1078,8 @@ class Home(WebRoot): rootDir[subject] = helpers.getDiskSpaceUsage(subject) t = PageTemplate(rh=self, filename="status.mako") - return t.render(title='Status', header='Status', topmenu='system', tvdirFree=tvdirFree, rootDir=rootDir) + return t.render(title='Status', header='Status', topmenu='system', tvdirFree=tvdirFree, rootDir=rootDir, + controller="home", action="status") def shutdown(self, pid=None): if not Shutdown.stop(pid): @@ -5075,7 +5077,8 @@ class ErrorLogs(WebRoot): return t.render( header="Log File", title="Logs", topmenu="system", logLines=u"".join(data), minLevel=minLevel, logNameFilters=logNameFilters, - logFilter=logFilter, logSearch=logSearch) + logFilter=logFilter, logSearch=logSearch, + controller="errorlogs", action="viewlogs") def submit_errors(self): submitter_result, issue_id = logger.submit_errors()