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

add playback of in-progress recordings

This commit is contained in:
Luke Pulverenti 2016-10-09 03:18:43 -04:00
parent ca36b18094
commit 2077019d9a
20 changed files with 88 additions and 395 deletions

View file

@ -355,7 +355,7 @@
}
else if (item.TimerId) {
status = item.TimerStatus;
status = item.Status;
}
else if (item.Type == 'Timer') {

View file

@ -105,7 +105,7 @@ define(['css!./indicators.css', 'material-icons'], function () {
}
else if (item.TimerId) {
status = item.TimerStatus;
status = item.Status;
}
else if (item.Type == 'Timer') {

View file

@ -58,7 +58,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (itemHelper.canEdit(user, item.Type)) {
if (itemHelper.canEdit(user, item)) {
if (options.edit !== false && item.Type != 'SeriesTimer') {
@ -71,7 +71,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (itemHelper.canEditImages(user, item.Type)) {
if (itemHelper.canEditImages(user, item)) {
if (options.editImages !== false) {
commands.push({
@ -81,9 +81,9 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
}
}
if (itemHelper.canEdit(user, item.Type)) {
if (itemHelper.canEdit(user, item)) {
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual' && !(item.Type == 'Recording' && item.Status != 'Completed')) {
if (options.editSubtitles !== false) {
commands.push({
name: globalize.translate('sharedcomponents#EditSubtitles'),
@ -176,7 +176,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
if (user.Policy.IsAdministrator) {
if (item.Type != 'Timer' && item.Type != 'SeriesTimer' && item.Type != 'Program') {
if (item.Type != 'Timer' && item.Type != 'SeriesTimer' && item.Type != 'Program' && !(item.Type == 'Recording' && item.Status != 'Completed')) {
commands.push({
name: globalize.translate('sharedcomponents#Refresh'),
id: 'refresh'

View file

@ -56,6 +56,12 @@ define(['apphost'], function (appHost) {
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
return false;
}
}
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
}
@ -70,10 +76,19 @@ define(['apphost'], function (appHost) {
if (item.Type == 'SeriesTimer') {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
return false;
}
}
return item.MediaType || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist";
}
function canEdit(user, itemType) {
function canEdit(user, item) {
var itemType = item.Type;
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView") {
return false;
@ -83,12 +98,13 @@ define(['apphost'], function (appHost) {
return false;
}
if (user.Policy.IsAdministrator) {
return true;
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
return false;
}
}
return false;
return user.Policy.IsAdministrator;
}
return {
@ -119,7 +135,9 @@ define(['apphost'], function (appHost) {
canEdit: canEdit,
canEditImages: function (user, itemType) {
canEditImages: function (user, item) {
var itemType = item.Type;
if (itemType == 'UserView') {
if (user.Policy.IsAdministrator) {
@ -130,7 +148,13 @@ define(['apphost'], function (appHost) {
return false;
}
return itemType != 'Timer' && itemType != 'SeriesTimer' && canEdit(user, itemType);
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
return false;
}
}
return itemType != 'Timer' && itemType != 'SeriesTimer' && canEdit(user, item);
},
canSync: function (user, item) {
@ -150,6 +174,11 @@ define(['apphost'], function (appHost) {
if (item.Type == 'SeriesTimer') {
return false;
}
if (item.Type == 'Recording') {
if (item.Status != 'Completed') {
return false;
}
}
return user.Policy.EnablePublicSharing && appHost.supports('sharing');
}
};

View file

@ -9,7 +9,7 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', '
}
else if (item.TimerId) {
status = item.TimerStatus;
status = item.Status;
}
else if (item.Type == 'Timer') {

View file

@ -117,7 +117,7 @@
parent.querySelector('.seriesRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#RecordSeries');
}
if (program.TimerId && program.TimerStatus != 'Cancelled') {
if (program.TimerId && program.Status != 'Cancelled') {
parent.querySelector('.btnManageRecording').classList.remove('visibilityHide');
parent.querySelector('.singleRecordingButton .recordingIcon').classList.add('recordingIcon-active');
parent.querySelector('.singleRecordingButton .buttonText').innerHTML = globalize.translate('sharedcomponents#DoNotRecord');
@ -138,7 +138,7 @@
return apiClient.getLiveTvProgram(options.programId, apiClient.getCurrentUserId()).then(function (program) {
instance.TimerId = program.TimerId;
instance.TimerStatus = program.TimerStatus;
instance.Status = program.Status;
instance.SeriesTimerId = program.SeriesTimerId;
loadData(options.parent, program, apiClient);
@ -162,7 +162,7 @@
var options = this.options;
if (!this.TimerId || this.TimerStatus == 'Cancelled') {
if (!this.TimerId || this.Status == 'Cancelled') {
return;
}
@ -213,7 +213,7 @@
var button = dom.parentWithTag(e.target, 'BUTTON');
var isChecked = !button.querySelector('i').classList.contains('recordingIcon-active');
var hasEnabledTimer = this.TimerId && this.TimerStatus != 'Cancelled';
var hasEnabledTimer = this.TimerId && this.Status != 'Cancelled';
if (isChecked) {
if (!hasEnabledTimer) {