mirror of https://github.com/Radarr/Radarr
Merge branch 'markus101'
This commit is contained in:
commit
e3ad0b3d6b
|
@ -134,17 +134,13 @@ namespace NzbDrone.Web.Controllers
|
||||||
ViewData["Qualities"] = qualityTypes;
|
ViewData["Qualities"] = qualityTypes;
|
||||||
|
|
||||||
var profiles = _qualityProvider.GetAllProfiles().ToList();
|
var profiles = _qualityProvider.GetAllProfiles().ToList();
|
||||||
|
|
||||||
var defaultQualityQualityProfileId = Convert.ToInt32(_configProvider.DefaultQualityProfile);
|
var defaultQualityQualityProfileId = Convert.ToInt32(_configProvider.DefaultQualityProfile);
|
||||||
var downloadPropers = _configProvider.DownloadPropers;
|
|
||||||
|
|
||||||
var qualityProfileSelectList = new SelectList(profiles, "QualityProfileId", "Name");
|
var qualityProfileSelectList = new SelectList(profiles, "QualityProfileId", "Name");
|
||||||
|
|
||||||
var model = new QualityModel
|
var model = new QualityModel
|
||||||
{
|
{
|
||||||
Profiles = profiles,
|
Profiles = profiles,
|
||||||
DefaultQualityProfileId = defaultQualityQualityProfileId,
|
DefaultQualityProfileId = defaultQualityQualityProfileId,
|
||||||
DownloadPropers = downloadPropers,
|
|
||||||
QualityProfileSelectList = qualityProfileSelectList
|
QualityProfileSelectList = qualityProfileSelectList
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -208,7 +204,7 @@ namespace NzbDrone.Web.Controllers
|
||||||
qualityTypes.Add(qual);
|
qualityTypes.Add(qual);
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["Qualities"] = new SelectList(qualityTypes);
|
ViewData["Qualities"] = qualityTypes;
|
||||||
|
|
||||||
var qualityProfile = new QualityProfile
|
var qualityProfile = new QualityProfile
|
||||||
{
|
{
|
||||||
|
@ -219,7 +215,6 @@ namespace NzbDrone.Web.Controllers
|
||||||
|
|
||||||
var id = _qualityProvider.Add(qualityProfile);
|
var id = _qualityProvider.Add(qualityProfile);
|
||||||
qualityProfile.QualityProfileId = id;
|
qualityProfile.QualityProfileId = id;
|
||||||
qualityProfile.Allowed = null;
|
|
||||||
|
|
||||||
ViewData["ProfileId"] = id;
|
ViewData["ProfileId"] = id;
|
||||||
|
|
||||||
|
@ -460,7 +455,6 @@ namespace NzbDrone.Web.Controllers
|
||||||
if (ModelState.IsValid)
|
if (ModelState.IsValid)
|
||||||
{
|
{
|
||||||
_configProvider.DefaultQualityProfile = data.DefaultQualityProfileId;
|
_configProvider.DefaultQualityProfile = data.DefaultQualityProfileId;
|
||||||
_configProvider.DownloadPropers = data.DownloadPropers;
|
|
||||||
|
|
||||||
//Saves only the Default Quality, skips User Profiles since none exist
|
//Saves only the Default Quality, skips User Profiles since none exist
|
||||||
if (data.Profiles == null)
|
if (data.Profiles == null)
|
||||||
|
@ -472,8 +466,8 @@ namespace NzbDrone.Web.Controllers
|
||||||
|
|
||||||
profile.Allowed = new List<QualityTypes>();
|
profile.Allowed = new List<QualityTypes>();
|
||||||
|
|
||||||
//Remove the extra comma from the end and replace double commas with a single one (the Javascript gets a little crazy)
|
//Remove the extra comma from the end
|
||||||
profile.AllowedString = profile.AllowedString.Replace(",,", ",").Trim(',');
|
profile.AllowedString = profile.AllowedString.Trim(',');
|
||||||
|
|
||||||
foreach (var quality in profile.AllowedString.Split(','))
|
foreach (var quality in profile.AllowedString.Split(','))
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,10 +13,6 @@ namespace NzbDrone.Web.Models
|
||||||
[Description("The default quality to use when adding series to NzbDrone")]
|
[Description("The default quality to use when adding series to NzbDrone")]
|
||||||
public int DefaultQualityProfileId { get; set; }
|
public int DefaultQualityProfileId { get; set; }
|
||||||
|
|
||||||
[DisplayName("Download Propers")]
|
|
||||||
[Description("Should NzbDrone download proper releases (to replace non-proper files)?")]
|
|
||||||
public bool DownloadPropers { get; set; }
|
|
||||||
|
|
||||||
public SelectList QualityProfileSelectList { get; set; }
|
public SelectList QualityProfileSelectList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -48,17 +48,6 @@
|
||||||
<legend>Quality</legend>
|
<legend>Quality</legend>
|
||||||
|
|
||||||
<div class="rightSide" style="float: right; width: 65%;">
|
<div class="rightSide" style="float: right; width: 65%;">
|
||||||
<div class="config-section">
|
|
||||||
<div class="config-group">
|
|
||||||
<div class="config-title">@Html.LabelFor(m => m.DownloadPropers)</div>
|
|
||||||
<div class="config-value">@Html.CheckBoxFor(m => m.DownloadPropers)</div>
|
|
||||||
</div>
|
|
||||||
<div class="config-group2">
|
|
||||||
<div class="config-validation">@Html.ValidationMessageFor(m => m.DownloadPropers)</div>
|
|
||||||
<div class="config-description">@Html.DescriptionFor(m => m.DownloadPropers)</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="config-section">
|
<div class="config-section">
|
||||||
<div class="config-group">
|
<div class="config-group">
|
||||||
<div class="config-title">@Html.LabelFor(m => m.DefaultQualityProfileId)</div>
|
<div class="config-title">@Html.LabelFor(m => m.DefaultQualityProfileId)</div>
|
||||||
|
@ -103,7 +92,7 @@
|
||||||
url: this.href,
|
url: this.href,
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function (html) {
|
success: function (html) {
|
||||||
$("#profiles").prepend(html);
|
$("#profiles").append(html);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
Layout = null;
|
Layout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<style>
|
||||||
$(document).ready(function () {
|
.quality-selectee { width: 75px; padding: 1px; padding-left: 3px; padding-right: 3px; margin: 2px; float: left; }
|
||||||
addOption('@Model.Name', '@ViewData["ProfileId"]');
|
.quality-selecting { background: #85AEF9; }
|
||||||
});
|
.quality-selected { background: #065EFE; color: white; }
|
||||||
</script>
|
</style>
|
||||||
|
|
||||||
@using (Html.BeginCollectionItem("Profiles"))
|
@using (Html.BeginCollectionItem("Profiles"))
|
||||||
{
|
{
|
||||||
|
@ -22,36 +22,7 @@
|
||||||
string allowedStringName = String.Format("{0}_AllowedString", idClean);
|
string allowedStringName = String.Format("{0}_AllowedString", idClean);
|
||||||
string title = String.Format("{0}_Title", idClean);
|
string title = String.Format("{0}_Title", idClean);
|
||||||
string nameBox = String.Format("{0}_Name", idClean);
|
string nameBox = String.Format("{0}_Name", idClean);
|
||||||
string cutoff = String.Format("{0}.Cutoff", ugly);
|
string cutoff = String.Format("{0}_Cutoff", idClean);
|
||||||
|
|
||||||
<style>
|
|
||||||
.selectableList .ui-selecting { background: #85AEF9; }
|
|
||||||
.selectableList .ui-selected { background: #065EFE; color: white; }
|
|
||||||
.selectableList { list-style-type: none; margin: 0; padding: 0; }
|
|
||||||
.selectableList li { margin: 3px; margin-left: 10px; padding-left: 0.4em; padding-bottom: 1.5em; padding-top: 0em; float: left; font-size: 1.2em; width: 110px; height: 6px; }
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function () {
|
|
||||||
$("#@selectable").selectable({
|
|
||||||
create: function () {
|
|
||||||
var result = "";
|
|
||||||
$(".ui-selected", this).each(function () {
|
|
||||||
result += this.id + ",";
|
|
||||||
});
|
|
||||||
$("#@allowedStringName").empty().val(result);
|
|
||||||
},
|
|
||||||
|
|
||||||
stop: function () {
|
|
||||||
var result = "";
|
|
||||||
$(".ui-selected", this).each(function () {
|
|
||||||
result += this.id + ",";
|
|
||||||
});
|
|
||||||
$("#@allowedStringName").empty().val(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="profileSectionEditor" id="div_@(ViewData["ProfileId"])">
|
<div class="profileSectionEditor" id="div_@(ViewData["ProfileId"])">
|
||||||
|
|
||||||
|
@ -70,37 +41,36 @@
|
||||||
|
|
||||||
<div class="config-group" style="width: 255px; margin-bottom: 5px; margin-left: 5px;">
|
<div class="config-group" style="width: 255px; margin-bottom: 5px; margin-left: 5px;">
|
||||||
<div class="config-title">@Html.LabelFor(x => x.Cutoff)</div>
|
<div class="config-title">@Html.LabelFor(x => x.Cutoff)</div>
|
||||||
<div class="config-value">@Html.DropDownListFor(m => m.Cutoff, new SelectList(ViewData["Qualities"] as IEnumerable, Model.Cutoff))</div>
|
<div class="config-value">@Html.DropDownListFor(m => m.Cutoff, new SelectList(Model.Allowed, Model.Cutoff))</div>
|
||||||
<div class="config-validation">@Html.ValidationMessageFor(x => x.Cutoff)</div>
|
<div class="config-validation">@Html.ValidationMessageFor(x => x.Cutoff)</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="selectableDiv" style="margin-top: 30px;">
|
<div class="selectableDiv" style="margin-top: 30px;">
|
||||||
<ol id="@selectable" class="selectableList">
|
<div id="@selectable">
|
||||||
|
|
||||||
@{var qualitiesList = (List<QualityTypes>)ViewData["Qualities"];}
|
@{var qualitiesList = (List<QualityTypes>)ViewData["Qualities"];}
|
||||||
|
|
||||||
@for (int i = 0; i < qualitiesList.Count(); i++)
|
@for (int i = 0; i < qualitiesList.Count(); i++)
|
||||||
{
|
{
|
||||||
|
if (qualitiesList[i].ToString() == "Unknown")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Model.Allowed != null)
|
if (Model.Allowed != null)
|
||||||
{
|
{
|
||||||
if (Model.Allowed.Contains(qualitiesList[i]))
|
if (Model.Allowed.Contains(qualitiesList[i]))
|
||||||
{
|
{
|
||||||
<li class="ui-widget-content ui-selected" id="@qualitiesList[i].ToString()">
|
<fieldset class="quality-selectee quality-selected">@qualitiesList[i].ToString()</fieldset>
|
||||||
@Html.Label(qualitiesList[i].ToString())
|
|
||||||
</li>
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<li class="ui-widget-content" id="@qualitiesList[i].ToString()">
|
<fieldset class="quality-selectee">@qualitiesList[i].ToString()</fieldset>
|
||||||
@Html.Label(qualitiesList[i].ToString())
|
|
||||||
</li>
|
|
||||||
}
|
}
|
||||||
</ol>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hiddenProfileDetails2">
|
<div class="hiddenProfileDetails">
|
||||||
@Html.HiddenFor(x => x.QualityProfileId)
|
@Html.HiddenFor(x => x.QualityProfileId)
|
||||||
@Html.HiddenFor(x => x.UserProfile)
|
@Html.HiddenFor(x => x.UserProfile)
|
||||||
@Html.HiddenFor(m => m.AllowedString)
|
@Html.HiddenFor(m => m.AllowedString)
|
||||||
|
@ -109,10 +79,43 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
addOption('@Model.Name', '@ViewData["ProfileId"]');
|
||||||
|
|
||||||
|
result = "";
|
||||||
|
$("#@selectable .quality-selected").each(function () {
|
||||||
|
result += this.firstChild.data + ",";
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#@allowedStringName").empty().val(result);
|
||||||
|
$('#@selectable .quality-selectee').disableSelection();
|
||||||
|
});
|
||||||
|
|
||||||
$("#@nameBox").keyup(function () {
|
$("#@nameBox").keyup(function () {
|
||||||
var value = $(this).val();
|
var value = $(this).val();
|
||||||
$("#@title").text(value);
|
$("#@title").text(value);
|
||||||
renameOption(value, '@ViewData["ProfileId"]');
|
renameOption(value, '@ViewData["ProfileId"]');
|
||||||
}).keyup();
|
}).keyup();
|
||||||
|
|
||||||
|
$('#@selectable .quality-selectee').click(function () {
|
||||||
|
if ($(this).hasClass('quality-selected'))
|
||||||
|
{
|
||||||
|
$(this).removeClass('quality-selected');
|
||||||
|
var toRemove = this.firstChild.data;
|
||||||
|
$('#@cutoff option').each(function () { if ($(this).text().indexOf(toRemove) > -1) $('#@cutoff option').remove(':contains("' + $(this).text() + '")'); });
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
$(this).addClass('quality-selected');
|
||||||
|
$('<option>' + this.firstChild.data + '</option>').appendTo('#@cutoff');
|
||||||
|
}
|
||||||
|
|
||||||
|
result = "";
|
||||||
|
$("#@selectable .quality-selected").each(function () {
|
||||||
|
result += this.firstChild.data + ",";
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#@allowedStringName").empty().val(result);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
|
@ -1,58 +1,49 @@
|
||||||
Hello World
|
<style>
|
||||||
|
.quality-selectee { width: 75px; padding: 1px; padding-left: 5px; margin: 3px; }
|
||||||
<input type="checkbox" id="id_chk1" class="chkbox" value="1" />Check 1<br/>
|
.quality-selecting { background: #85AEF9; }
|
||||||
<input type="checkbox" id="id_chk2" class="chkbox" value="2" />Check 2<br/>
|
.quality-selected { background: #065EFE; color: white; }
|
||||||
<input type="checkbox" id="id_chk3" class="chkbox" value="3" />Check 3<br/>
|
|
||||||
<input type="checkbox" id="id_chk4" class="chkbox" value="4" />Check 4<br/>
|
|
||||||
<input type="checkbox" id="id_chk5" class="chkbox" value="5" />Check 5<br/>
|
|
||||||
<input type="checkbox" id="id_chk6" class="chkbox" value="6" />Check 6<br/>
|
|
||||||
<input type="checkbox" id="id_chk7" class="chkbox" value="7" />Check 7<br/>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var lastChecked = null;
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('.chkbox').click(function (event) {
|
|
||||||
if (!lastChecked) {
|
|
||||||
lastChecked = this;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.shiftKey) {
|
|
||||||
var start = $('.chkbox').index(this);
|
|
||||||
var end = $('.chkbox').index(lastChecked);
|
|
||||||
|
|
||||||
for (i = Math.min(start, end); i <= Math.max(start, end); i++) {
|
|
||||||
$('.chkbox')[i].checked = lastChecked.checked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lastChecked = this;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#selectable .ui-selecting { background: #85AEF9; }
|
|
||||||
#selectable .ui-selected { background: #065EFE; color: white; }
|
|
||||||
#selectable { list-style-type: none; margin: 0; padding: 0; width: 110px; }
|
|
||||||
#selectable li { margin: 3px; padding-left: 0.4em; padding-bottom: 1.5em; padding-top: 0em; font-size: 1.2em; height: 6px; }
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<fieldset class="quality-selectee">
|
||||||
$(function () {
|
SDTV
|
||||||
$("#selectable").selectable();
|
</fieldset>
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<ol id="selectable">
|
<fieldset class="quality-selectee">
|
||||||
<li class="ui-widget-content">Unknown</li>
|
DVD
|
||||||
<li class="ui-widget-content">SDTV</li>
|
</fieldset>
|
||||||
<li class="ui-widget-content">DVD</li>
|
|
||||||
<li class="ui-widget-content">HDTV</li>
|
<fieldset class="quality-selectee">
|
||||||
<li class="ui-widget-content">WEBDL</li>
|
HDTV
|
||||||
<li class="ui-widget-content">Bluray720p</li>
|
</fieldset>
|
||||||
<li class="ui-widget-content">Bluray1080p</li>
|
|
||||||
</ol>
|
<fieldset class="quality-selectee">
|
||||||
|
WEBDL
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="quality-selectee">
|
||||||
|
Bluray720p
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="quality-selectee">
|
||||||
|
Bluray1080p
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
@Html.TextBox("result", "")
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('.quality-selectee').click(function () {
|
||||||
|
if ($(this).hasClass('quality-selected'))
|
||||||
|
$(this).removeClass('quality-selected');
|
||||||
|
else
|
||||||
|
$(this).addClass('quality-selected');
|
||||||
|
|
||||||
|
result = "";
|
||||||
|
$(".quality-selected").each(function () {
|
||||||
|
result += this.firstChild.data + ",";
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#result").empty().val(result);
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in New Issue