From afde3b4c2889bcd4b257d39ccaf366c38c41c68b Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 3 May 2014 15:29:00 -0700 Subject: [PATCH] Fixes issues #333 and problems with converting str to int via prettyName func --- gui/slick/css/default.css | 15 +- gui/slick/images/google/google.donate.gif | Bin 0 -> 1639 bytes gui/slick/images/payza.jpg | Bin 0 -> 2038 bytes gui/slick/interfaces/default/inc_bottom.tmpl | 3 - gui/slick/interfaces/default/inc_top.tmpl | 5 +- gui/slick/js/script.js | 186 +++++++++++-------- sickbeard/__init__.py | 3 + sickbeard/databases/mainDB.py | 30 --- sickbeard/scene_numbering.py | 34 +++- sickbeard/show_name_helpers.py | 6 - sickbeard/tv.py | 14 +- 11 files changed, 165 insertions(+), 131 deletions(-) create mode 100644 gui/slick/images/google/google.donate.gif create mode 100644 gui/slick/images/payza.jpg diff --git a/gui/slick/css/default.css b/gui/slick/css/default.css index 4a40a788..abff4f01 100644 --- a/gui/slick/css/default.css +++ b/gui/slick/css/default.css @@ -176,7 +176,7 @@ a{ #header .wrapper { margin: 0 auto; position: relative; - width: 850px; + width: 960px; } #header a:hover { background: none; @@ -192,7 +192,7 @@ a{ float: left; position: relative; top: 0px; - left: 5px; + left: -5px; } #versiontext { color: #FFFFFF; @@ -201,7 +201,7 @@ a{ position: relative; /* text-transform: lowercase;*/ top: 42px; - left: 5px; + left: -5px } .update { @@ -1863,3 +1863,12 @@ pre { height: 37px; text-align: center; } + +#donate_form{ + position: absolute; + border: 5px solid gray; + padding: 10px; + background: white; + width: 270px; + height: 220px; +} \ No newline at end of file diff --git a/gui/slick/images/google/google.donate.gif b/gui/slick/images/google/google.donate.gif new file mode 100644 index 0000000000000000000000000000000000000000..4bc23a3065328ebf89cb915ae53690d99a156774 GIT binary patch literal 1639 zcmV-t2AKIrNk%w1VQl~&0LFd*KZf!(cHP$F_VMxYiKp1wL^cMRSUG&;LW}uYg~;{w z^>UWc%iQ-aWw}bVh3Dtzp-W(j(6ESziTU~YJ%jEw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IYXoE@#pB=f|PB7G`g@ihvih%zLU-9VU{5E$5! z*zNbMnISd$3s=_*_Ezdl<8t0YeuPwK8TfHuMSn}AOIl%g6*$_20k&g`fh4SowvH^5 z8|)d0jet@?pSY!_y-Kqg0Xx|UBWa*2x*vxu+tOIl+_tx^*;OC3w;`BwatP-npS?Oh zAJU6v(9&5JnX)J>j0->#L_s?Z{VICz7z)Y?FjB0M2_%~vOM=A-l5BjXsXC^;@T>@Fy5tm_#1XLae1|Kw7lT|bi2mGt&2y-bIw#k<=rwyELIzo6BAEc;}+Ng3GGB}&RZYqH>T&*#_80| zX?42MYoQCN=%O&_pBN@%yIfsL_we`s0F!g{t;q3J0m%$7??@YMK6TY<=w%Ey3;`cQ zy&j1^GGXZNjEp;md@rfhzecv50p|A+l~y;TFIk$qc1T zo?wzs`?d&& z3`qB{XrL8ygsT-SS(!uzBuLyhm#4LP_&PxyqqGS<(KFfd+z)E@iUZqRF;^HZD#fIo z$!>FAYWPLFtXaV%t~~rEf4TRfiUD7SrdbIGAln}hp*^5dwA?*y@UZX^VUyE88QxZz3e_S&1fnH#AW|C~$Sh9Gr}@+=-Jid2cd#*IkPt U6;yIi0QvzGQ9wCG6i^@k*_WJ&3;+NC literal 0 HcmV?d00001 diff --git a/gui/slick/interfaces/default/inc_bottom.tmpl b/gui/slick/interfaces/default/inc_bottom.tmpl index 02ee0e8b..2ef35410 100644 --- a/gui/slick/interfaces/default/inc_bottom.tmpl +++ b/gui/slick/interfaces/default/inc_bottom.tmpl @@ -19,9 +19,6 @@ Backlog: $sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())
    -
  • - I like this interface! -
  • Force Version Check
  • Restart
  • Shutdown
  • diff --git a/gui/slick/interfaces/default/inc_top.tmpl b/gui/slick/interfaces/default/inc_top.tmpl index b9affab3..169e3f82 100644 --- a/gui/slick/interfaces/default/inc_top.tmpl +++ b/gui/slick/interfaces/default/inc_top.tmpl @@ -156,7 +156,6 @@ a > i.icon-question-sign { background-image: url("$sbRoot/images/glyphicons-half \$("#SubMenu a[href$='/home/updateXBMC/']").addClass('btn').html(' Update XBMC'); } \$(document).ready(function(){ - initActions(); \$("ul.sf-menu").supersubs({ minWidth: 12, // minimum width of sub-menus in em units @@ -199,10 +198,7 @@ a > i.icon-question-sign { background-image: url("$sbRoot/images/glyphicons-half location.href = target; return false; }); - }); - - //--> @@ -266,6 +262,7 @@ a > i.icon-question-sign { background-image: url("$sbRoot/images/glyphicons-half
  • Notifications
+ diff --git a/gui/slick/js/script.js b/gui/slick/js/script.js index 5306cfee..171cc2ec 100644 --- a/gui/slick/js/script.js +++ b/gui/slick/js/script.js @@ -1,89 +1,93 @@ -function initHeader() { - //settings - var header = $("#header"); - var fadeSpeed = 100, fadeTo = 0.8, topDistance = 20; - var topbarME = function() { $(header).fadeTo(fadeSpeed,1); }, topbarML = function() { $(header).fadeTo(fadeSpeed,fadeTo); }; - var inside = false; - //do - $(window).scroll(function() { - position = $(window).scrollTop(); - if(position > topDistance && !inside) { - //add events - topbarML(); - $(header).bind('mouseenter',topbarME); - $(header).bind('mouseleave',topbarML); - inside = true; - } - else if (position < topDistance){ - topbarME(); - $(header).unbind('mouseenter',topbarME); - $(header).unbind('mouseleave',topbarML); - inside = false; - } - }); - +function initHeader() { + //settings + var header = $("#header"); + var fadeSpeed = 100, fadeTo = 0.8, topDistance = 20; + var topbarME = function () { + $(header).fadeTo(fadeSpeed, 1); + }, topbarML = function () { + $(header).fadeTo(fadeSpeed, fadeTo); + }; + var inside = false; + //do + $(window).scroll(function () { + position = $(window).scrollTop(); + if (position > topDistance && !inside) { + //add events + topbarML(); + $(header).bind('mouseenter', topbarME); + $(header).bind('mouseleave', topbarML); + inside = true; + } + else if (position < topDistance) { + topbarME(); + $(header).unbind('mouseenter', topbarME); + $(header).unbind('mouseleave', topbarML); + inside = false; + } + }); + } -function showMsg(msg,loader,timeout,ms) { - var feedback = $("#ajaxMsg"); - update = $("#updatebar"); - if ( update.is(":visible") ) { - var height = update.height() + 35; - feedback.css("bottom",height + "px"); - } else { - feedback.removeAttr("style"); - } - feedback.fadeIn(); - var message = $("
" + msg + "
"); - if (loader) { - var message = $("
loading" + msg + "
"); - feedback.css("padding","14px 10px") - } - $(feedback).prepend(message); - if (timeout) { - setTimeout(function(){ - message.fadeOut(function(){ - $(this).remove(); - feedback.fadeOut(); - }); - },ms); - } +function showMsg(msg, loader, timeout, ms) { + var feedback = $("#ajaxMsg"); + update = $("#updatebar"); + if (update.is(":visible")) { + var height = update.height() + 35; + feedback.css("bottom", height + "px"); + } else { + feedback.removeAttr("style"); + } + feedback.fadeIn(); + var message = $("
" + msg + "
"); + if (loader) { + var message = $("
loading" + msg + "
"); + feedback.css("padding", "14px 10px") + } + $(feedback).prepend(message); + if (timeout) { + setTimeout(function () { + message.fadeOut(function () { + $(this).remove(); + feedback.fadeOut(); + }); + }, ms); + } } -function resetFilters(text){ - if ( $(".dataTables_filter").length > 0 ) { - $(".dataTables_filter input").attr("placeholder","filter " + text + ""); - } +function resetFilters(text) { + if ($(".dataTables_filter").length > 0) { + $(".dataTables_filter input").attr("placeholder", "filter " + text + ""); + } } -function preventDefault(){ - $("a[href='#']").live('click', function(){ - return false; - }); +function preventDefault() { + $("a[href='#']").live('click', function () { + return false; + }); } function initFancybox() { - if ( $("a[rel=dialog]").length > 0 ) { - $.getScript(sbRoot + '/js/fancybox/jquery.fancybox-1.3.4.js', function() { - $("head").append(""); - $("a[rel=dialog]").fancybox({ - type: "image" - }); - }); - } + if ($("a[rel=dialog]").length > 0) { + $.getScript(sbRoot + '/js/fancybox/jquery.fancybox-1.3.4.js', function () { + $("head").append(""); + $("a[rel=dialog]").fancybox({ + type: "image" + }); + }); + } } function initTabs() { - $("#config-components").tabs({ - activate: function(event, ui) { + $("#config-components").tabs({ + activate: function (event, ui) { var lastOpenedPanel = $(this).data("lastOpenedPanel"); var selected = $(this).tabs('option', 'selected'); if (lastOpenedPanel) { } else { - lastOpenedPanel = $(ui.oldPanel) + lastOpenedPanel = $(ui.oldPanel) } if (!$(this).data("topPositionTab")) { @@ -104,9 +108,9 @@ function initTabs() { .toggleClass("ui-tabs-hide") .css("position", "absolute") .css("top", $(this).data("topPositionTab") + "px") - .fadeOut(700, function() { + .fadeOut(700, function () { $(this) - .css("position", ""); + .css("position", ""); }); } @@ -119,13 +123,41 @@ function initTabs() { }); } -function init() { - initHeader(); - preventDefault(); - initFancybox(); - initTabs(); +function initDonateBox() { + //open popup + $("#donate").click(function () { + $("#donate_form").fadeIn(1000); + positionPopup(); + }); + + //close popup + $("#close").click(function () { + $("#donate_form").fadeOut(500); + }); } -$(document).ready(function(){ - init(); -}); +//position the popup at the center of the page +function positionPopup() { + if (!$("#donate_form").is(':visible')) { + return; + } + $("#donate_form").css({ + left: ($(window).width() - $('#donate_form').width()) / 2, + top: ($(window).width() - $('#donate_form').width()) / 4, + position: 'absolute' + }); +} + +//maintain the popup at center of the page when browser resized +$(window).bind('resize', positionPopup); +function init() { + initHeader(); + preventDefault(); + initFancybox(); + initTabs(); + initDonateBox(); +} + +$(document).ready(function () { + init(); +}); \ No newline at end of file diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 706d1bca..6fd784f2 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -987,6 +987,9 @@ def initialize(consoleLogging=True): newznabProviderList = providers.getNewznabProviderList(NEWZNAB_DATA) providerList = providers.makeProviderList() + # fix scene numbering in mainDB + scene_numbering.fix_scene_numbering() + # initialize newznab providers currentSearchScheduler = scheduler.Scheduler(searchCurrent.CurrentSearcher(), cycleTime=datetime.timedelta(minutes=SEARCH_FREQUENCY), diff --git a/sickbeard/databases/mainDB.py b/sickbeard/databases/mainDB.py index 0bb06aa4..302d0ed3 100644 --- a/sickbeard/databases/mainDB.py +++ b/sickbeard/databases/mainDB.py @@ -35,7 +35,6 @@ class MainSanityCheck(db.DBSanityCheck): self.fix_duplicate_shows() self.fix_duplicate_episodes() self.fix_orphan_episodes() - self.fix_scene_numbering() def fix_duplicate_shows(self): @@ -124,35 +123,6 @@ class MainSanityCheck(db.DBSanityCheck): logger.log(u"Missing idx_sta_epi_sta_air for TV Episodes table detected!, fixing...") self.connection.action("CREATE INDEX idx_sta_epi_sta_air ON tv_episodes (season,episode, status, airdate)") - - def fix_scene_numbering(self): - ql = [] - - sqlResults = self.connection.select( - "SELECT showid, indexerid, indexer, episode_id, season, episode FROM tv_episodes WHERE scene_season = -1 OR scene_episode = -1") - - for epResult in sqlResults: - indexerid = int(str(epResult["showid"]).encode('UTF-8')) - indexer = int(str(epResult["indexer"]).encode('UTF-8')) - season = int(str(epResult["season"]).encode('UTF-8')) - episode = int(str(epResult["episode"]).encode('UTF-8')) - - logger.log( - u"Repairing any scene numbering issues for showid: " + str(epResult["showid"]) + u" season: " + str( - epResult["season"]) + u" episode: " + str(epResult["episode"]), logger.DEBUG) - - scene_season, scene_episode = sickbeard.scene_numbering.get_scene_numbering(indexerid, - indexer, - season, - episode) - - ql.append(["UPDATE tv_episodes SET scene_season = ? WHERE indexerid = ?", [scene_season, epResult["indexerid"]]]) - ql.append( - ["UPDATE tv_episodes SET scene_episode = ? WHERE indexerid = ?", [scene_episode, epResult["indexerid"]]]) - - self.connection.mass_action(ql) - - def backupDatabase(version): logger.log(u"Backing up database before upgrade") if not helpers.backupVersionedFile(db.dbFilename(), version): diff --git a/sickbeard/scene_numbering.py b/sickbeard/scene_numbering.py index 5a51c57d..ebe5b154 100644 --- a/sickbeard/scene_numbering.py +++ b/sickbeard/scene_numbering.py @@ -360,4 +360,36 @@ def get_xem_numbering_for_season(indexer_id, indexer, season): else: result.setdefault(int(season), []).append(int(season)) - return result \ No newline at end of file + return result + + +def fix_scene_numbering(): + ql = [] + + myDB = db.DBConnection() + + sqlResults = myDB.select( + "SELECT showid, indexerid, indexer, episode_id, season, episode FROM tv_episodes WHERE scene_season = -1 OR scene_episode = -1") + + for epResult in sqlResults: + + indexerid = int(epResult["showid"]) + indexer = int(epResult["indexer"]) + season = int(epResult["season"]) + episode = int(epResult["episode"]) + + logger.log( + u"Repairing any scene numbering issues for showid: " + str(epResult["showid"]) + u" season: " + str( + epResult["season"]) + u" episode: " + str(epResult["episode"]), logger.DEBUG) + + scene_season, scene_episode = sickbeard.scene_numbering.get_scene_numbering(indexerid, + indexer, + season, + episode) + + ql.append( + ["UPDATE tv_episodes SET scene_season = ? WHERE indexerid = ?", [scene_season, epResult["indexerid"]]]) + ql.append( + ["UPDATE tv_episodes SET scene_episode = ? WHERE indexerid = ?", [scene_episode, epResult["indexerid"]]]) + + myDB.mass_action(ql) diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index 3953936f..c16db05c 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -52,12 +52,6 @@ def filterBadReleases(name): logger.log(u"Unable to parse the filename " + name + " into a valid episode", logger.WARNING) return False - # if we can't find the show then there's nothing we can really do - if not parse_result.show: - logger.log(u"This show isn't in your list, skipping ...", - logger.DEBUG) - return False - # if any of the bad strings are in the name then say no if sickbeard.IGNORE_WORDS: resultFilters.extend(sickbeard.IGNORE_WORDS.split(',')) diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 3bbb45ab..5fd514a2 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -1778,7 +1778,7 @@ class TVEpisode(object): Returns: A string representing the episode's name and season/ep numbers """ - return self._format_pattern('%SN - %XMSx%0XME - %EN') + return self._format_pattern('%SN - %XSx%0XE - %EN') def _ep_name(self): """ @@ -1876,13 +1876,13 @@ class TVEpisode(object): '%Q.N': dot(Quality.qualityStrings[epQual]), '%Q_N': us(Quality.qualityStrings[epQual]), '%S': str(self.season), - '%0S': '%02d' % self.season, + '%0S': '%02d' % int(self.season), '%E': str(self.episode), - '%0E': '%02d' % self.episode, - '%XMS': str(self.scene_season), - '%0XMS': '%02d' % self.scene_season, - '%XME': str(self.scene_episode), - '%0XME': '%02d' % self.scene_episode, + '%0E': '%02d' % int(self.episode), + '%XS': str(self.scene_season), + '%0XS': '%02d' % int(self.scene_season), + '%XE': str(self.scene_episode), + '%0XE': '%02d' % int(self.scene_episode), '%RN': release_name(self.release_name), '%RG': release_group(self.release_name), '%AD': str(self.airdate).replace('-', ' '),