From 51ff0413892d7b1841668128d8edb59776098419 Mon Sep 17 00:00:00 2001 From: echel0n Date: Tue, 13 May 2014 21:14:54 -0700 Subject: [PATCH] Fix for writing new NFO files for updating Indexer info, prevents constant writing on refreshes of shows --- sickbeard/show_queue.py | 12 +++++------- sickbeard/webserve.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sickbeard/show_queue.py b/sickbeard/show_queue.py index 74ab73fb..437108ad 100644 --- a/sickbeard/show_queue.py +++ b/sickbeard/show_queue.py @@ -144,9 +144,9 @@ class ShowQueue(generic_queue.GenericQueue): return queueItemObj def addShow(self, indexer, indexer_id, showDir, default_status=None, quality=None, flatten_folders=None, - subtitles=None, lang="en", refresh=False): + subtitles=None, lang="en"): queueItemObj = QueueItemAdd(indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang, - subtitles, refresh) + subtitles) self.add_item(queueItemObj) @@ -203,8 +203,7 @@ class ShowQueueItem(generic_queue.QueueItem): class QueueItemAdd(ShowQueueItem): - def __init__(self, indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang, subtitles, - refresh): + def __init__(self, indexer, indexer_id, showDir, default_status, quality, flatten_folders, lang, subtitles): self.indexer = indexer self.indexer_id = indexer_id @@ -214,7 +213,6 @@ class QueueItemAdd(ShowQueueItem): self.flatten_folders = flatten_folders self.lang = lang self.subtitles = subtitles - self.refresh = refresh self.show = None @@ -380,7 +378,7 @@ class QueueItemAdd(ShowQueueItem): logger.log(u"Launching backlog for this show since its episodes are WANTED") sickbeard.backlogSearchScheduler.action.searchBacklog([self.show]) #@UndefinedVariable - self.show.writeMetadata(force=self.refresh) + self.show.writeMetadata(force=True) self.show.populateCache() self.show.flushEpisodes() @@ -410,7 +408,7 @@ class QueueItemRefresh(ShowQueueItem): logger.log(u"Performing refresh on " + self.show.name) self.show.refreshDir() - self.show.writeMetadata(force=True) + self.show.writeMetadata() self.show.populateCache() self.inProgress = False diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index a20520a3..ea589abe 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -2348,7 +2348,7 @@ class NewHomeAddShows: sickbeard.STATUS_DEFAULT, sickbeard.QUALITY_DEFAULT, sickbeard.FLATTEN_FOLDERS_DEFAULT, - sickbeard.SUBTITLES_DEFAULT, refresh=True) + sickbeard.SUBTITLES_DEFAULT) num_added += 1 if num_added: