mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
collection fixes
This commit is contained in:
parent
8f05744009
commit
add9159c97
10 changed files with 280 additions and 294 deletions
|
@ -679,7 +679,7 @@
|
|||
|
||||
var commands = [];
|
||||
|
||||
if (BoxSetEditor.supportsAddingToCollection(item)) {
|
||||
if (LibraryBrowser.supportsAddingToCollection(item)) {
|
||||
commands.push('addtocollection');
|
||||
}
|
||||
|
||||
|
@ -894,7 +894,10 @@
|
|||
});
|
||||
break;
|
||||
case 'addtocollection':
|
||||
BoxSetEditor.showPanel([itemId]);
|
||||
require(['collectioneditor'], function (collectioneditor) {
|
||||
|
||||
new collectioneditor().show([itemId]);
|
||||
});
|
||||
break;
|
||||
case 'playlist':
|
||||
PlaylistManager.showPanel([itemId]);
|
||||
|
@ -1446,6 +1449,13 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
supportsAddingToCollection: function (item) {
|
||||
|
||||
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'Episode', 'TvChannel', 'Program'];
|
||||
|
||||
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
|
||||
},
|
||||
|
||||
getItemCommands: function (item, options) {
|
||||
|
||||
var itemCommands = [];
|
||||
|
@ -1478,7 +1488,7 @@
|
|||
}
|
||||
|
||||
if (options.showAddToCollection !== false) {
|
||||
if (BoxSetEditor.supportsAddingToCollection(item)) {
|
||||
if (LibraryBrowser.supportsAddingToCollection(item)) {
|
||||
itemCommands.push('addtocollection');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue