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

add sports and kids recording categories

This commit is contained in:
Luke Pulverenti 2016-09-06 13:59:10 -04:00
parent 5ec5a0d9fa
commit 1efcc067f0
14 changed files with 122 additions and 103 deletions

View file

@ -108,19 +108,19 @@
if (params.IsMovie == 'true') {
query.IsMovie = true;
}
else if (params.IsMovie == 'true') {
else if (params.IsMovie == 'false') {
query.IsMovie = false;
}
if (params.IsSports == 'true') {
query.IsSports = true;
}
else if (params.IsSports == 'true') {
else if (params.IsSports == 'false') {
query.IsSports = false;
}
if (params.IsKids == 'true') {
query.IsKids = true;
}
else if (params.IsKids == 'true') {
else if (params.IsKids == 'false') {
query.IsKids = false;
}

View file

@ -53,18 +53,6 @@
indexByDate: false
});
});
//ApiClient.getLiveTvRecordings({
// userId: Dashboard.getCurrentUserId(),
// IsInProgress: true,
// Fields: 'CanDelete'
//}).then(function (result) {
// renderRecordings(context.querySelector('#activeRecordings'), result.Items);
//});
}
function renderLatestRecordings(context) {
@ -107,7 +95,7 @@
function renderEpisodeRecordings(context) {
ApiClient.getLiveTvRecordings({
ApiClient.getLiveTvRecordingSeries({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
@ -118,11 +106,14 @@
}).then(function (result) {
renderRecordings(context.querySelector('#episodeRecordings'), result.Items);
renderRecordings(context.querySelector('#episodeRecordings'), result.Items, {
showItemCounts: true,
showParentTitle: false
});
});
}
function renderProgramRecordings(context) {
function renderSportsRecordings(context) {
ApiClient.getLiveTvRecordings({
@ -131,12 +122,31 @@
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsMovie: false,
IsSeries: false
IsSports: true
}).then(function (result) {
renderRecordings(context.querySelector('#programRecordings'), result.Items, {
renderRecordings(context.querySelector('#sportsRecordings'), result.Items, {
showYear: true,
showParentTitle: false
});
});
}
function renderKidsRecordings(context) {
ApiClient.getLiveTvRecordings({
UserId: Dashboard.getCurrentUserId(),
Limit: enableScrollX() ? 12 : 8,
IsInProgress: false,
Fields: 'CanDelete,PrimaryImageAspectRatio,BasicSyncInfo',
EnableTotalRecordCount: false,
IsKids: true
}).then(function (result) {
renderRecordings(context.querySelector('#kidsRecordings'), result.Items, {
showYear: true,
showParentTitle: false
});
@ -169,7 +179,8 @@
renderLatestRecordings(context);
renderMovieRecordings(context);
renderEpisodeRecordings(context);
renderProgramRecordings(context);
renderSportsRecordings(context);
renderKidsRecordings(context);
}
function onMoreClick(e) {
@ -189,6 +200,12 @@
case 'programs':
Dashboard.navigate('livetvitems.html?type=Recordings&IsSeries=false&IsMovie=false');
break;
case 'kids':
Dashboard.navigate('livetvitems.html?type=Recordings&IsKids=true');
break;
case 'sports':
Dashboard.navigate('livetvitems.html?type=Recordings&IsSports=true');
break;
default:
break;
}

View file

@ -1,5 +1,24 @@
define(['scripts/livetvcomponents', 'emby-button', 'emby-itemscontainer'], function () {
function renderActiveRecordings(context) {
ApiClient.getLiveTvTimers({
IsActive: true
}).then(function (result) {
// The IsActive param is new, so handle older servers that don't support it
if (result.Items.length && result.Items[0].Status != 'InProgress') {
result.Items = [];
}
renderTimers(context.querySelector('#activeRecordings'), result.Items, {
indexByDate: false
});
});
}
function renderTimers(context, timers, options) {
LiveTvHelpers.getTimersHtml(timers, options).then(function (html) {
@ -33,6 +52,7 @@
Dashboard.showLoadingMsg();
renderActiveRecordings(context);
renderUpcomingRecordings(context);
}