From f2fb9076ad585191b9de4b9eb10299d5d7f342a5 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 5 Apr 2014 04:34:49 -0700 Subject: [PATCH 1/2] Fixes issue #25 --- sickbeard/providers/dtt.py | 2 +- sickbeard/providers/ezrss.py | 2 +- sickbeard/providers/hdtorrents.py | 2 +- sickbeard/providers/iptorrents.py | 2 +- sickbeard/providers/kat.py | 2 +- sickbeard/providers/newzbin.py | 2 +- sickbeard/providers/nextgen.py | 2 +- sickbeard/providers/nyaatorrents.py | 2 +- sickbeard/providers/nzbs_org_old.py | 2 +- sickbeard/providers/nzbsrus.py | 2 +- sickbeard/providers/publichd.py | 2 +- sickbeard/providers/scc.py | 2 +- sickbeard/providers/thepiratebay.py | 2 +- sickbeard/providers/torrentday.py | 2 +- sickbeard/providers/torrentleech.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sickbeard/providers/dtt.py b/sickbeard/providers/dtt.py index fe7c003d..4e4d1fe1 100644 --- a/sickbeard/providers/dtt.py +++ b/sickbeard/providers/dtt.py @@ -69,7 +69,7 @@ class DTTProvider(generic.TorrentProvider): def _get_episode_search_strings(self, episode): return self._get_season_search_strings(episode.show, episode.season) - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): # show_id = self._dtt_show_id(show.name) diff --git a/sickbeard/providers/ezrss.py b/sickbeard/providers/ezrss.py index fe6a2815..02ce1f63 100644 --- a/sickbeard/providers/ezrss.py +++ b/sickbeard/providers/ezrss.py @@ -101,7 +101,7 @@ class EZRSSProvider(generic.TorrentProvider): return [params] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): params = {"mode": "rss"} diff --git a/sickbeard/providers/hdtorrents.py b/sickbeard/providers/hdtorrents.py index 41056a5f..ffd5c924 100644 --- a/sickbeard/providers/hdtorrents.py +++ b/sickbeard/providers/hdtorrents.py @@ -156,7 +156,7 @@ class HDTorrentsProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 005695db..873d05a7 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -137,7 +137,7 @@ class IPTorrentsProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index 5e4069a3..730793dc 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -219,7 +219,7 @@ class KATProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/newzbin.py b/sickbeard/providers/newzbin.py index 6670ad78..ce9f452b 100644 --- a/sickbeard/providers/newzbin.py +++ b/sickbeard/providers/newzbin.py @@ -278,7 +278,7 @@ class NewzbinProvider(generic.NZBProvider): searchStr = " OR ".join(['^"' + x + ' - ' + str(ep_obj.airdate) + '"' for x in nameList]) return [searchStr] - def _doSearch(self, searchStr, show=None): + def _doSearch(self, searchStr, show=None, age=None): data = self._getRSSData(searchStr.encode('utf-8')) diff --git a/sickbeard/providers/nextgen.py b/sickbeard/providers/nextgen.py index 8a7f2888..234b088c 100644 --- a/sickbeard/providers/nextgen.py +++ b/sickbeard/providers/nextgen.py @@ -174,7 +174,7 @@ class NextGenProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/nyaatorrents.py b/sickbeard/providers/nyaatorrents.py index 7cc716fe..d40f9ad5 100644 --- a/sickbeard/providers/nyaatorrents.py +++ b/sickbeard/providers/nyaatorrents.py @@ -77,7 +77,7 @@ class NyaaProvider(generic.TorrentProvider): def _get_episode_search_strings(self, ep_obj): return self._get_season_search_strings(ep_obj.show, ep_obj.season) - def _doSearch(self, search_string, show=None): + def _doSearch(self, search_string, show=None, age=None): params = {"term": search_string.encode('utf-8'), "sort": '2', #Sort Descending By Seeders diff --git a/sickbeard/providers/nzbs_org_old.py b/sickbeard/providers/nzbs_org_old.py index a53f3373..7ef226e0 100644 --- a/sickbeard/providers/nzbs_org_old.py +++ b/sickbeard/providers/nzbs_org_old.py @@ -59,7 +59,7 @@ class NZBsProvider(generic.NZBProvider): def _get_episode_search_strings(self, ep_obj): return ['^' + x for x in show_name_helpers.makeSceneSearchString(ep_obj)] - def _doSearch(self, curString, show=None): + def _doSearch(self, curString, show=None, age=None): curString = curString.replace('.', ' ') diff --git a/sickbeard/providers/nzbsrus.py b/sickbeard/providers/nzbsrus.py index b02d581e..48a7d1ad 100644 --- a/sickbeard/providers/nzbsrus.py +++ b/sickbeard/providers/nzbsrus.py @@ -49,7 +49,7 @@ class NZBsRUSProvider(generic.NZBProvider): def _get_episode_search_strings(self, ep_obj): return ['^' + x for x in show_name_helpers.makeSceneSearchString(ep_obj)] - def _doSearch(self, search, show=None): + def _doSearch(self, search, show=None, age=None): params = {'uid': sickbeard.NZBSRUS_UID, 'key': sickbeard.NZBSRUS_HASH, 'xml': 1, diff --git a/sickbeard/providers/publichd.py b/sickbeard/providers/publichd.py index a81c4e8d..0d342ae0 100644 --- a/sickbeard/providers/publichd.py +++ b/sickbeard/providers/publichd.py @@ -124,7 +124,7 @@ class PublicHDProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/scc.py b/sickbeard/providers/scc.py index 4f5f896b..c0400053 100644 --- a/sickbeard/providers/scc.py +++ b/sickbeard/providers/scc.py @@ -141,7 +141,7 @@ class SCCProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 26fe5b07..842ec406 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -226,7 +226,7 @@ class ThePirateBayProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/torrentday.py b/sickbeard/providers/torrentday.py index 565a1872..c8199b95 100644 --- a/sickbeard/providers/torrentday.py +++ b/sickbeard/providers/torrentday.py @@ -159,7 +159,7 @@ class TorrentDayProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} diff --git a/sickbeard/providers/torrentleech.py b/sickbeard/providers/torrentleech.py index b1d2c8db..1b3c5532 100644 --- a/sickbeard/providers/torrentleech.py +++ b/sickbeard/providers/torrentleech.py @@ -140,7 +140,7 @@ class TorrentLeechProvider(generic.TorrentProvider): return [search_string] - def _doSearch(self, search_params, show=None): + def _doSearch(self, search_params, show=None, age=None): results = [] items = {'Season': [], 'Episode': [], 'RSS': []} From 9ab143dde7aeaa45ba109ecfbb7b548cc495c939 Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 21 Apr 2014 19:33:48 -0700 Subject: [PATCH 2/2] Testing fix for unique index error on xem_numbering table in cache database --- autoProcessTV/mediaToSickbeard.py | 2 ++ sickbeard/databases/cache_db.py | 7 ++++++- sickbeard/webserve.py | 3 +-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/autoProcessTV/mediaToSickbeard.py b/autoProcessTV/mediaToSickbeard.py index d57e5f1a..e1ef6979 100644 --- a/autoProcessTV/mediaToSickbeard.py +++ b/autoProcessTV/mediaToSickbeard.py @@ -7,6 +7,8 @@ import ConfigParser import logging #Needed for importing logging & requests module +from sickbeard.exceptions import ex + sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0] sys.path.append(os.path.join( sickbeardPath, 'lib')) sys.path.append(sickbeardPath) diff --git a/sickbeard/databases/cache_db.py b/sickbeard/databases/cache_db.py index b0938d9b..a952d7fb 100644 --- a/sickbeard/databases/cache_db.py +++ b/sickbeard/databases/cache_db.py @@ -68,8 +68,10 @@ class AddXemNumbering(AddNetworkTimezones): def execute(self): self.connection.action( - "CREATE TABLE xem_numbering (indexer TEXT, indexer_id INTEGER, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER, PRIMARY KEY (indexer, indexer_id, season, episode))") + "CREATE TABLE xem_numbering (indexer TEXT, indexer_id INTEGER PRIMARY KEY, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER)") + self.connection.action( + "CREATE UNIQUE INDEX idx_xem_numbering_indexer_id ON xem_numbering (indexer_id);") class AddXemRefresh(AddXemNumbering): def test(self): @@ -79,6 +81,9 @@ class AddXemRefresh(AddXemNumbering): self.connection.action( "CREATE TABLE xem_refresh (indexer TEXT, indexer_id INTEGER PRIMARY KEY, last_refreshed INTEGER)") + self.connection.action( + "CREATE INDEX idx_xem_refresh_indexer_id ON xem_refresh (indexer_id);") + class ConvertSceneExceptionsToIndexerID(AddXemRefresh): def test(self): diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 06d24fb7..cb7d46b4 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -82,8 +82,7 @@ from sickbeard import browser class PageTemplate(Template): def __init__(self, *args, **KWs): - KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/", - KWs['file']) + KWs['file'] = os.path.join(sickbeard.PROG_DIR, "gui/" + sickbeard.GUI_NAME + "/interfaces/default/",KWs['file']) super(PageTemplate, self).__init__(*args, **KWs) self.sbRoot = sickbeard.WEB_ROOT self.sbHttpPort = sickbeard.WEB_PORT