mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
use shared playlist editor
This commit is contained in:
parent
dcb6b103ec
commit
6a539b8f3a
13 changed files with 362 additions and 303 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['apphost', 'globalize', 'connectionManager'], function (appHost, globalize, connectionManager) {
|
||||
define(['apphost', 'globalize', 'connectionManager', 'itemHelper'], function (appHost, globalize, connectionManager, itemHelper) {
|
||||
|
||||
function getCommands(options) {
|
||||
|
||||
|
@ -11,10 +11,19 @@ define(['apphost', 'globalize', 'connectionManager'], function (appHost, globali
|
|||
|
||||
var commands = [];
|
||||
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#AddToCollection'),
|
||||
id: 'addtocollection'
|
||||
});
|
||||
if (itemHelper.supportsAddingToCollection(item)) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#AddToCollection'),
|
||||
id: 'addtocollection'
|
||||
});
|
||||
}
|
||||
|
||||
if (itemHelper.supportsAddingToPlaylist(item)) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#AddToPlaylist'),
|
||||
id: 'addtoplaylist'
|
||||
});
|
||||
}
|
||||
|
||||
if (item.CanDelete) {
|
||||
commands.push({
|
||||
|
@ -71,6 +80,18 @@ define(['apphost', 'globalize', 'connectionManager'], function (appHost, globali
|
|||
});
|
||||
break;
|
||||
}
|
||||
case 'addtoplaylist':
|
||||
{
|
||||
require(['playlistEditor'], function (playlistEditor) {
|
||||
|
||||
new playlistEditor().show({
|
||||
items: [itemId],
|
||||
serverId: serverId
|
||||
|
||||
}).then(reject, reject);
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'download':
|
||||
{
|
||||
require(['fileDownloader'], function (fileDownloader) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue