Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions data/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ background-color:#FFB0B0;
padding:2px;
}

tr.snatched,span.snatched {
background-color:#C2E8BC;
padding:2px;
}

a,a.remove {
color:#000;
}
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -414,4 +419,4 @@ span.false {
}
span.true {
color: #669966; /* green */
}
}
6 changes: 5 additions & 1 deletion sickbeard/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
33 changes: 17 additions & 16 deletions sickbeard/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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:

Expand Down