Added examples to EpisodeSorting Settings.

Added new Multi-Episode Naming (Scene).
pull/4/head
Mark McDowall 14 years ago
parent d65d79a5c9
commit 30d7fecff5

@ -56,19 +56,25 @@ namespace NzbDrone.Core.Helpers
{
Id = 0,
Name = "Extend",
Pattern = ""
Pattern = "S01E05-06"
},
new EpisodeSortingType
{
Id = 1,
Name = "Duplicate",
Pattern = ""
Pattern = "S01E05 - S01E06"
},
new EpisodeSortingType
{
Id = 2,
Name = "Repeat",
Pattern = ""
Pattern = "S01E05E06"
},
new EpisodeSortingType
{
Id = 3,
Name = "Scene",
Pattern = "S01E05-E06"
}
};

@ -276,6 +276,8 @@ button, input[type="button"], input[type="submit"], input[type="reset"]
border-bottom-style: solid;
border-bottom-width: 5px;
border-bottom-color: #3C3C3C;
/* Set padding to prevent fieldset border from moving when button is highlighted... WINNING! */
padding-bottom: 2px;
}
.hiddenResult

@ -11,6 +11,7 @@
};
$('#form').ajaxForm(options);
$('#save_button').attr('disabled', '');
createExamples();
});
function showRequest(formData, jqForm, options) {
@ -26,7 +27,6 @@
@using (Html.BeginForm("SaveEpisodeSorting", "Settings", FormMethod.Post, new { id = "form", name = "form" }))
{
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
;
<fieldset>
<legend>Episode Sorting</legend>
@ -117,8 +117,123 @@
<div class="config-validation">@Html.ValidationMessageFor(m => m.MultiEpisodeStyle)</div>
</div>
<div id="singleEpisodeExample"></div>
<div id="multiEpisodeExample"></div>
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</fieldset>
}
<div id="result" class="hiddenResult"></div>
<script type="text/javascript">
$('#ShowName').live('change', function () { createExamples(); });
$('#EpisodeName').live('change', function () { createExamples(); });
$('#ReplaceSpaces').live('change', function () { createExamples(); });
$('#AppendQuality').live('change', function () { createExamples(); });
$('#SeparatorStyle').live('change', function () { createExamples(); });
$('#NumberStyle').live('change', function () { createExamples(); });
$('#MultiEpisodeStyle').live('change', function () { createExamples(); });
function createExamples() {
createSingleEpisodeExample();
createMultiEpisodeExample();
}
function createSingleEpisodeExample() {
var result = '';
var separator = ' - ';
if ($("#SeparatorStyle option:selected").val() == 1)
separator = ' ';
if ($('#ShowName').attr('checked')) {
result += 'Show Name';
result += separator;
}
result += $("#NumberStyle option:selected").text();
if ($('#EpisodeName').attr('checked')) {
result += separator;
result += 'Episode Name';
}
if ($('#AppendQuality').attr('checked'))
result += ' [TV]';
if ($('#ReplaceSpaces').attr('checked'))
result = result.replace(/\s/g, '.');
result = '<b>Single Episode Example: </b>' + result;
$('#singleEpisodeExample').html(result);
}
function createMultiEpisodeExample() {
var result = '';
var separator = ' - ';
if ($("#SeparatorStyle option:selected").val() == 1)
separator = ' ';
if ($('#ShowName').attr('checked')) {
result += 'Show Name';
result += separator;
}
var numberStyle = $("#NumberStyle option:selected").text();
var numberId = $("#NumberStyle option:selected").val();
var style = $("#MultiEpisodeStyle option:selected").val();
result += numberStyle;
if (style == 0)
result += '-06';
if (style == 1) {
result += separator;
result += numberStyle.replace('5', '6');
}
if (style == 2) {
if (numberId <= 1)
result += 'x06';
if (numberId == 2)
result += 'E06';
if (numberId == 3)
result += 'e06';
}
if (style == 3) {
if (numberId <= 1)
result += '-x06';
if (numberId == 2)
result += '-E06';
if (numberId == 3)
result += '-e06';
}
if ($('#EpisodeName').attr('checked')) {
result += separator;
result += 'Episode Name';
}
if ($('#AppendQuality').attr('checked'))
result += ' [TV]';
if ($('#ReplaceSpaces').attr('checked'))
result = result.replace(/\s/g, '.');
result = '<b>Multi-Episode Example: </b>' + result;
$('#multiEpisodeExample').html(result);
}
</script>

@ -45,9 +45,7 @@
</div>
</div>
<p>
<input type="submit" id="save_button" value="Save" disabled="disabled" />
</p>
</fieldset>
}
<div id="result" class="hiddenResult"></div>

Loading…
Cancel
Save