Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added custom name types for episode files (during post-processing and…

… renaming)

Fixed a bug where Sick Beard thought there were still NFO/TBN files after an episode was deleted from disk
Added better refresh feedback
Added better Newzbin auth error handling
  • Loading branch information...
commit f39e0f844e82c64fafdf8a5121b154a83d1b9647 1 parent 4a31d8d
Nic Wolfe authored
43 data/interfaces/default/config_general.tmpl
@@ -9,6 +9,8 @@
9 9 #import os.path
10 10 #include $os.path.join($sickbeard.PROG_DIR, "data/interfaces/default/inc_top.tmpl")
11 11
  12 +<script type="text/javascript" src="$sbRoot/js/configGeneral.js"></script>
  13 +
12 14 <form action="saveGeneral" method="POST">
13 15
14 16 All non-absolute folder locations are relative to $sickbeard.PROG_DIR<br /><br />
@@ -67,6 +69,7 @@ Web authentication password<br />
67 69 </div>
68 70 </fieldset>
69 71
  72 +<div class="EntryBlock">
70 73 <fieldset class="EntryFieldSet">
71 74
72 75 <legend>Defaults</legend>
@@ -87,6 +90,46 @@ Whether shows should use season folders by default<br />
87 90 </fieldset>
88 91 </div>
89 92
  93 +#set $naming_ep_type_text = ("1x02", "s01e02", "S01E02")
  94 +#set $naming_multi_ep_type_text = ("extend", "duplicate", "repeat")
  95 +
  96 +<div class="EntryBlock">
  97 +<fieldset class="EntryFieldSet">
  98 +
  99 +<legend>Episode Naming</legend>
  100 +
  101 +<input type="checkbox" name="naming_show_name" id="naming_show_name" #if $sickbeard.NAMING_SHOW_NAME then "CHECKED" else ""#> <strong>Use show name</strong><br />
  102 +If not checked the show name will be<br />
  103 +omitted from your episode names<br />
  104 +<br />
  105 +
  106 +<strong>Number Style</strong><br />
  107 +Style of season/episode numbers<br />
  108 +<select name="naming_ep_type" id="naming_ep_type">
  109 +#for $i in range(len($naming_ep_type_text)):
  110 +<option value="$i" #if $i == int($sickbeard.NAMING_EP_TYPE) then "SELECTED" else ""#>$naming_ep_type_text[$i]
  111 +#end for
  112 +</select><br />
  113 +<br />
  114 +
  115 +<strong>Example:</strong> <div id="normalExampleText"></div><br />
  116 +<br />
  117 +
  118 +<strong>Multi-episode Style</strong><br />
  119 +Style of season/episode numbers for multi-episodes<br />
  120 +<select name="naming_multi_ep_type" id="naming_multi_ep_type">
  121 +#for $i in range(len($naming_multi_ep_type_text)):
  122 +<option value="$i" #if $i == int($sickbeard.NAMING_MULTI_EP_TYPE) then "SELECTED" else ""#>$naming_multi_ep_type_text[$i]
  123 +#end for
  124 +</select><br />
  125 +<br />
  126 +
  127 +<strong>Example:</strong> <div id="multiExampleText"></div><br />
  128 +<br />
  129 +
  130 +</fieldset>
  131 +</div>
  132 +
90 133
91 134 <p>
92 135 <input type="submit" value="Save Changes">
46 data/js/configGeneral.js
... ... @@ -0,0 +1,46 @@
  1 +$(document).ready(function(){
  2 +
  3 + var multiExamples = [["1x02-03", "s01e02-03", "S01E02-03"],
  4 + ["1x02 - 1x03", "s01e02 - s01e03", "S01E02 - S01E03"],
  5 + ["1x02x03", "s01e02e03", "S01E02E03"]
  6 + ]
  7 +
  8 + $.fn.setExampleText = function() {
  9 +
  10 + exampleText = ""
  11 + multiExampleText = ""
  12 +
  13 + if ($('#naming_show_name').attr('checked')) {
  14 + exampleText += "Show Name - ";
  15 + multiExampleText += "Show Name - ";
  16 + }
  17 +
  18 + var numStyleSel = $('#naming_ep_type :selected')
  19 + var multiNumStyleSel = $('#naming_multi_ep_type :selected')
  20 +
  21 + exampleText += numStyleSel.text()
  22 + multiExampleText += multiExamples[multiNumStyleSel.val()][numStyleSel.val()]
  23 +
  24 + exampleText += " - Episode Name"
  25 + multiExampleText += " - Episode Name(s)"
  26 +
  27 + $('#multiExampleText').text(multiExampleText);
  28 +
  29 + return $('#normalExampleText').text(exampleText);
  30 + };
  31 +
  32 + $(this).setExampleText();
  33 +
  34 + $('#naming_show_name').click(function(){
  35 + $(this).setExampleText();
  36 + });
  37 +
  38 + $('#naming_multi_ep_type').click(function(){
  39 + $(this).setExampleText();
  40 + });
  41 +
  42 + $('#naming_ep_type').click(function(){
  43 + $(this).setExampleText();
  44 + });
  45 +
  46 +});
20 sickbeard/__init__.py
@@ -77,6 +77,10 @@
77 77 QUALITY_DEFAULT = None
78 78 SEASON_FOLDERS_DEFAULT = None
79 79
  80 +NAMING_SHOW_NAME = None
  81 +NAMING_EP_TYPE = None
  82 +NAMING_MULTI_EP_TYPE = None
  83 +
80 84 TVDB_API_KEY = '9DAF49C96CBF8DAC'
81 85 TVDB_BASE_URL = None
82 86
@@ -241,7 +245,9 @@ def initialize():
241 245 USE_GROWL, GROWL_HOST, GROWL_PASSWORD, PROG_DIR, NZBMATRIX, NZBMATRIX_USERNAME, \
242 246 NZBMATRIX_APIKEY, versionCheckScheduler, VERSION_NOTIFY, PROCESS_AUTOMATICALLY, \
243 247 KEEP_PROCESSED_DIR, TV_DOWNLOAD_DIR, TVNZB, TVDB_BASE_URL, MIN_SEARCH_FREQUENCY, \
244   - MIN_BACKLOG_SEARCH_FREQUENCY, TVBINZ_AUTH, TVBINZ_SABUID, showQueueScheduler
  248 + MIN_BACKLOG_SEARCH_FREQUENCY, TVBINZ_AUTH, TVBINZ_SABUID, showQueueScheduler, \
  249 + NAMING_SHOW_NAME, NAMING_EP_TYPE, NAMING_MULTI_EP_TYPE
  250 +
245 251
246 252 if __INITIALIZED__:
247 253 return False
@@ -280,6 +286,10 @@ def initialize():
280 286 VERSION_NOTIFY = check_setting_int(CFG, 'General', 'version_notify', 1)
281 287 SEASON_FOLDERS_DEFAULT = bool(check_setting_int(CFG, 'General', 'season_folders_default', 0))
282 288
  289 + NAMING_SHOW_NAME = bool(check_setting_int(CFG, 'General', 'naming_show_name', 1))
  290 + NAMING_EP_TYPE = check_setting_int(CFG, 'General', 'naming_ep_string', 0)
  291 + NAMING_MULTI_EP_TYPE = check_setting_int(CFG, 'General', 'naming_multi_ep_type', 0)
  292 +
283 293 TVDB_BASE_URL = 'http://www.thetvdb.com/api/' + TVDB_API_KEY
284 294
285 295 NZB_METHOD = check_setting_str(CFG, 'General', 'nzb_method', 'blackhole')
@@ -519,7 +529,10 @@ def save_config():
519 529 USE_TORRENT, TORRENT_DIR, USENET_RETENTION, SEARCH_FREQUENCY, BACKLOG_SEARCH_FREQUENCY, \
520 530 QUALITY_DEFAULT, SEASON_FOLDERS_DEFAULT, USE_GROWL, GROWL_HOST, GROWL_PASSWORD, \
521 531 NZBMATRIX, NZBMATRIX_USERNAME, NZBMATRIX_APIKEY, VERSION_NOTIFY, TV_DOWNLOAD_DIR, \
522   - PROCESS_AUTOMATICALLY, KEEP_PROCESSED_DIR, TVNZB, TVBINZ_AUTH, TVBINZ_SABUID
  532 + PROCESS_AUTOMATICALLY, KEEP_PROCESSED_DIR, TVNZB, TVBINZ_AUTH, TVBINZ_SABUID, \
  533 + NAMING_SHOW_NAME, NAMING_EP_TYPE, NAMING_MULTI_EP_TYPE
  534 +
  535 +
523 536
524 537 CFG['General']['log_dir'] = LOG_DIR
525 538 CFG['General']['web_port'] = WEB_PORT
@@ -535,6 +548,9 @@ def save_config():
535 548 CFG['General']['quality_default'] = int(QUALITY_DEFAULT)
536 549 CFG['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT)
537 550 CFG['General']['version_notify'] = int(VERSION_NOTIFY)
  551 + CFG['General']['naming_show_name'] = int(NAMING_SHOW_NAME)
  552 + CFG['General']['naming_ep_type'] = int(NAMING_EP_TYPE)
  553 + CFG['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE)
538 554 CFG['General']['use_torrent'] = int(USE_TORRENT)
539 555 CFG['General']['launch_browser'] = int(LAUNCH_BROWSER)
540 556 CFG['General']['create_metadata'] = int(CREATE_METADATA)
4 sickbeard/classes.py
@@ -59,7 +59,7 @@ def __str__(self):
59 59 return myString
60 60
61 61 def fileName(self):
62   - return self.episode.prettyName() + "." + self.resultType
  62 + return self.episode.prettyName(True) + "." + self.resultType
63 63
64 64 class NZBSearchResult(SearchResult):
65 65 resultType = "nzb"
@@ -85,7 +85,7 @@ def selectSeries(self, allSeries):
85 85 # if nothing matches then just go with the first match I guess
86 86 return allSeries[0]
87 87
88   -# This is easy to solve with a simple tiny wrapper:
  88 +# Simple wrapper to allow me to simulate static classes
89 89 class Callable:
90 90 def __init__(self, anycallable):
91 91 self.__call__ = anycallable
8 sickbeard/config.py
@@ -29,6 +29,14 @@
29 29
30 30 import sickbeard
31 31
  32 +naming_ep_type = ("%(seasonnumber)dx%(episodenumber)02d",
  33 + "s%(seasonnumber)02de%(episodenumber)02d",
  34 + "S%(seasonnumber)02dE%(episodenumber)02d")
  35 +naming_multi_ep_type = {0: ["-%(episodenumber)02d"]*len(naming_ep_type),
  36 + 1: [" - " + x for x in naming_ep_type],
  37 + 2: [x + "%(episodenumber)02d" for x in ("x", "e", "E")]}
  38 +
  39 +
32 40 def change_LOG_DIR(log_dir):
33 41
34 42 if os.path.normpath(sickbeard.LOG_DIR) != os.path.normpath(log_dir):
21 sickbeard/helpers.py
@@ -95,6 +95,11 @@ def sanitizeFileName (name):
95 95 name = name.replace(x, "")
96 96 return name
97 97
  98 +
  99 +def sceneToNormalShowNames(name):
  100 +
  101 + return (name, name.replace(" and ", " & "))
  102 +
98 103 def makeSceneShowSearchStrings(show):
99 104
100 105 showNames = [show.name]
@@ -276,16 +281,28 @@ def makeShowNFO(showID, showDir):
276 281
277 282 def searchDBForShow(showName):
278 283
  284 + showNames = [showName]
  285 +
279 286 # if tvdb fails then try looking it up in the db
280 287 myDB = db.DBConnection()
  288 +
  289 + yearRegex = "(.*)([(]?)(\d{4})(?(2)[)]?).*"
281 290 sqlResults = myDB.select("SELECT * FROM tv_shows WHERE show_name LIKE ?", [showName+'%'])
282 291
283 292 if len(sqlResults) != 1:
  293 +
  294 + # if we didn't get exactly one result then try again with the year stripped off if possible
  295 + match = re.match(yearRegex, showName)
  296 + if match:
  297 + logger.log("Unable to match original name but trying to manually strip and specify show year", logger.DEBUG)
  298 + sqlResults = myDB.select("SELECT * FROM tv_shows WHERE show_name LIKE ? AND startyear = ?", [match.group(1)+'%', match.group(3)])
  299 +
284 300 if len(sqlResults) == 0:
285 301 logger.log("Unable to match a record in the DB for "+showName, logger.DEBUG)
286   - else:
  302 + return None
  303 + elif len(sqlResults) > 1:
287 304 logger.log("Multiple results for "+showName+" in the DB, unable to match show name", logger.DEBUG)
288   - return None
  305 + return None
289 306
290 307 return (int(sqlResults[0]["tvdb_id"]), sqlResults[0]["show_name"])
291 308
2  sickbeard/processTV.py
@@ -240,7 +240,7 @@ def doIt(downloaderDir, nzbName=None):
240 240
241 241 # wait for the copy to finish
242 242
243   - notifiers.notify(NOTIFY_DOWNLOAD, rootEp.prettyName())
  243 + notifiers.notify(NOTIFY_DOWNLOAD, rootEp.prettyName(True))
244 244
245 245
246 246 # figure out the new filename
2  sickbeard/providers/eztv.py
@@ -54,7 +54,7 @@ def findEpisode(episode, forceQuality=None):
54 54 logger.log("EZTV doesn't support disc backlog. Download it manually.")
55 55 return []
56 56
57   - logger.log("Searching EZTV for " + episode.prettyName())
  57 + logger.log("Searching EZTV for " + episode.prettyName(True))
58 58
59 59 if forceQuality != None:
60 60 epQuality = forceQuality
7 sickbeard/providers/newzbin.py
@@ -90,7 +90,7 @@ def downloadNZB(nzb):
90 90
91 91 def findEpisode(episode, forceQuality=None):
92 92
93   - logger.log("Searching newzbin for " + episode.prettyName())
  93 + logger.log("Searching newzbin for " + episode.prettyName(True))
94 94
95 95 if forceQuality != None:
96 96 epQuality = forceQuality
@@ -173,7 +173,10 @@ def findEpisode(episode, forceQuality=None):
173 173 continue
174 174
175 175 if len(curResult) == 1:
176   - logger.log("Newzbin returned a malformed result, skipping it", logger.ERROR)
  176 + if curResult[0] == 'Error: Login Required - You need to login to access this feed.':
  177 + raise exceptions.AuthException("Incorrect username/password for Newzbin")
  178 + else:
  179 + logger.log("Newzbin returned a malformed result, skipping it", logger.ERROR)
177 180 continue
178 181
179 182 logger.log("Found report number " + str(curResult[2]) + " at " + curResult[4] + " (" + curResult[5] + ")")
2  sickbeard/providers/nzbmatrix.py
@@ -55,7 +55,7 @@ def findEpisode (episode, forceQuality=None):
55 55 logger.log("NZBMatrix doesn't support disc backlog. Use newzbin or download it manually from NZBMatrix")
56 56 return []
57 57
58   - logger.log("Searching NZBMatrix for " + episode.prettyName())
  58 + logger.log("Searching NZBMatrix for " + episode.prettyName(True))
59 59
60 60 if forceQuality != None:
61 61 epQuality = forceQuality
2  sickbeard/providers/nzbs.py
@@ -82,7 +82,7 @@ def findEpisode (episode, forceQuality=None):
82 82 if sickbeard.NZBS_UID in (None, "") or sickbeard.NZBS_HASH in (None, ""):
83 83 raise exceptions.AuthException("NZBs.org authentication details are empty, check your config")
84 84
85   - logger.log("Searching NZBs.org for " + episode.prettyName())
  85 + logger.log("Searching NZBs.org for " + episode.prettyName(True))
86 86
87 87 if forceQuality != None:
88 88 epQuality = forceQuality
2  sickbeard/providers/tvbinz.py
@@ -89,7 +89,7 @@ def findEpisode (episode, forceQuality=None):
89 89 if sickbeard.TVBINZ_UID in (None, "") or sickbeard.TVBINZ_HASH in (None, "") or sickbeard.TVBINZ_AUTH in (None, ""):
90 90 raise exceptions.AuthException("TVBinz authentication details are empty, check your config")
91 91
92   - logger.log("Searching tvbinz for " + episode.prettyName())
  92 + logger.log("Searching tvbinz for " + episode.prettyName(True))
93 93
94 94 if forceQuality != None:
95 95 epQuality = forceQuality
2  sickbeard/providers/tvnzb.py
@@ -84,7 +84,7 @@ def findEpisode (episode, forceQuality=None):
84 84 logger.log("TVNZB doesn't support disc backlog. Use Newzbin or download it manually from TVNZB")
85 85 return []
86 86
87   - logger.log("Searching TVNZB for " + episode.prettyName())
  87 + logger.log("Searching TVNZB for " + episode.prettyName(True))
88 88
89 89 if forceQuality != None:
90 90 epQuality = forceQuality
2  sickbeard/queue.py
@@ -282,7 +282,7 @@ def execute(self):
282 282
283 283 logger.log("Performing refresh on "+self.show.name)
284 284
285   - self.show.loadEpisodesFromDir()
  285 + self.show.refreshDir()
286 286 self.show.getImages()
287 287 self.show.writeEpisodeNFOs()
288 288
4 sickbeard/search.py
@@ -76,7 +76,7 @@ def snatchEpisode(result):
76 76 # log the snatch
77 77 history.logSnatch(result)
78 78
79   - notifiers.notify(NOTIFY_SNATCH, result.episode.prettyName())
  79 + notifiers.notify(NOTIFY_SNATCH, result.episode.prettyName(True))
80 80
81 81 with result.episode.lock:
82 82 if result.predownloaded == False:
@@ -115,7 +115,7 @@ def _doSearch(episode, provider):
115 115
116 116 def findEpisode(episode):
117 117
118   - logger.log("Searching for " + episode.prettyName())
  118 + logger.log("Searching for " + episode.prettyName(True))
119 119
120 120 foundEps = []
121 121
6 sickbeard/searchBacklog.py
@@ -84,12 +84,12 @@ def searchBacklog(self):
84 84
85 85 curEp = show.getEpisode(sqlEp["season"], sqlEp["episode"])
86 86
87   - logger.log("Found backlog episode: " + curEp.prettyName(), logger.DEBUG)
  87 + logger.log("Found backlog episode: " + curEp.prettyName(True), logger.DEBUG)
88 88
89 89 foundNZBs = search.findEpisode(curEp)
90 90
91 91 if len(foundNZBs) == 0:
92   - logger.log("Unable to find NZB for " + curEp.prettyName())
  92 + logger.log("Unable to find NZB for " + curEp.prettyName(True))
93 93
94 94 else:
95 95 # just use the first result for now
@@ -108,7 +108,7 @@ def _searchBacklogForEp(self, curEp):
108 108 foundNZBs = search.findEpisode(curEp)
109 109
110 110 if len(foundNZBs) == 0:
111   - logger.log("Unable to find NZB for " + curEp.prettyName())
  111 + logger.log("Unable to find NZB for " + curEp.prettyName(True))
112 112
113 113 else:
114 114 # just use the first result for now
4 sickbeard/searchCurrent.py
@@ -62,9 +62,9 @@ def searchForTodaysEpisodes(self):
62 62
63 63 if len(foundEpisodes) == 0:
64 64 if curEp.status == PREDOWNLOADED:
65   - logger.log("Unable to find an HD version of the existing episode "+ curEp.prettyName())
  65 + logger.log("Unable to find an HD version of the existing episode "+ curEp.prettyName(True))
66 66 else:
67   - logger.log("Unable to find download for " + curEp.prettyName())
  67 + logger.log("Unable to find download for " + curEp.prettyName(True))
68 68 else:
69 69 # just use the first result for now
70 70 search.snatchEpisode(foundEpisodes[0])
41 sickbeard/tv.py
@@ -41,6 +41,7 @@
41 41 from sickbeard import processTV
42 42 from sickbeard import classes
43 43 from sickbeard import tvrage
  44 +from sickbeard import config
44 45
45 46 from common import *
46 47 from sickbeard import logger
@@ -717,6 +718,8 @@ def refreshDir(self):
717 718 curEp.location = ''
718 719 if curEp.status == DOWNLOADED:
719 720 curEp.status = SKIPPED
  721 + curEp.hasnfo = False
  722 + curEp.hastbn = False
720 723 curEp.saveToDB()
721 724
722 725
@@ -872,6 +875,9 @@ def __init__(self, show, season, episode, file=""):
872 875
873 876 def checkForMetaFiles(self):
874 877
  878 + oldhasnfo = self.hasnfo
  879 + oldhastbn = self.hastbn
  880 +
875 881 # check for nfo and tbn
876 882 if os.path.isfile(self.location):
877 883 if os.path.isfile(os.path.join(self.show.location, helpers.replaceExtension(self.location, 'nfo'))):
@@ -884,7 +890,8 @@ def checkForMetaFiles(self):
884 890 else:
885 891 self.hastbn = False
886 892
887   -
  893 + # if either setting has changed return true, if not return false
  894 + return oldhasnfo != self.hasnfo or oldhastbn != self.hastbn
888 895
889 896 def specifyEpisode(self, season, episode):
890 897
@@ -1131,11 +1138,9 @@ def createMetaFiles(self, force=False):
1131 1138 if sickbeard.CREATE_METADATA != True:
1132 1139 return
1133 1140
1134   - self.checkForMetaFiles()
1135   -
1136   - epsToWrite = [self] + self.relatedEps
  1141 + shouldSave = self.checkForMetaFiles()
1137 1142
1138   - shouldSave = False
  1143 + epsToWrite = [self] + self.relatedEps
1139 1144
1140 1145 try:
1141 1146 t = tvdb_api.Tvdb(actors=True,
@@ -1369,7 +1374,7 @@ def fullPath (self):
1369 1374 else:
1370 1375 return os.path.join(self.show.location, self.location)
1371 1376
1372   - def prettyName (self):
  1377 + def prettyName (self, naming_show_name=None, naming_ep_type=None, naming_multi_ep_type=None):
1373 1378
1374 1379 regex = "(.*) \(\d\)"
1375 1380
@@ -1404,14 +1409,32 @@ def prettyName (self):
1404 1409 for relEp in self.relatedEps:
1405 1410 goodName += " & " + relEp.name
1406 1411
1407   - goodEpString = "x%02i" % int(self.episode)
  1412 + if naming_show_name == None:
  1413 + naming_show_name = sickbeard.NAMING_SHOW_NAME
  1414 +
  1415 + if naming_ep_type == None:
  1416 + naming_ep_type = sickbeard.NAMING_EP_TYPE
  1417 +
  1418 + if naming_multi_ep_type == None:
  1419 + naming_multi_ep_type = sickbeard.NAMING_MULTI_EP_TYPE
  1420 +
  1421 + goodEpString = config.naming_ep_type[naming_ep_type] % {'seasonnumber': self.season, 'episodenumber': self.episode}
  1422 +
1408 1423 for relEp in self.relatedEps:
1409   - goodEpString += "x%02i" % int(relEp.episode)
  1424 + goodEpString += config.naming_multi_ep_type[naming_multi_ep_type][naming_ep_type] % {'seasonnumber': relEp.season, 'episodenumber': relEp.episode}
1410 1425
1411 1426 if goodName != '':
1412 1427 goodName = ' - ' + goodName
1413 1428
1414   - return self.show.name + ' - ' + str(self.season) + goodEpString + goodName
  1429 + finalName = ""
  1430 +
  1431 + if naming_show_name:
  1432 + finalName += self.show.name + " - "
  1433 +
  1434 + finalName += goodEpString
  1435 + finalName += goodName
  1436 +
  1437 + return finalName
1415 1438
1416 1439
1417 1440
26 sickbeard/webserve.py
@@ -214,7 +214,8 @@ def index(self):
214 214 def saveGeneral(self, log_dir=None, web_port=None, web_log=None,
215 215 launch_browser=None, create_metadata=None, web_username=None,
216 216 web_password=None, quality_default=None, season_folders_default=None,
217   - version_notify=None):
  217 + version_notify=None, naming_show_name=None, naming_ep_type=None,
  218 + naming_multi_ep_type=None):
218 219
219 220 results = []
220 221
@@ -243,6 +244,11 @@ def saveGeneral(self, log_dir=None, web_port=None, web_log=None,
243 244 else:
244 245 version_notify = 0
245 246
  247 + if naming_show_name == "on":
  248 + naming_show_name = 1
  249 + else:
  250 + naming_show_name = 0
  251 +
246 252 if not config.change_LOG_DIR(log_dir):
247 253 results += ["Unable to create directory " + os.path.normpath(log_dir) + ", log dir not changed."]
248 254
@@ -251,6 +257,10 @@ def saveGeneral(self, log_dir=None, web_port=None, web_log=None,
251 257 sickbeard.SEASON_FOLDERS_DEFAULT = int(season_folders_default)
252 258 sickbeard.QUALITY_DEFAULT = int(quality_default)
253 259
  260 + sickbeard.NAMING_SHOW_NAME = naming_show_name
  261 + sickbeard.NAMING_EP_TYPE = int(naming_ep_type)
  262 + sickbeard.NAMING_MULTI_EP_TYPE = int(naming_multi_ep_type)
  263 +
254 264 sickbeard.WEB_PORT = int(web_port)
255 265 sickbeard.WEB_LOG = web_log
256 266 sickbeard.WEB_USERNAME = web_username
@@ -806,6 +816,12 @@ def displayShow(self, show=None):
806 816 elif sickbeard.showQueueScheduler.action.isBeingUpdated(showObj):
807 817 flash['message'] = 'The information below is in the process of being updated.'
808 818
  819 + elif sickbeard.showQueueScheduler.action.isBeingRefreshed(showObj):
  820 + flash['message'] = 'The episodes below are currently being refreshed from disk'
  821 +
  822 + elif sickbeard.showQueueScheduler.action.isInRefreshQueue(showObj):
  823 + flash['message'] = 'This show is queued to be refreshed.'
  824 +
809 825 elif sickbeard.showQueueScheduler.action.isInUpdateQueue(showObj):
810 826 flash['message'] = 'This show is queued and awaiting an update.'
811 827
@@ -932,7 +948,7 @@ def refreshShow(self, show=None):
932 948 if sickbeard.showQueueScheduler.action.isBeingRefreshed(showObj):
933 949 flash['message'] = 'Refresh is in progress.'
934 950
935   - time.sleep(1)
  951 + time.sleep(3)
936 952
937 953 raise cherrypy.HTTPRedirect("displayShow?show="+str(showObj.tvdbid))
938 954
@@ -955,7 +971,7 @@ def updateShow(self, show=None, force=0):
955 971 flash['error-detail'] = str(e)
956 972
957 973 # just give it some time
958   - time.sleep(1)
  974 + time.sleep(3)
959 975
960 976 raise cherrypy.HTTPRedirect("displayShow?show="+str(showObj.tvdbid))
961 977
@@ -1042,7 +1058,7 @@ def searchEpisode(self, show=None, season=None, episode=None):
1042 1058 if isinstance(epObj, str):
1043 1059 return _genericMessage("Error", epObj)
1044 1060
1045   - tempStr = "Searching for download for " + epObj.prettyName()
  1061 + tempStr = "Searching for download for " + epObj.prettyName(True)
1046 1062 logger.log(tempStr)
1047 1063 outStr += tempStr + "<br />\n"
1048 1064 foundEpisodes = search.findEpisode(epObj)
@@ -1050,7 +1066,7 @@ def searchEpisode(self, show=None, season=None, episode=None):
1050 1066 if len(foundEpisodes) == 0:
1051 1067 message = 'No downloads were found'
1052 1068 flash['error'] = message
1053   - flash['error-detail'] = "Couldn't find a download for <i>%s</i>" % epObj.prettyName()
  1069 + flash['error-detail'] = "Couldn't find a download for <i>%s</i>" % epObj.prettyName(True)
1054 1070 logger.log(message)
1055 1071
1056 1072 else:

0 comments on commit f39e0f8

Please sign in to comment.
Something went wrong with that request. Please try again.