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

@ -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');
}
};