Permalink
Browse files

Fix renaming: Only need one of the episodes of Multi-Episodes

  • Loading branch information...
1 parent 830b3b1 commit d51c177fc062fced0ac77c998575fece0970cc97 Patrick Vos committed Sep 18, 2012
Showing with 20 additions and 6 deletions.
  1. +11 −3 sickbeard/show_queue.py
  2. +9 −3 sickbeard/webserve.py
View
@@ -337,6 +337,7 @@ def execute(self):
self.inProgress = False
+
class QueueItemRename(ShowQueueItem):
def __init__(self, show=None):
ShowQueueItem.__init__(self, ShowQueueActions.RENAME, show)
@@ -360,9 +361,15 @@ def execute(self):
# Only want to rename if we have a location
if cur_ep_obj.location:
if cur_ep_obj.relatedEps:
- for cur_related_ep in cur_ep_obj.relatedEps:
- if cur_related_ep not in ep_obj_rename_list:
- ep_obj_rename_list.append(cur_ep_obj)
+ # do we have one of multi-episodes in the rename list already
+ have_already = False
+ for cur_related_ep in cur_ep_obj.relatedEps + [cur_ep_obj]:
+ if cur_related_ep in ep_obj_rename_list:
+ have_already = True
+ break
+ if not have_already:
+ ep_obj_rename_list.append(cur_ep_obj)
+
else:
ep_obj_rename_list.append(cur_ep_obj)
@@ -371,6 +378,7 @@ def execute(self):
self.inProgress = False
+
class QueueItemUpdate(ShowQueueItem):
def __init__(self, show=None):
ShowQueueItem.__init__(self, ShowQueueActions.UPDATE, show)
View
@@ -2573,9 +2573,15 @@ def testRename(self, show=None):
# Only want to rename if we have a location
if cur_ep_obj.location:
if cur_ep_obj.relatedEps:
- for cur_related_ep in cur_ep_obj.relatedEps:
- if cur_related_ep not in ep_obj_rename_list:
- ep_obj_rename_list.append(cur_ep_obj)
+ # do we have one of multi-episodes in the rename list already
+ have_already = False
+ for cur_related_ep in cur_ep_obj.relatedEps + [cur_ep_obj]:
+ if cur_related_ep in ep_obj_rename_list:
+ have_already = True
+ break
+ if not have_already:
+ ep_obj_rename_list.append(cur_ep_obj)
+
else:
ep_obj_rename_list.append(cur_ep_obj)

0 comments on commit d51c177

Please sign in to comment.