mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update tuners
This commit is contained in:
parent
a2ac684553
commit
7a37be78a6
6 changed files with 269 additions and 47 deletions
70
dashboard-ui/scripts/livetvtunerprovider-m3u.js
Normal file
70
dashboard-ui/scripts/livetvtunerprovider-m3u.js
Normal file
|
@ -0,0 +1,70 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function reload(page, providerId) {
|
||||
|
||||
$('#txtDevicePath', page).val('');
|
||||
|
||||
if (providerId) {
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.TunerHosts.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0];
|
||||
|
||||
$('#txtDevicePath', page).val(info.Url || '');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function submitForm(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'm3u',
|
||||
Url: $('#txtDevicePath', page).val(),
|
||||
ImportFavoritesOnly: $('#chkFavorite', page).checked()
|
||||
};
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/TunerHosts'),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
Dashboard.navigate('livetvstatus.html');
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('form', page).on('submit', function () {
|
||||
submitForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue