Skip to content

Loading…

Adds highlighting for snatched shows: http://code.google.com/p/sickbeard/issues/detail?id=1074 #350

Closed
wants to merge 2 commits into from

1 participant

@ghost
Pinched Loaf added some commits
Pinched Loaf Adds highlighting for snatched shows: http://code.google.com/p/sickbe…
…ard/issues/detail?id=1074

* Refactored tv.TVShow.getOverview
* Found bug(?) in common.py; see comments.
1b5b01d
Pinched Loaf Fixed typo. 07419e6
@ghost Unknown referenced this pull request
Closed

Add color for snatched #528

@midgetspy
Owner

Merged, thanks. This got lost in the noise - sorry.

@midgetspy midgetspy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 3, 2012
  1. Adds highlighting for snatched shows: http://code.google.com/p/sickbe…

    Pinched Loaf committed
    …ard/issues/detail?id=1074
    
    * Refactored tv.TVShow.getOverview
    * Found bug(?) in common.py; see comments.
  2. Fixed typo.

    Pinched Loaf committed
Showing with 32 additions and 20 deletions.
  1. +8 −3 data/css/default.css
  2. +5 −1 sickbeard/common.py
  3. +17 −16 sickbeard/tv.py
  4. +2 −0 sickbeard/webserve.py
View
11 data/css/default.css
@@ -234,6 +234,11 @@ background-color:#FFB0B0;
padding:2px;
}
+tr.snatched,span.snatched {
+background-color:#C2E8BC;
+padding:2px;
+}
+
a,a.remove {
color:#000;
}
@@ -349,8 +354,8 @@ div#addShowPortal button div.button img{ position: absolute; display: block; to
div#addShowPortal button .buttontext { position: relative; display: block; padding: 0.1em 0.4em 0.1em 4.4em; text-align: left; }
#rootDirs, #rootDirsControls { width: 50%; min-width: 400px; }
-
-td.tvShow { font-weight: bold; }
+
+td.tvShow { font-weight: bold; }
td.tvShow a {text-decoration: none; font-size: 1.2em; }
td.tvShow:hover { background-color: #cfcfcf !important; cursor: pointer; }
@@ -414,4 +419,4 @@ span.false {
}
span.true {
color: #669966; /* green */
-}
+}
View
6 sickbeard/common.py
@@ -225,11 +225,15 @@ class Overview:
GOOD = 4
SKIPPED = SKIPPED # 5
+ # For both snatched statuses. BUG: SNATCHED/QUAL have same value and break dict.
+ SNATCHED_PROPER = SNATCHED_PROPER
+
overviewStrings = {SKIPPED: "skipped",
WANTED: "wanted",
QUAL: "qual",
GOOD: "good",
- UNAIRED: "unaired"}
+ UNAIRED: "unaired",
+ SNATCHED_PROPER: "snatched"}
# Get our xml namespaces correct for lxml
XML_NSMAP = {'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
View
33 sickbeard/tv.py
@@ -904,25 +904,26 @@ def getOverview(self, epStatus):
return Overview.SKIPPED
elif epStatus == ARCHIVED:
return Overview.GOOD
- elif epStatus in Quality.DOWNLOADED + Quality.SNATCHED + Quality.SNATCHED_PROPER:
- anyQualities, bestQualities = Quality.splitQuality(self.quality) #@UnusedVariable
- if bestQualities:
- maxBestQuality = max(bestQualities)
- else:
- maxBestQuality = None
+ anyQualities, bestQualities = Quality.splitQuality(self.quality) #@UnusedVariable
+ if bestQualities:
+ maxBestQuality = max(bestQualities)
+ else:
+ maxBestQuality = None
- epStatus, curQuality = Quality.splitCompositeStatus(epStatus)
+ epStatus, curQuality = Quality.splitCompositeStatus(epStatus)
- # if they don't want re-downloads then we call it good if they have anything
- if maxBestQuality == None:
- return Overview.GOOD
- # if they have one but it's not the best they want then mark it as qual
- elif curQuality < maxBestQuality:
- return Overview.QUAL
- # if it's >= maxBestQuality then it's good
- else:
- return Overview.GOOD
+ if epStatus in (SNATCHED, SNATCHED_PROPER) and curQuality == 0:
+ return Overview.SNATCHED_PROPER
+ # if they don't want re-downloads then we call it good if they have anything
+ elif maxBestQuality == None:
+ return Overview.GOOD
+ # if they have one but it's not the best they want then mark it as qual
+ elif curQuality < maxBestQuality:
+ return Overview.QUAL
+ # if it's >= maxBestQuality then it's good
+ else:
+ return Overview.GOOD
def dirty_setter(attr_name):
def wrapper(self, val):
View
2 sickbeard/webserve.py
@@ -331,6 +331,7 @@ def backlogOverview(self):
epCounts[Overview.QUAL] = 0
epCounts[Overview.GOOD] = 0
epCounts[Overview.UNAIRED] = 0
+ epCounts[Overview.SNATCHED_PROPER] = 0
sqlResults = myDB.select("SELECT * FROM tv_episodes WHERE showid = ? ORDER BY season*1000+episode DESC", [curShow.tvdbid])
@@ -2247,6 +2248,7 @@ def displayShow(self, show=None):
epCounts[Overview.QUAL] = 0
epCounts[Overview.GOOD] = 0
epCounts[Overview.UNAIRED] = 0
+ epCounts[Overview.SNATCHED_PROPER] = 0
for curResult in sqlResults:
Something went wrong with that request. Please try again.