Skip to content

Commit

Permalink
Merge pull request #544 from thezoggy/dev--qualityChooser_cleanup
Browse files Browse the repository at this point in the history
qualityChooser cleanup
  • Loading branch information
midgetspy committed Dec 4, 2012
2 parents 8e8670d + aa503e3 commit ec26d43
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion data/interfaces/default/home_addExistingShow.tmpl
@@ -1,5 +1,4 @@
#import os.path
#import urllib
#import sickbeard
#from sickbeard.common import *
#set global $title="Existing Show"
Expand All @@ -13,6 +12,7 @@

<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">

<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/addExistingShow.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/rootDirs.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/addShowOptions.js?$sbPID"></script>
Expand Down
7 changes: 3 additions & 4 deletions data/interfaces/default/home_newShow.tmpl
@@ -1,5 +1,4 @@
#import os.path
#import urllib
#import sickbeard
#set global $title="New Show"

Expand All @@ -14,8 +13,8 @@
<script type="text/javascript" src="$sbRoot/js/lib/formwizard.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/newShow.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/addShowOptions.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/addShowOptions.js?$sbPID"></script>

<div id="displayText">aoeu</div>
<br />

Expand All @@ -40,7 +39,7 @@
<b>*</b> This will only affect the language of the retrieved metadata file contents and episode filenames.<br />
This <b>DOES NOT</b> allow Sick Beard to download non-english TV episodes!<br />
<br />
<div id="searchResults" style="max-height: 225px; overflow: auto;"></div>
<div id="searchResults" style="max-height: 225px; overflow: auto;"><br/></div>
#end if
</div>
</fieldset>
Expand Down
11 changes: 4 additions & 7 deletions data/interfaces/default/inc_qualityChooser.tmpl
@@ -1,8 +1,6 @@
#import sickbeard
#from sickbeard.common import Quality, qualityPresets, qualityPresetStrings

<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?$sbPID"></script>

<div class="field-pair">
<label for="qualityPreset" class="nocheck clearfix">
#set $overall_quality = $Quality.combineQualities($anyQualities, $bestQualities)
Expand All @@ -21,11 +19,10 @@
</div>

<div id="customQualityWrapper">

<div id="customQuality">
<div class="component-group-desc">
<p>One of the <b>Initial</b> quality selections must be obtained before Sick Beard will attempt to process the <b>Archive</b> selections.</p>
</div>
<div id="customQuality">
<div class="component-group-desc">
<p>One of the <b>Initial</b> quality selections must be obtained before Sick Beard will attempt to process the <b>Archive</b> selections.</p>
</div>

<div style="padding-right: 40px; text-align: center;" class="float-left">
<h4>Initial</h4>
Expand Down
49 changes: 28 additions & 21 deletions data/js/qualityChooser.js
@@ -1,29 +1,36 @@
$(document).ready(function(){
$(document).ready(function() {
function setFromPresets (preset) {
if (preset == 0) {
$('#customQuality').show();
return
} else
$('#customQuality').hide();

$('#customQuality').show();
return;
} else {
$('#customQuality').hide();
}

$('#anyQualities option').each(function(i) {
var result = preset & $(this).val()
if (result > 0) $(this).attr('selected', 'selected');
else $(this).attr('selected', false);
var result = preset & $(this).val();
if (result > 0) {
$(this).attr('selected', 'selected');
} else {
$(this).attr('selected', false);
}
});

$('#bestQualities option').each(function(i) {
var result = preset & ($(this).val() << 16)
if (result > 0) $(this).attr('selected', 'selected');
else $(this).attr('selected', false);
var result = preset & ($(this).val() << 16);
if (result > 0) {
$(this).attr('selected', 'selected');
} else {
$(this).attr('selected', false);
}
});
return

return;
}
$('#qualityPreset').change(function(){
setFromPresets($('#qualityPreset :selected').val());

$('#qualityPreset').change(function() {
setFromPresets($('#qualityPreset :selected').val());
});
setFromPresets($('#qualityPreset :selected').val())
});

setFromPresets($('#qualityPreset :selected').val());
});

2 comments on commit ec26d43

@pyrodex
Copy link

@pyrodex pyrodex commented on ec26d43 Dec 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this commit may have broken the ability to change a quality on an individual show. I have a few in Custom and when I edit the show and attempt to change it from Custom to HD it used to redraw the page and remove the custom selectors and then hitting save would fix this. However with this commit selecting HD from Custom won't remove the selectors nor does SAVE update the quality.

@thezoggy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #546

Please sign in to comment.