diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index 08c64a70..eae6cd33 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -97,6 +97,9 @@ class NameParser(object): return None for (cur_regex_name, cur_regex) in self.compiled_regexes: + + time.sleep(0.05) + match = cur_regex.match(name) if not match: diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py index 26b65c1f..37f63db2 100644 --- a/sickbeard/providers/btn.py +++ b/sickbeard/providers/btn.py @@ -337,6 +337,8 @@ class BTNCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index 605c51c5..30fca6f5 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -278,6 +278,8 @@ class GenericProvider: for ep_obj in searchItems: for item in searchItems[ep_obj]: + time.sleep(0.05) + (title, url) = self._get_title_and_url(item) quality = self.getQuality(item) diff --git a/sickbeard/providers/hdbits.py b/sickbeard/providers/hdbits.py index 492c2f41..b183f97d 100644 --- a/sickbeard/providers/hdbits.py +++ b/sickbeard/providers/hdbits.py @@ -226,6 +226,8 @@ class HDBitsCache(tvcache.TVCache): if ci is not None: ql.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index b4e5baee..df02840f 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -361,6 +361,8 @@ class HDTorrentsCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index c4835414..33995a9d 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -306,6 +306,8 @@ class IPTorrentsCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index a245dde1..0dcfcecc 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -436,6 +436,8 @@ class KATCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/newznab.py b/sickbeard/providers/newznab.py index bb9041d4..5d18eef5 100644 --- a/sickbeard/providers/newznab.py +++ b/sickbeard/providers/newznab.py @@ -17,11 +17,9 @@ # along with Sick Beard. If not, see . import urllib -import email.utils +import time import datetime -import re import os -import copy try: import xml.etree.cElementTree as etree @@ -274,7 +272,6 @@ class NewznabCache(tvcache.TVCache): def _checkAuth(self, data): return self.provider._checkAuthFromData(data) - def updateCache(self): if not self.shouldUpdate(): return @@ -300,6 +297,8 @@ class NewznabCache(tvcache.TVCache): if ci is not None: ql.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index e80c7c28..a702ea74 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -355,6 +355,8 @@ class NextGenCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index 32ff8223..dce922e7 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -328,6 +328,8 @@ class PublicHDCache(tvcache.TVCache): if ci is not None: ql.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index d1072d1e..30224231 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -348,6 +348,8 @@ class SCCCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/speedcd.py b/sickbeard/providers/speedcd.py index d3f3764d..c3a0e227 100644 --- a/sickbeard/providers/speedcd.py +++ b/sickbeard/providers/speedcd.py @@ -284,6 +284,8 @@ class SpeedCDCache(tvcache.TVCache): if ci is not None: ql.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(ql) diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index b551fe63..c0eef022 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -417,6 +417,8 @@ class ThePirateBayCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index 3d163aaa..6560b110 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -309,6 +309,8 @@ class TorrentDayCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index d05c4a8e..5c5914e6 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -307,6 +307,8 @@ class TorrentLeechCache(tvcache.TVCache): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) diff --git a/sickbeard/scheduler.py b/sickbeard/scheduler.py index 56b980fc..af279c97 100644 --- a/sickbeard/scheduler.py +++ b/sickbeard/scheduler.py @@ -61,7 +61,7 @@ class Scheduler: def runAction(self): while True: - time.sleep(1) + currentTime = datetime.datetime.now() if currentTime - self.lastRun > self.cycleTime: @@ -79,3 +79,5 @@ class Scheduler: self.abort = False self.thread = None return + + time.sleep(1) \ No newline at end of file diff --git a/sickbeard/search_queue.py b/sickbeard/search_queue.py index ae6e09df..302758cc 100644 --- a/sickbeard/search_queue.py +++ b/sickbeard/search_queue.py @@ -18,7 +18,7 @@ from __future__ import with_statement -import datetime +import time import traceback import threading @@ -79,8 +79,8 @@ class SearchQueue(generic_queue.GenericQueue): for result in item.results: # just use the first result for now logger.log(u"Downloading " + result.name + " from " + result.provider.name) - status = search.snatchEpisode(result) - item.success = status + item.success = search.snatchEpisode(result) + time.sleep(2) generic_queue.QueueItem.finish(item) class ManualSearchQueueItem(generic_queue.QueueItem): diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py index cfc8dc9c..79274f62 100644 --- a/sickbeard/tvcache.py +++ b/sickbeard/tvcache.py @@ -124,6 +124,8 @@ class TVCache(): if ci is not None: cl.append(ci) + time.sleep(0.05) + myDB = self._getDB() myDB.mass_action(cl) @@ -372,6 +374,9 @@ class TVCache(): # for each cache entry for curResult in sqlResults: + + time.sleep(0.05) + # skip non-tv crap (but allow them for Newzbin cause we assume it's filtered well) if self.providerID != 'newzbin' and not show_name_helpers.filterBadReleases(curResult["name"]): continue