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

Merge pull request #4183 from SenorSmartyPants/SeriesTimerUI

Display whole channel icon and new/repeat/live/premiere flags on timer list
This commit is contained in:
Bill Thornton 2023-02-08 17:25:01 -05:00 committed by GitHub
commit 52e5cce3ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 47 deletions

View file

@ -96,33 +96,26 @@ function getContextMenuOptions(item, user, button) {
};
}
function getProgramScheduleHtml(items) {
let html = '';
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-list" data-contextmenu="false">';
html += listView.getListViewHtml({
function getProgramScheduleHtml(items, action = 'none') {
return listView.getListViewHtml({
items: items,
enableUserDataButtons: false,
image: true,
imageSource: 'channel',
showProgramDateTime: true,
showChannel: false,
mediaInfo: false,
action: 'none',
mediaInfo: true,
runtime: false,
action,
moreButton: false,
recordButton: false
});
html += '</div>';
return html;
}
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
apiClient.getLiveTvTimers({
UserId: apiClient.getCurrentUserId(),
ImageTypeLimit: 1,
EnableImageTypes: 'Primary,Backdrop,Thumb',
SortBy: 'StartDate',
EnableTotalRecordCount: false,
EnableUserData: false,
@ -134,7 +127,7 @@ function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
}
const html = getProgramScheduleHtml(result.Items);
const scheduleTab = page.querySelector('.seriesTimerSchedule');
const scheduleTab = page.querySelector('#seriesTimerSchedule');
scheduleTab.innerHTML = html;
imageLoader.lazyChildren(scheduleTab);
});
@ -162,13 +155,13 @@ function renderSeriesTimerEditor(page, item, apiClient, user) {
});
});
page.querySelector('.seriesTimerScheduleSection').classList.remove('hide');
page.querySelector('#seriesTimerScheduleSection').classList.remove('hide');
hideAll(page, 'btnCancelSeriesTimer', true);
renderSeriesTimerSchedule(page, apiClient, item.Id);
return;
}
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
page.querySelector('#seriesTimerScheduleSection').classList.add('hide');
hideAll(page, 'btnCancelSeriesTimer');
}
@ -1623,13 +1616,13 @@ function renderSeriesSchedule(page, item) {
const apiClient = ServerConnections.getApiClient(item.ServerId);
apiClient.getLiveTvPrograms({
UserId: apiClient.getCurrentUserId(),
ImageTypeLimit: 1,
HasAired: false,
SortBy: 'StartDate',
EnableTotalRecordCount: false,
EnableImages: false,
ImageTypeLimit: 0,
Limit: 50,
EnableUserData: false,
Fields: 'ChannelInfo,ChannelImage',
LibrarySeriesId: item.Id
}).then(function (result) {
if (result.Items.length) {
@ -1638,17 +1631,11 @@ function renderSeriesSchedule(page, item) {
page.querySelector('#seriesScheduleSection').classList.add('hide');
}
page.querySelector('#seriesScheduleList').innerHTML = listView.getListViewHtml({
items: result.Items,
enableUserDataButtons: false,
showParentTitle: false,
image: false,
showProgramDateTime: true,
mediaInfo: false,
showTitle: true,
moreButton: false,
action: 'programdialog'
});
const html = getProgramScheduleHtml(result.Items, 'programdialog');
const scheduleTab = page.querySelector('#seriesScheduleList');
scheduleTab.innerHTML = html;
imageLoader.lazyChildren(scheduleTab);
loading.hide();
});
}