1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add tv genre configuration options

This commit is contained in:
Luke Pulverenti 2016-06-03 15:32:10 -04:00
parent 81ab24a44c
commit f13258a120
24 changed files with 261 additions and 143 deletions

View file

@ -1,34 +1,53 @@
define(['jQuery', 'paper-checkbox', 'paper-button', 'paper-input', 'paper-item-body', 'paper-icon-item'], function ($) {
define(['jQuery', 'paper-checkbox', 'paper-button', 'emby-input', 'paper-item-body', 'paper-icon-item'], function ($) {
return function (page, providerId, options) {
var self = this;
function getListingProvider(config, id) {
if (config && id) {
return config.ListingProviders.filter(function (i) {
return i.Id == id;
})[0] || getListingProvider();
}
return ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/Default'));
}
function reload() {
Dashboard.showLoadingMsg();
ApiClient.getNamedConfiguration("livetv").then(function (config) {
var info = config.ListingProviders.filter(function (i) {
return i.Id == providerId;
})[0] || {};
getListingProvider(config, providerId).then(function (info) {
page.querySelector('.txtPath').value = info.Path || '';
page.querySelector('.txtKids').value = (info.KidsGenres || []).join('|');
page.querySelector('.txtNews').value = (info.NewsGenres || []).join('|');
page.querySelector('.txtSports').value = (info.SportsGenres || []).join('|');
page.querySelector('.txtPath').value = info.Path || '';
page.querySelector('.chkAllTuners').checked = info.EnableAllTuners;
page.querySelector('.chkAllTuners').checked = info.EnableAllTuners;
if (page.querySelector('.chkAllTuners').checked) {
page.querySelector('.selectTunersSection').classList.add('hide');
} else {
page.querySelector('.selectTunersSection').classList.remove('hide');
}
if (page.querySelector('.chkAllTuners').checked) {
page.querySelector('.selectTunersSection').classList.add('hide');
} else {
page.querySelector('.selectTunersSection').classList.remove('hide');
}
refreshTunerDevices(page, info, config.TunerHosts);
Dashboard.hideLoadingMsg();
refreshTunerDevices(page, info, config.TunerHosts);
Dashboard.hideLoadingMsg();
});
});
}
function getGenres(txtInput) {
var value = txtInput.value;
return value ? value.split('|') : [];
}
function submitListingsForm() {
Dashboard.showLoadingMsg();
@ -42,7 +61,13 @@
})[0] || {};
info.Type = 'xmltv';
info.Path = page.querySelector('.txtPath').value;
info.KidsGenres = getGenres(page.querySelector('.txtKids'));
info.NewsGenres = getGenres(page.querySelector('.txtNews'));
info.SportsGenres = getGenres(page.querySelector('.txtSports'));
info.EnableAllTuners = page.querySelector('.chkAllTuners').checked;
info.EnabledTuners = info.EnableAllTuners ? [] : $('.chkTuner', page).get().filter(function (i) {
return i.checked;