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

update live tv recordings

This commit is contained in:
Luke Pulverenti 2015-07-29 13:16:00 -04:00
parent 65f5de02c1
commit 6d7ee58678
18 changed files with 146 additions and 272 deletions

View file

@ -119,9 +119,9 @@
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter || context != 'sync' || !AppInfo.enableSupporterMembership) {
$('.syncPromotion', page).hide();
$('.supporterPromotion', page).hide();
} else {
$('.syncPromotion', page).show();
$('.supporterPromotion', page).show();
}
});

View file

@ -1398,7 +1398,7 @@ $(document).on('pageshowready', "#dashboardPage", DashboardPage.onPageShow).on('
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
if (!$('.staticSupporterPromotion', page).length) {
if (!$('.customSupporterPromotion', page).length) {
$('.supporterPromotion', page).remove();
if (!pluginSecurityInfo.IsMBSupporter && AppInfo.enableSupporterMembership) {

View file

@ -614,7 +614,7 @@
var elem = $('#similarCollapsible', page).show();
$('.detailSectionHeader', elem).html(Globalize.translate('HeaderIfYouLikeCheckTheseOut', item.Name));
$('.similiarHeader', elem).html(Globalize.translate('HeaderIfYouLikeCheckTheseOut', item.Name));
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
@ -915,14 +915,14 @@
html += '<div class="detailSection">';
html += '<div class="detailSectionHeader" style="position: relative;">';
html += '<h1>';
html += '<span>' + type.name + '</span>';
if (user.Policy.IsAdministrator) {
html += '<a class="detailSectionHeaderButton" href="edititemmetadata.html?tab=2&id=' + currentItem.Id + '" data-role="button" data-icon="edit" data-iconpos="notext" data-inline="true">' + Globalize.translate('ButtonEdit') + '</a>';
html += '<a class="detailSectionHeaderButton clearLink" style="margin-top:-8px;display:inline-block;" href="edititemmetadata.html?tab=2&id=' + currentItem.Id + '" title="' + Globalize.translate('ButtonEdit') + '" style="display:none;"><paper-icon-button icon="mode-edit"></paper-icon-button></a>';
}
html += '</div>';
html += '</h1>';
html += '<div class="detailSectionContent">';

View file

@ -832,7 +832,7 @@
return "itembynamedetails.html?id=" + id + contextSuffix;
}
if (item.Type == "Recording") {
return "livetvrecording.html?id=" + id + contextSuffix;
return "itemdetails.html?id=" + id;
}
if (item.Type == "MusicArtist") {

View file

@ -4,6 +4,8 @@
function reload(page, providerId) {
Dashboard.showLoadingMsg();
ApiClient.getNamedConfiguration("livetv").done(function (config) {
var info = config.ListingProviders.filter(function (i) {
@ -12,15 +14,64 @@
listingsId = info.ListingsId;
$('#selectListing', page).val(info.ListingsId || '').selectmenu('refresh');
$('#selectCountry', page).val(info.Country || '').selectmenu('refresh');
page.querySelector('.txtZipCode').value = info.ZipCode || '';
$(page.querySelector('.txtZipCode')).trigger('change');
page.querySelector('.txtUser').value = info.Username || '';
page.querySelector('.txtPass').value = info.Username || '';
page.querySelector('.txtZipCode').value = info.ZipCode || '';
setCountry(page, info);
});
}
function setCountry(page, info) {
ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).done(function (result) {
var countryList = [];
var i, length;
for (var region in result) {
var countries = result[region];
if (countries.length && region !== 'ZZZ') {
for (i = 0, length = countries.length; i < length; i++) {
countryList.push({
name: countries[i].fullName,
value: countries[i].shortName
});
}
}
}
countryList.sort(function (a, b) {
if (a.name > b.name) {
return 1;
}
if (a.name < b.name) {
return -1;
}
// a must be equal to b
return 0;
});
$('#selectCountry', page).html(countryList.map(function (c) {
return '<option value="' + c.value + '">' + c.name + '</option>';
}).join('')).val(info.Country || '').selectmenu('refresh');
$(page.querySelector('.txtZipCode')).trigger('change');
}).fail(function () {
Dashboard.alert({
message: Globalize.translate('ErrorGettingTvLineups')
});
});
Dashboard.hideLoadingMsg();
}
function submitLoginForm(page) {
Dashboard.showLoadingMsg();

View file

@ -1,130 +0,0 @@
(function ($, document) {
var currentItem;
function deleteRecording() {
Dashboard.confirm(Globalize.translate('MessageConfirmRecordingDeletion'), Globalize.translate('HeaderConfirmRecordingDeletion'), function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.deleteLiveTvRecording(currentItem.Id).done(function () {
Dashboard.alert(Globalize.translate('MessageRecordingDeleted'));
Dashboard.navigate('livetvrecordings.html');
});
}
});
}
function play() {
var userdata = currentItem.UserData || {};
var mediaType = currentItem.MediaType;
LibraryBrowser.showPlayMenu(null, currentItem.Id, currentItem.Type, false, mediaType, userdata.PlaybackPositionTicks);
}
function renderRecording(page, item) {
currentItem = item;
var context = 'livetv';
var name = item.Name;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
Dashboard.setPageTitle(name);
$('.itemName', page).html(name);
$('.itemEpisodeName', page).html(item.EpisodeTitle || '');
$('.itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(item));
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
LibraryBrowser.renderGenres($('.itemGenres', page), item, context);
LibraryBrowser.renderOverview(page.querySelectorAll('.itemOverview'), item);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
LiveTvHelpers.renderMiscProgramInfo($('.miscTvProgramInfo', page), item);
$(page).trigger('displayingitem', [{
item: item,
context: 'livetv'
}]);
$('.recordingStatus', page).html('Status:&nbsp;&nbsp;&nbsp;' + item.Status);
if (MediaController.canPlay(item)) {
$('#playButtonContainer', page).show();
} else {
$('#playButtonContainer', page).hide();
}
if (item.CanDelete) {
$('#deleteButtonContainer', page).show();
} else {
$('#deleteButtonContainer', page).hide();
}
LiveTvHelpers.renderOriginalAirDate($('.airDate', page), item);
Dashboard.hideLoadingMsg();
Dashboard.getCurrentUser().done(function(user) {
if (SyncManager.isAvailable(item, user)) {
$('.btnSync', page).removeClass('hide');
} else {
$('.btnSync', page).addClass('hide');
}
});
}
function reload(page) {
Dashboard.showLoadingMsg();
var id = getParameterByName('id');
ApiClient.getLiveTvRecording(id, Dashboard.getCurrentUserId()).done(function (result) {
renderRecording(page, result);
});
}
$(document).on('pageinitdepends', "#liveTvRecordingPage", function () {
var page = this;
$('.btnDelete', page).on('click', deleteRecording);
$('.btnPlay', page).on('click', play);
$('.btnSync', page).on('click', function () {
SyncManager.showMenu({
items: [currentItem]
});
});
}).on('pagebeforeshowready', "#liveTvRecordingPage", function () {
var page = this;
reload(page);
}).on('pagebeforehide', "#liveTvRecordingPage", function () {
currentItem = null;
});
})(jQuery, document);

View file

@ -88,8 +88,6 @@
}).done(function (result) {
renderRecordings($('#latestRecordings', page), result.Items);
LibraryBrowser.setLastRefreshed(page);
});
ApiClient.getLiveTvRecordingGroups({

View file

@ -103,8 +103,6 @@
ApiClient.getLiveTvTimers().done(function (result) {
renderTimers(page, result.Items);
LibraryBrowser.setLastRefreshed(page);
});
}

View file

@ -296,9 +296,9 @@
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter || !AppInfo.enableSupporterMembership) {
$('.syncPromotion', page).hide();
$('.supporterPromotionContainer', hide).show();
} else {
$('.syncPromotion', page).show();
$('.supporterPromotionContainer', page).show();
}
});