mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-08 11:03:38 +00:00
Fixed language and subtitle issue for new shows.
Subtitle and language opts where ordered backwards causing incorrect values to be set.
This commit is contained in:
parent
60491bff08
commit
9e4ee04f57
1 changed files with 16 additions and 7 deletions
|
@ -31,6 +31,7 @@ from sickbeard import generic_queue
|
||||||
from sickbeard import name_cache
|
from sickbeard import name_cache
|
||||||
from sickbeard.exceptions import ex
|
from sickbeard.exceptions import ex
|
||||||
|
|
||||||
|
|
||||||
class ShowQueue(generic_queue.GenericQueue):
|
class ShowQueue(generic_queue.GenericQueue):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
generic_queue.GenericQueue.__init__(self)
|
generic_queue.GenericQueue.__init__(self)
|
||||||
|
@ -132,7 +133,7 @@ class ShowQueue(generic_queue.GenericQueue):
|
||||||
return queueItemObj
|
return queueItemObj
|
||||||
|
|
||||||
def addShow(self, indexer, indexer_id, showDir, default_status=None, quality=None, flatten_folders=None,
|
def addShow(self, indexer, indexer_id, showDir, default_status=None, quality=None, flatten_folders=None,
|
||||||
subtitles=None, lang="en", anime=None, scene=None):
|
lang="en", subtitles=None, anime=None, scene=None):
|
||||||
queueItemObj = QueueItemAdd(indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang,
|
queueItemObj = QueueItemAdd(indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang,
|
||||||
subtitles, anime, scene)
|
subtitles, anime, scene)
|
||||||
|
|
||||||
|
@ -175,7 +176,8 @@ class ShowQueueItem(generic_queue.QueueItem):
|
||||||
self.show = show
|
self.show = show
|
||||||
|
|
||||||
def isInQueue(self):
|
def isInQueue(self):
|
||||||
return self in sickbeard.showQueueScheduler.action.queue + [sickbeard.showQueueScheduler.action.currentItem] #@UndefinedVariable
|
return self in sickbeard.showQueueScheduler.action.queue + [
|
||||||
|
sickbeard.showQueueScheduler.action.currentItem] #@UndefinedVariable
|
||||||
|
|
||||||
def _getName(self):
|
def _getName(self):
|
||||||
return str(self.show.indexerid)
|
return str(self.show.indexerid)
|
||||||
|
@ -189,7 +191,8 @@ class ShowQueueItem(generic_queue.QueueItem):
|
||||||
|
|
||||||
|
|
||||||
class QueueItemAdd(ShowQueueItem):
|
class QueueItemAdd(ShowQueueItem):
|
||||||
def __init__(self, indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang, subtitles, anime, scene):
|
def __init__(self, indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang, subtitles, anime,
|
||||||
|
scene):
|
||||||
|
|
||||||
self.indexer = indexer
|
self.indexer = indexer
|
||||||
self.indexer_id = indexer_id
|
self.indexer_id = indexer_id
|
||||||
|
@ -248,7 +251,9 @@ class QueueItemAdd(ShowQueueItem):
|
||||||
|
|
||||||
# this usually only happens if they have an NFO in their show dir which gave us a Indexer ID that has no proper english version of the show
|
# this usually only happens if they have an NFO in their show dir which gave us a Indexer ID that has no proper english version of the show
|
||||||
if getattr(s, 'seriesname', None) is None:
|
if getattr(s, 'seriesname', None) is None:
|
||||||
logger.log(u"Show in " + self.showDir + " has no name on " + str(sickbeard.indexerApi(self.indexer).name) + ", probably the wrong language used to search with.", logger.ERROR)
|
logger.log(u"Show in " + self.showDir + " has no name on " + str(
|
||||||
|
sickbeard.indexerApi(self.indexer).name) + ", probably the wrong language used to search with.",
|
||||||
|
logger.ERROR)
|
||||||
ui.notifications.error("Unable to add show",
|
ui.notifications.error("Unable to add show",
|
||||||
"Show in " + self.showDir + " has no name on " + str(sickbeard.indexerApi(
|
"Show in " + self.showDir + " has no name on " + str(sickbeard.indexerApi(
|
||||||
self.indexer).name) + ", probably the wrong language. Delete .nfo and add manually in the correct language.")
|
self.indexer).name) + ", probably the wrong language. Delete .nfo and add manually in the correct language.")
|
||||||
|
@ -256,14 +261,16 @@ class QueueItemAdd(ShowQueueItem):
|
||||||
return
|
return
|
||||||
# if the show has no episodes/seasons
|
# if the show has no episodes/seasons
|
||||||
if not s:
|
if not s:
|
||||||
logger.log(u"Show " + str(s['seriesname']) + " is on " + str(sickbeard.indexerApi(self.indexer).name) + " but contains no season/episode data.", logger.ERROR)
|
logger.log(u"Show " + str(s['seriesname']) + " is on " + str(
|
||||||
|
sickbeard.indexerApi(self.indexer).name) + " but contains no season/episode data.", logger.ERROR)
|
||||||
ui.notifications.error("Unable to add show",
|
ui.notifications.error("Unable to add show",
|
||||||
"Show " + str(s['seriesname']) + " is on " + str(sickbeard.indexerApi(
|
"Show " + str(s['seriesname']) + " is on " + str(sickbeard.indexerApi(
|
||||||
self.indexer).name) + " but contains no season/episode data.")
|
self.indexer).name) + " but contains no season/episode data.")
|
||||||
self._finishEarly()
|
self._finishEarly()
|
||||||
return
|
return
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(u"Unable to find show ID:" + str(self.indexer_id) + " on Indexer: " + str(sickbeard.indexerApi(self.indexer).name), logger.ERROR)
|
logger.log(u"Unable to find show ID:" + str(self.indexer_id) + " on Indexer: " + str(
|
||||||
|
sickbeard.indexerApi(self.indexer).name), logger.ERROR)
|
||||||
ui.notifications.error("Unable to add show",
|
ui.notifications.error("Unable to add show",
|
||||||
"Unable to look up the show in " + self.showDir + " on " + str(sickbeard.indexerApi(
|
"Unable to look up the show in " + self.showDir + " on " + str(sickbeard.indexerApi(
|
||||||
self.indexer).name) + " using ID " + str(
|
self.indexer).name) + " using ID " + str(
|
||||||
|
@ -385,7 +392,8 @@ class QueueItemAdd(ShowQueueItem):
|
||||||
sickbeard.scene_numbering.xem_refresh(self.show.indexerid, self.show.indexer, force=True)
|
sickbeard.scene_numbering.xem_refresh(self.show.indexerid, self.show.indexer, force=True)
|
||||||
|
|
||||||
# check if show has XEM mapping so we can determin if searches should go by scene numbering or indexer numbering.
|
# check if show has XEM mapping so we can determin if searches should go by scene numbering or indexer numbering.
|
||||||
if not self.scene and sickbeard.scene_numbering.get_xem_numbering_for_show(self.show.indexerid, self.show.indexer):
|
if not self.scene and sickbeard.scene_numbering.get_xem_numbering_for_show(self.show.indexerid,
|
||||||
|
self.show.indexer):
|
||||||
self.show.scene = 1
|
self.show.scene = 1
|
||||||
|
|
||||||
self.finish()
|
self.finish()
|
||||||
|
@ -555,6 +563,7 @@ class QueueItemUpdate(ShowQueueItem):
|
||||||
|
|
||||||
sickbeard.showQueueScheduler.action.refreshShow(self.show, self.force)
|
sickbeard.showQueueScheduler.action.refreshShow(self.show, self.force)
|
||||||
|
|
||||||
|
|
||||||
class QueueItemForceUpdate(QueueItemUpdate):
|
class QueueItemForceUpdate(QueueItemUpdate):
|
||||||
def __init__(self, show=None):
|
def __init__(self, show=None):
|
||||||
ShowQueueItem.__init__(self, ShowQueueActions.FORCEUPDATE, show)
|
ShowQueueItem.__init__(self, ShowQueueActions.FORCEUPDATE, show)
|
||||||
|
|
Loading…
Reference in a new issue