diff --git a/gui/slick/images/sickrage.png b/gui/slick/images/sickrage.png index b8375544..35ec830e 100644 Binary files a/gui/slick/images/sickrage.png and b/gui/slick/images/sickrage.png differ diff --git a/sickbeard/dailysearcher.py b/sickbeard/dailysearcher.py index 0dc8f713..f9b9a8b5 100644 --- a/sickbeard/dailysearcher.py +++ b/sickbeard/dailysearcher.py @@ -45,27 +45,14 @@ class DailySearcher(): # remove names from cache that link back to active shows that we watch sickbeard.name_cache.syncNameCache() - logger.log(u"Updating RSS cache ...") - - origThreadName = threading.currentThread().name - providers = [x for x in sickbeard.providers.sortedProviderList() if x.isActive()] - for curProviderCount, curProvider in enumerate(providers): - threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]" - - try: - curProvider.cache.updateCache() - except exceptions.AuthException, e: - logger.log(u"Authentication error: " + ex(e), logger.ERROR) - continue - - logger.log(u"Checking to see if any shows have wanted episodes available for the last week ...") + logger.log(u"Searching for coming episodes and 1 weeks worth of previously WANTED episodes ...") fromDate = datetime.date.today() - datetime.timedelta(weeks=1) - toDate = datetime.date.today() + datetime.timedelta(days=1) + curDate = datetime.date.today() myDB = db.DBConnection() - sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE status in (?,?) AND airdate >= ? AND airdate < ?", - [common.UNAIRED, common.WANTED, fromDate.toordinal(), toDate.toordinal()]) + sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE status in (?,?) AND airdate >= ? AND airdate <= ?", + [common.UNAIRED, common.WANTED, fromDate.toordinal(), curDate.toordinal()]) todaysEps = {} for sqlEp in sqlResults: @@ -87,6 +74,7 @@ class DailySearcher(): ep.status = common.SKIPPED else: if ep.status == common.UNAIRED: + logger.log(u"New episode " + ep.prettyName() + " airs today, setting status to WANTED") ep.status = common.WANTED ep.saveToDB() @@ -97,13 +85,10 @@ class DailySearcher(): else: todaysEps[show].append(ep) - # reset thread name back to original - threading.currentThread().name = origThreadName - if len(todaysEps): for show in todaysEps: segment = todaysEps[show] dailysearch_queue_item = sickbeard.search_queue.DailySearchQueueItem(show, segment) sickbeard.searchQueueScheduler.action.add_item(dailysearch_queue_item) #@UndefinedVariable else: - logger.log(u"Could not find any wanted show episodes going back 1 week at this current time ...") \ No newline at end of file + logger.log(u"Could not find any needed episodes to search for ...") \ No newline at end of file diff --git a/sickbeard/processTV.py b/sickbeard/processTV.py index d1946b43..e4a86375 100644 --- a/sickbeard/processTV.py +++ b/sickbeard/processTV.py @@ -179,6 +179,10 @@ def validateDir(path, dirName, nzbNameOriginal, failed): process_failed(os.path.join(path, dirName), nzbNameOriginal) return False + if helpers.is_hidden_folder(dirName): + returnStr += logHelper(u"Ignoring hidden folder: " + dirName, logger.DEBUG) + return False + # make sure the dir isn't inside a show dir myDB = db.DBConnection() sqlResults = myDB.select("SELECT * FROM tv_shows") @@ -229,7 +233,6 @@ def validateDir(path, dirName, nzbNameOriginal, failed): return False - def unRAR(path, rarFiles, force): global process_result, returnStr diff --git a/sickbeard/search.py b/sickbeard/search.py index f4fcc8e6..af7d8b05 100644 --- a/sickbeard/search.py +++ b/sickbeard/search.py @@ -328,6 +328,8 @@ def searchForNeededEpisodes(episodes): threading.currentThread().name = origThreadName + " :: [" + curProvider.name + "]" try: + logger.log(u"Updating RSS cache ...") + curProvider.cache.updateCache() logger.log(u"Searching RSS cache ...") curFoundResults = curProvider.searchRSS(episodes) except exceptions.AuthException, e: diff --git a/sickbeard/tv.py b/sickbeard/tv.py index a874a0a4..3f3942b4 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -18,15 +18,12 @@ from __future__ import with_statement -import time import os.path import datetime import threading import re import glob -from time import sleep import traceback -import shutil import sickbeard @@ -54,7 +51,6 @@ from common import DOWNLOADED, SNATCHED, SNATCHED_PROPER, SNATCHED_BEST, ARCHIVE UNKNOWN, FAILED from common import NAMING_DUPLICATE, NAMING_EXTEND, NAMING_LIMITED_EXTEND, NAMING_SEPARATED_REPEAT, \ NAMING_LIMITED_EXTEND_E_PREFIXED -from common import cpu_presets class TVShow(object): def __init__(self, indexer, indexerid, lang=""): @@ -858,7 +854,7 @@ class TVShow(object): #Rename dict keys without spaces for DB upsert self.imdb_info = dict( - (k.replace(' ', '_'), f(v) if hasattr(v, 'keys') else v) for k, v in imdb_info.items()) + (k.replace(' ', '_'), k(v) if hasattr(v, 'keys') else v) for k, v in imdb_info.items()) logger.log(str(self.indexerid) + u": Obtained info from IMDb ->" + str(self.imdb_info), logger.DEBUG) def nextEpisode(self): @@ -866,10 +862,10 @@ class TVShow(object): logger.log(str(self.indexerid) + ": Finding the episode which airs next", logger.DEBUG) myDB = db.DBConnection() - innerQuery = "SELECT airdate FROM tv_episodes WHERE showid = ? AND airdate >= ? AND status = ? ORDER BY airdate ASC LIMIT 1" - innerParams = [self.indexerid, datetime.date.today().toordinal(), UNAIRED] - query = "SELECT * FROM tv_episodes WHERE showid = ? AND airdate >= ? AND airdate <= (" + innerQuery + ") and status = ?" - params = [self.indexerid, datetime.date.today().toordinal()] + innerParams + [UNAIRED] + innerQuery = "SELECT airdate FROM tv_episodes WHERE showid = ? AND airdate >= ? AND status in (?,?) ORDER BY airdate ASC LIMIT 1" + innerParams = [self.indexerid, datetime.date.today().toordinal(), UNAIRED, WANTED] + query = "SELECT * FROM tv_episodes WHERE showid = ? AND airdate >= ? AND airdate <= (" + innerQuery + ") and status in (?,?)" + params = [self.indexerid, datetime.date.today().toordinal()] + innerParams + [UNAIRED, WANTED] sqlResults = myDB.select(query, params) if sqlResults == None or len(sqlResults) == 0: