mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
xmltv cleanup
This commit is contained in:
parent
8a4d86df62
commit
c93cd26774
1 changed files with 184 additions and 188 deletions
|
@ -4,8 +4,8 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
return function (page, providerId, options) {
|
return function (page, providerId, options) {
|
||||||
function getListingProvider(config, id) {
|
function getListingProvider(config, id) {
|
||||||
if (config && id) {
|
if (config && id) {
|
||||||
var result = config.ListingProviders.filter(function (i__w) {
|
var result = config.ListingProviders.filter(function (provider) {
|
||||||
return i__w.Id === id;
|
return provider.Id === id;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -57,8 +57,8 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
loading.show();
|
loading.show();
|
||||||
var id = providerId;
|
var id = providerId;
|
||||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||||
var info = config.ListingProviders.filter(function (i__e) {
|
var info = config.ListingProviders.filter(function (provider) {
|
||||||
return i__e.Id === id;
|
return provider.Id === id;
|
||||||
})[0] || {};
|
})[0] || {};
|
||||||
info.Type = "xmltv";
|
info.Type = "xmltv";
|
||||||
info.Path = page.querySelector(".txtPath").value;
|
info.Path = page.querySelector(".txtPath").value;
|
||||||
|
@ -69,10 +69,10 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
info.NewsCategories = getCategories(page.querySelector(".txtNews"));
|
info.NewsCategories = getCategories(page.querySelector(".txtNews"));
|
||||||
info.SportsCategories = getCategories(page.querySelector(".txtSports"));
|
info.SportsCategories = getCategories(page.querySelector(".txtSports"));
|
||||||
info.EnableAllTuners = page.querySelector(".chkAllTuners").checked;
|
info.EnableAllTuners = page.querySelector(".chkAllTuners").checked;
|
||||||
info.EnabledTuners = info.EnableAllTuners ? [] : $__q(".chkTuner", page).get().filter(function (i__r) {
|
info.EnabledTuners = info.EnableAllTuners ? [] : $__q(".chkTuner", page).get().filter(function (tuner) {
|
||||||
return i__r.checked;
|
return tuner.checked;
|
||||||
}).map(function (i__t) {
|
}).map(function (tuner) {
|
||||||
return i__t.getAttribute("data-id");
|
return tuner.getAttribute("data-id");
|
||||||
});
|
});
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -102,13 +102,10 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
switch (providerId = providerId.toLowerCase()) {
|
switch (providerId = providerId.toLowerCase()) {
|
||||||
case "m3u":
|
case "m3u":
|
||||||
return "M3U Playlist";
|
return "M3U Playlist";
|
||||||
|
|
||||||
case "hdhomerun":
|
case "hdhomerun":
|
||||||
return "HDHomerun";
|
return "HDHomerun";
|
||||||
|
|
||||||
case "satip":
|
case "satip":
|
||||||
return "DVB";
|
return "DVB";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
@ -117,8 +114,8 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
function refreshTunerDevices(page, providerInfo, devices) {
|
function refreshTunerDevices(page, providerInfo, devices) {
|
||||||
var html = "";
|
var html = "";
|
||||||
|
|
||||||
for (var i__y = 0, length = devices.length; i__y < length; i__y++) {
|
for (var i = 0, length = devices.length; i < length; i__yi {
|
||||||
var device = devices[i__y];
|
var device = devices[i];
|
||||||
html += '<div class="listItem">';
|
html += '<div class="listItem">';
|
||||||
var enabledTuners = providerInfo.EnabledTuners || [];
|
var enabledTuners = providerInfo.EnabledTuners || [];
|
||||||
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
||||||
|
@ -151,7 +148,6 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
txtPath.value = path;
|
txtPath.value = path;
|
||||||
txtPath.focus();
|
txtPath.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
picker.close();
|
picker.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -184,8 +180,8 @@ define(["jQuery", "loading", "emby-checkbox", "emby-input", "listViewStyle", "pa
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
page.querySelector("#btnSelectPath").addEventListener("click", onSelectPathClick);
|
page.querySelector("#btnSelectPath").addEventListener("click", onSelectPathClick);
|
||||||
page.querySelector(".chkAllTuners").addEventListener("change", function (e__i) {
|
page.querySelector(".chkAllTuners").addEventListener("change", function (evt) {
|
||||||
if (e__i.target.checked) {
|
if (evt.target.checked) {
|
||||||
page.querySelector(".selectTunersSection").classList.add("hide");
|
page.querySelector(".selectTunersSection").classList.add("hide");
|
||||||
} else {
|
} else {
|
||||||
page.querySelector(".selectTunersSection").classList.remove("hide");
|
page.querySelector(".selectTunersSection").classList.remove("hide");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue