From e171aa1c1098e45a89ecf15ed84b15b79ca5af68 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 2 Apr 2014 07:23:17 -0700 Subject: [PATCH] Conditional check bugfixes --- lib/tvdb_api/tvdb_cache.py | 2 +- lib/tvrage_api/tvrage_api.py | 2 +- lib/tvrage_api/tvrage_cache.py | 2 +- sickbeard/__init__.py | 4 ++-- sickbeard/providers/btn.py | 4 ++-- sickbeard/webapi.py | 6 +++--- sickbeard/webserve.py | 3 +-- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/tvdb_api/tvdb_cache.py b/lib/tvdb_api/tvdb_cache.py index 07b5541a..50c198d4 100644 --- a/lib/tvdb_api/tvdb_cache.py +++ b/lib/tvdb_api/tvdb_cache.py @@ -129,7 +129,7 @@ class CacheHandler(urllib2.BaseHandler): def default_open(self, request): """Handles GET requests, if the response is cached it returns it """ - if request.get_method() is not "GET": + if request.get_method() != "GET": return None # let the next handler try to handle the request if exists_in_cache( diff --git a/lib/tvrage_api/tvrage_api.py b/lib/tvrage_api/tvrage_api.py index 1e7128d2..9506ad5d 100644 --- a/lib/tvrage_api/tvrage_api.py +++ b/lib/tvrage_api/tvrage_api.py @@ -433,7 +433,7 @@ class TVRage: elm.tag = robj.sub(lambda m: reDict[m.group(0)], elm.tag) if elm.tag in 'firstaired' and elm.text: - if elm.text is "0000-00-00": + if elm.text == "0000-00-00": elm.text = str(dt.date.fromordinal(1)) try: #month = strptime(match.group('air_month')[:3],'%b').tm_mon diff --git a/lib/tvrage_api/tvrage_cache.py b/lib/tvrage_api/tvrage_cache.py index 11b0a350..9f58ff86 100644 --- a/lib/tvrage_api/tvrage_cache.py +++ b/lib/tvrage_api/tvrage_cache.py @@ -129,7 +129,7 @@ class CacheHandler(urllib2.BaseHandler): def default_open(self, request): """Handles GET requests, if the response is cached it returns it """ - if request.get_method() is not "GET": + if request.get_method() != "GET": return None # let the next handler try to handle the request if exists_in_cache( diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index e843d56b..e9cc6595 100644 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -29,10 +29,10 @@ import urllib from threading import Lock # apparently py2exe won't build these unless they're imported somewhere -from sickbeard import providers, metadata +from sickbeard import providers, metadata, config from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, publichd, iptorrents, \ omgwtfnzbs, scc, hdtorrents, torrentday, hdbits, nextgen -from sickbeard.config import CheckSection, check_setting_int, check_setting_str, ConfigMigrator +from sickbeard.config import CheckSection, check_setting_int, check_setting_str, ConfigMigrator, naming_ep_type from sickbeard import searchCurrent, searchBacklog, showUpdater, versionChecker, properFinder, autoPostProcesser, \ subtitles, traktWatchListChecker from sickbeard import helpers, db, exceptions, show_queue, search_queue, scheduler, show_name_helpers diff --git a/sickbeard/providers/btn.py b/sickbeard/providers/btn.py index effc58ee..103b2cf9 100644 --- a/sickbeard/providers/btn.py +++ b/sickbeard/providers/btn.py @@ -203,9 +203,9 @@ class BTNProvider(generic.TorrentProvider): current_params = {} - if show.indexer is 1: + if show.indexer == 1: current_params['tvdb'] = show.indexerid - elif show.indexer is 2: + elif show.indexer == 2: current_params['tvrage'] = show.indexerid else: # Search by name if we don't have tvdb or tvrage id diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index c1d5a1f9..9d0636d3 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -2413,7 +2413,7 @@ class CMD_ShowStats(ApiCall): episodes_stats["downloaded"] = {} # truning codes into strings for statusCode in episode_qualities_counts_download: - if statusCode is "total": + if statusCode == "total": episodes_stats["downloaded"]["total"] = episode_qualities_counts_download[statusCode] continue status, quality = Quality.splitCompositeStatus(int(statusCode)) @@ -2424,7 +2424,7 @@ class CMD_ShowStats(ApiCall): # truning codes into strings # and combining proper and normal for statusCode in episode_qualities_counts_snatch: - if statusCode is "total": + if statusCode == "total": episodes_stats["snatched"]["total"] = episode_qualities_counts_snatch[statusCode] continue status, quality = Quality.splitCompositeStatus(int(statusCode)) @@ -2436,7 +2436,7 @@ class CMD_ShowStats(ApiCall): #episodes_stats["total"] = {} for statusCode in episode_status_counts_total: - if statusCode is "total": + if statusCode == "total": episodes_stats["total"] = episode_status_counts_total[statusCode] continue status, quality = Quality.splitCompositeStatus(int(statusCode)) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 9cae9ff7..6b944117 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1904,8 +1904,7 @@ class HomePostProcess: return _munge(t) @cherrypy.expose - def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, - force=None, is_priority=None, failed="0", type="auto"): + def processEpisode(self, dir=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None, is_priority=None, failed="0", type="auto"): if failed == "0": failed = False