Compare distro and build for pms updates

This commit is contained in:
JonnyWong16 2016-07-26 19:10:59 -07:00
parent 495659e9cd
commit 79dc190ccc
4 changed files with 15 additions and 2 deletions

View file

@ -549,6 +549,7 @@
<label for="pms_update_distro_build">Release</label>
<select class="form-control" id="pms_update_distro_build" name="pms_update_distro_build">
</select>
<input type="hidden" class="form-control" id="pms_update_distro" name="pms_update_distro">
</div>
</div>
</div>
@ -2681,6 +2682,7 @@ $(document).ready(function() {
var plexpass = update_params.plexpass;
var platform = update_params.pms_platform;
var update_channel = update_params.pms_update_channel;
var update_distro = update_params.pms_update_distro;
var update_distro_build = update_params.pms_update_distro_build;
$("#pms_update_channel option[value='plexpass']").remove();
@ -2699,18 +2701,26 @@ $(document).ready(function() {
$("#pms_update_distro_build option").remove();
$.each(platform_downloads.releases, function (index, item) {
var label = (platform_downloads.releases.length == 1) ? platform_downloads.name : platform_downloads.name + ' - ' + item.label;
var selected = (item.build == update_distro_build) ? true : false;
var selected = (item.distro == update_distro && item.build == update_distro_build) ? true : false;
$('#pms_update_distro_build')
.append($('<option></option>')
.text(label)
.val(item.build)
.attr('data-distro', item.distro)
.prop('selected', selected));
})
$('#pms_update_distro').val($("#pms_update_distro_build option:selected").data('distro'))
}
});
});
}
loadUpdateDistros();
$('#pms_update_distro_build').change(function () {
var distro = $("option:selected", this).data('distro')
$('#pms_update_distro').val(distro)
});
});
</script>
</%def>