1
0
Fork 0
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:
Luke Pulverenti 2016-05-22 02:08:44 -04:00
parent dcb6b103ec
commit 6a539b8f3a
13 changed files with 362 additions and 303 deletions

View file

@ -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) {