From 4dd7692389d9e862f652185b766fde6379ad3107 Mon Sep 17 00:00:00 2001
From: Amadeus <amadeus@myself.com>
Date: Fri, 25 Dec 2015 23:02:48 -0800
Subject: [PATCH] Fixed logging related to TVShow.wantEpisode

---
 sickbeard/nzbSplitter.py              |  4 +---
 sickbeard/tv.py                       | 14 +++++++++-----
 sickbeard/tvcache.py                  |  3 +--
 sickrage/providers/GenericProvider.py |  3 +--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sickbeard/nzbSplitter.py b/sickbeard/nzbSplitter.py
index efacaeed9..9528d4471 100644
--- a/sickbeard/nzbSplitter.py
+++ b/sickbeard/nzbSplitter.py
@@ -205,9 +205,7 @@ def split_result(obj):
         want_ep = True
         for ep_num in parsed_obj.episode_numbers:
             if not obj.extraInfo[0].wantEpisode(season, ep_num, obj.quality):
-                # pylint: disable=no-member
-                logger.log(u"Ignoring result " + new_nzb + " because we don't want an episode that is " +
-                           Quality.qualityStrings[obj.quality], logger.INFO)
+                logger.log(u"Ignoring result: " + new_nzb, logger.DEBUG)
                 want_ep = False
                 break
         if not want_ep:
diff --git a/sickbeard/tv.py b/sickbeard/tv.py
index ca6a11f6a..4bb071446 100644
--- a/sickbeard/tv.py
+++ b/sickbeard/tv.py
@@ -1219,7 +1219,8 @@ class TVShow(object):
                     self.qualitiesToString([quality])), logger.DEBUG)
 
         if quality not in allowed_qualities + preferred_qualities or quality is UNKNOWN:
-            logger.log(u"Don't want this quality, ignoring found episode", logger.DEBUG)
+            logger.log(u"Skipping %s (S%02dE%02d, %s): Don't want this quality, ignoring found episode" %
+                (self.name, season or 0, episode or 0, Quality.qualityStrings[quality]), logger.INFO)
             return False
 
         myDB = db.DBConnection()
@@ -1227,7 +1228,8 @@ class TVShow(object):
                                  [self.indexerid, season, episode])
 
         if not sqlResults or not len(sqlResults):
-            logger.log(u"Unable to find a matching episode in database, ignoring found episode", logger.DEBUG)
+            logger.log(u"Skipping %s (S%02dE%02d, %s): Unable to find a matching episode in database, ignoring found episode" %
+                (self.name, season or 0, episode or 0, Quality.qualityStrings[quality]), logger.INFO)
             return False
 
         epStatus = int(sqlResults[0]["status"])
@@ -1237,14 +1239,15 @@ class TVShow(object):
 
         # if we know we don't want it then just say no
         if epStatus in Quality.ARCHIVED + [UNAIRED, SKIPPED, IGNORED] and not manualSearch:
-            logger.log(u"Existing episode status is unaired/skipped/ignored/archived, ignoring found episode", logger.DEBUG)
+            logger.log(u"Skipping %s (S%02dE%02d, %s): Existing episode status is '%s', ignoring found episode" %
+                (self.name, season or 0, episode or 0, Quality.qualityStrings[quality], epStatus_text), logger.INFO)
             return False
 
         curStatus, curQuality = Quality.splitCompositeStatus(epStatus)
 
         # if it's one of these then we want it as long as it's in our allowed initial qualities
         if epStatus in (WANTED, SKIPPED, UNKNOWN):
-            logger.log(u"Existing episode status is wanted/skipped/unknown, getting found episode", logger.DEBUG)
+            logger.log(u"Existing episode status is '%s', getting found episode" % epStatus_text, logger.DEBUG)
             return True
         elif manualSearch:
             if (downCurQuality and quality >= curQuality) or (not downCurQuality and quality > curQuality):
@@ -1266,7 +1269,8 @@ class TVShow(object):
             logger.log(u"Episode already exists and the found episode has same/lower quality, ignoring found episode",
                        logger.DEBUG)
 
-        logger.log(u"None of the conditions were met, ignoring found episode", logger.DEBUG)
+        logger.log(u"Skipping %s (S%02dE%02d, %s): None of the conditions were met, ignoring found episode" %
+            (self.name, season or 0, episode or 0, Quality.qualityStrings[quality]), logger.INFO)
         return False
 
     def getOverview(self, epStatus):
diff --git a/sickbeard/tvcache.py b/sickbeard/tvcache.py
index eba448699..62585bbfa 100644
--- a/sickbeard/tvcache.py
+++ b/sickbeard/tvcache.py
@@ -356,8 +356,7 @@ class TVCache(object):
 
             # if the show says we want that episode then add it to the list
             if not showObj.wantEpisode(curSeason, curEp, curQuality, manualSearch, downCurQuality):
-                logger.log(u"Skipping " + curResult["name"] + " because we don't want an episode that's " +
-                           Quality.qualityStrings[curQuality], logger.INFO)
+                logger.log(u"Skipping " + curResult["name"], logger.DEBUG)
                 continue
 
             epObj = showObj.getEpisode(curSeason, curEp)
diff --git a/sickrage/providers/GenericProvider.py b/sickrage/providers/GenericProvider.py
index 9ae4ee512..669b51398 100644
--- a/sickrage/providers/GenericProvider.py
+++ b/sickrage/providers/GenericProvider.py
@@ -290,8 +290,7 @@ class GenericProvider(object):  # pylint: disable=too-many-instance-attributes
                     break
 
             if not episode_wanted:
-                logger.log(u'Ignoring result %s because we don\'t want an episode that is %s' % (
-                    title, Quality.qualityStrings[quality]), logger.INFO)
+                logger.log(u'Ignoring result %s.' % (title), logger.DEBUG)
                 continue
 
             logger.log(u'Found result %s at %s' % (title, url), logger.DEBUG)
-- 
GitLab