From cae11c0f06b794da8eabb8e13e8a13528ba0264f Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 3 May 2014 03:09:46 -0700 Subject: [PATCH] Fixes for scene numbering in displayShows --- gui/slick/interfaces/default/displayShow.tmpl | 1 + gui/slick/js/displayShow.js | 7 +++++-- sickbeard/webserve.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gui/slick/interfaces/default/displayShow.tmpl b/gui/slick/interfaces/default/displayShow.tmpl index 75b63e53..9e34aa3a 100644 --- a/gui/slick/interfaces/default/displayShow.tmpl +++ b/gui/slick/interfaces/default/displayShow.tmpl @@ -193,6 +193,7 @@ #end for + diff --git a/gui/slick/js/displayShow.js b/gui/slick/js/displayShow.js index 73da8f4c..3b9cee95 100644 --- a/gui/slick/js/displayShow.js +++ b/gui/slick/js/displayShow.js @@ -165,13 +165,15 @@ $(document).ready(function(){ function setEpisodeSceneNumbering(forSeason, forEpisode, sceneSeason, sceneEpisode) { var sbRoot = $('#sbRoot').val(); var showId = $('#showID').val(); - + var indexer = $('#indexer').val(); + if (sceneSeason === '') sceneSeason = null; if (sceneEpisode === '') sceneEpisode = null; $.getJSON(sbRoot + '/home/setEpisodeSceneNumbering', { 'show': showId, + 'indexer': indexer, 'forSeason': forSeason, 'forEpisode': forEpisode, 'sceneSeason': sceneSeason, @@ -205,7 +207,8 @@ $(document).ready(function(){ var forSeason = $(this).attr('data-for-season'); var forEpisode = $(this).attr('data-for-episode'); var showId = $('#showID').val(); - + var indexer = $('#indexer').val(); + //var sceneEpisode = $('#sceneEpisode_' + showId + '_' + forSeason +'_' + forEpisode).val(); var m = $(this).val().match(/^(\d+)x(\d+)$/i); var sceneSeason = null, sceneEpisode = null; diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 37dba8a4..0fb107fd 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -3376,7 +3376,7 @@ class Home: return json.dumps({'result': status, 'subtitles': ','.join([x for x in ep_obj.subtitles])}) @cherrypy.expose - def setEpisodeSceneNumbering(self, show, forSeason, forEpisode, sceneSeason=None, sceneEpisode=None): + def setEpisodeSceneNumbering(self, show, indexer, forSeason, forEpisode, sceneSeason=None, sceneEpisode=None): # sanitize: if sceneSeason in ['null', '']: sceneSeason = None @@ -3398,14 +3398,14 @@ class Home: (show, forSeason, forEpisode, sceneSeason, sceneEpisode), logger.DEBUG) show = int(show) - indexer = int(ep_obj.indexer) + indexer = int(indexer) forSeason = int(forSeason) forEpisode = int(forEpisode) if sceneSeason is not None: sceneSeason = int(sceneSeason) if sceneEpisode is not None: sceneEpisode = int(sceneEpisode) set_scene_numbering(show, forSeason, forEpisode, sceneSeason, sceneEpisode) - + sn = get_scene_numbering(show, indexer, forSeason, forEpisode) if sn: (result['sceneSeason'], result['sceneEpisode']) = sn