mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update listviews
This commit is contained in:
parent
722a452b91
commit
c87b1304da
10 changed files with 134 additions and 860 deletions
|
@ -15,12 +15,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.89",
|
"version": "1.4.90",
|
||||||
"_release": "1.4.89",
|
"_release": "1.4.90",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.89",
|
"tag": "1.4.90",
|
||||||
"commit": "fb661d66f08795bad7137b9a193c7fd07d6ab9c8"
|
"commit": "36704279e05a90730af96c13b16c60ecc30cdce8"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.0",
|
"_target": "^1.2.0",
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
button = parentWithAttribute(button, 'data-id');
|
button = parentWithAttribute(button, 'data-id');
|
||||||
var serverId = button.getAttribute('data-serverid');
|
var serverId = button.getAttribute('data-serverid');
|
||||||
var id = button.getAttribute('data-id');
|
var id = button.getAttribute('data-id');
|
||||||
|
var type = button.getAttribute('data-type');
|
||||||
|
|
||||||
var apiClient = connectionManager.getApiClient(serverId);
|
var apiClient = connectionManager.getApiClient(serverId);
|
||||||
|
|
||||||
|
@ -50,7 +51,8 @@
|
||||||
play: true,
|
play: true,
|
||||||
queue: true,
|
queue: true,
|
||||||
playAllFromHere: !item.IsFolder,
|
playAllFromHere: !item.IsFolder,
|
||||||
queueAllFromHere: !item.IsFolder
|
queueAllFromHere: !item.IsFolder,
|
||||||
|
identify: false
|
||||||
|
|
||||||
}).then(function(result) {
|
}).then(function(result) {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', 'playbackManager'], function (appHost, globalize, connectionManager, itemHelper, embyRouter, playbackManager) {
|
define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', 'playbackManager'], function (appHost, globalize, connectionManager, itemHelper, embyRouter, playbackManager) {
|
||||||
|
|
||||||
var isTheater = true;
|
var isTheater = true;
|
||||||
appHost.appInfo().then(function(result) {
|
appHost.appInfo().then(function (result) {
|
||||||
isTheater = result.appName.toLowerCase().indexOf('theater') != -1;
|
isTheater = result.appName.toLowerCase().indexOf('theater') != -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -85,10 +85,12 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.open !== false) {
|
if (options.open !== false) {
|
||||||
commands.push({
|
if (item.Type != 'Timer') {
|
||||||
name: globalize.translate('sharedcomponents#Open'),
|
commands.push({
|
||||||
id: 'open'
|
name: globalize.translate('sharedcomponents#Open'),
|
||||||
});
|
id: 'open'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.play !== false) {
|
if (options.play !== false) {
|
||||||
|
@ -121,19 +123,31 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Policy.IsAdministrator) {
|
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
||||||
|
|
||||||
commands.push({
|
commands.push({
|
||||||
name: globalize.translate('sharedcomponents#Refresh'),
|
name: Globalize.translate('sharedcomponents#Record'),
|
||||||
id: 'refresh'
|
id: 'record'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Type != 'Timer' && user.Policy.EnablePublicSharing && appHost.supports('sharing')) {
|
if (user.Policy.IsAdministrator) {
|
||||||
commands.push({
|
|
||||||
name: globalize.translate('sharedcomponents#Share'),
|
if (item.Type != 'Timer') {
|
||||||
id: 'share'
|
commands.push({
|
||||||
});
|
name: globalize.translate('sharedcomponents#Refresh'),
|
||||||
|
id: 'refresh'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.share !== false) {
|
||||||
|
if (itemHelper.canShare(user, item)) {
|
||||||
|
commands.push({
|
||||||
|
name: globalize.translate('sharedcomponents#Share'),
|
||||||
|
id: 'share'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
|
if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
|
||||||
|
@ -247,10 +261,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
case 'edit':
|
case 'edit':
|
||||||
{
|
{
|
||||||
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
editItem(apiClient, item).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||||
|
|
||||||
metadataeditor.show(itemId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'editimages':
|
case 'editimages':
|
||||||
|
@ -283,28 +294,27 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
}
|
}
|
||||||
case 'play':
|
case 'play':
|
||||||
{
|
{
|
||||||
playbackManager.play({
|
play(item, false);
|
||||||
items: [item]
|
|
||||||
});
|
|
||||||
getResolveFunction(resolve, id)();
|
getResolveFunction(resolve, id)();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'resume':
|
case 'resume':
|
||||||
{
|
{
|
||||||
playbackManager.play({
|
play(item, true);
|
||||||
items: [item]
|
|
||||||
});
|
|
||||||
getResolveFunction(resolve, id)();
|
getResolveFunction(resolve, id)();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'queue':
|
case 'queue':
|
||||||
{
|
{
|
||||||
playbackManager.queue({
|
play(item, false, true);
|
||||||
items: [item]
|
|
||||||
});
|
|
||||||
getResolveFunction(resolve, id)();
|
getResolveFunction(resolve, id)();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'record':
|
||||||
|
require(['recordingCreator'], function (recordingCreator) {
|
||||||
|
recordingCreator.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||||
|
});
|
||||||
|
break;
|
||||||
case 'shuffle':
|
case 'shuffle':
|
||||||
{
|
{
|
||||||
playbackManager.shuffle(item);
|
playbackManager.shuffle(item);
|
||||||
|
@ -375,6 +385,40 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function play(item, resume, queue) {
|
||||||
|
|
||||||
|
var method = queue ? 'queue' : 'play';
|
||||||
|
|
||||||
|
if (item.Type == 'Program') {
|
||||||
|
playbackManager[method]({
|
||||||
|
ids: [item.ChannelId]
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
playbackManager[method]({
|
||||||
|
items: [item]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function editItem(apiClient, item) {
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
if (item.Type == 'Timer') {
|
||||||
|
require(['recordingEditor'], function (recordingEditor) {
|
||||||
|
|
||||||
|
var serverId = apiClient.serverInfo().Id;
|
||||||
|
recordingEditor.show(item.Id, serverId).then(resolve, reject);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
||||||
|
|
||||||
|
metadataeditor.show(item.Id).then(resolve, reject);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function deleteItem(apiClient, itemId) {
|
function deleteItem(apiClient, itemId) {
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define([], function () {
|
define(['apphost'], function (appHost) {
|
||||||
|
|
||||||
function getDisplayName(item, options) {
|
function getDisplayName(item, options) {
|
||||||
|
|
||||||
|
@ -49,6 +49,11 @@ define([], function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsAddingToCollection(item) {
|
function supportsAddingToCollection(item) {
|
||||||
|
|
||||||
|
if (item.Type == 'Timer') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
|
var invalidTypes = ['Person', 'Genre', 'MusicGenre', 'Studio', 'GameGenre', 'BoxSet', 'Playlist', 'UserView', 'CollectionFolder', 'Audio', 'TvChannel', 'Program', 'MusicAlbum', 'Timer'];
|
||||||
|
|
||||||
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
|
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
|
||||||
|
@ -92,7 +97,7 @@ define([], function () {
|
||||||
|
|
||||||
canEdit: function (user, itemType) {
|
canEdit: function (user, itemType) {
|
||||||
|
|
||||||
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView" || itemType == 'Timer') {
|
if (itemType == "UserRootFolder" || /*itemType == "CollectionFolder" ||*/ itemType == "UserView") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +116,14 @@ define([], function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return item.SupportsSync;
|
return item.SupportsSync;
|
||||||
|
},
|
||||||
|
|
||||||
|
canShare: function (user, item) {
|
||||||
|
|
||||||
|
if (item.Type == 'Timer') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return user.Policy.EnablePublicSharing && appHost.supports('sharing');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
|
@ -134,7 +134,10 @@
|
||||||
dlg.addEventListener('close', function () {
|
dlg.addEventListener('close', function () {
|
||||||
|
|
||||||
if (recordingUpdated) {
|
if (recordingUpdated) {
|
||||||
resolve();
|
resolve({
|
||||||
|
updated: true,
|
||||||
|
deleted: false
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,53 +279,25 @@
|
||||||
|
|
||||||
function showMoreMenu(context, button, user) {
|
function showMoreMenu(context, button, user) {
|
||||||
|
|
||||||
var items = [];
|
require(['itemContextMenu'], function (itemContextMenu) {
|
||||||
|
itemContextMenu.show({
|
||||||
|
|
||||||
items.push({
|
item: currentItem,
|
||||||
name: Globalize.translate('ButtonEditImages'),
|
|
||||||
id: 'images'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (itemHelper.canIdentify(user, currentItem.Type)) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonIdentify'),
|
|
||||||
id: 'identify'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonRefresh'),
|
|
||||||
id: 'refresh'
|
|
||||||
});
|
|
||||||
|
|
||||||
require(['actionsheet'], function (actionsheet) {
|
|
||||||
|
|
||||||
actionsheet.show({
|
|
||||||
items: items,
|
|
||||||
positionTo: button,
|
positionTo: button,
|
||||||
callback: function (id) {
|
edit: false,
|
||||||
|
sync: false,
|
||||||
|
share: false
|
||||||
|
|
||||||
switch (id) {
|
}).then(function (result) {
|
||||||
|
|
||||||
case 'identify':
|
if (result.deleted) {
|
||||||
LibraryBrowser.identifyItem(currentItem.Id).then(function () {
|
Emby.Page.goHome();
|
||||||
reload(context, currentItem.Id);
|
|
||||||
});
|
} else if (result.updated) {
|
||||||
break;
|
reload(context, currentItem.Id);
|
||||||
case 'refresh':
|
|
||||||
showRefreshMenu(context, button);
|
|
||||||
break;
|
|
||||||
case 'images':
|
|
||||||
LibraryBrowser.editImages(currentItem.Id);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWebSocketMessageReceived(e, data) {
|
function onWebSocketMessageReceived(e, data) {
|
||||||
|
|
|
@ -417,14 +417,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
canShare: function (item, user) {
|
|
||||||
|
|
||||||
if (item.Type == 'Timer') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return user.Policy.EnablePublicSharing;
|
|
||||||
},
|
|
||||||
|
|
||||||
getDateParamValue: function (date) {
|
getDateParamValue: function (date) {
|
||||||
|
|
||||||
function formatDigit(i) {
|
function formatDigit(i) {
|
||||||
|
@ -685,66 +677,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getMoreCommands: function (item, user) {
|
|
||||||
|
|
||||||
var commands = [];
|
|
||||||
|
|
||||||
if (itemHelper.supportsAddingToCollection(item)) {
|
|
||||||
commands.push('addtocollection');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemHelper.supportsAddingToPlaylist(item)) {
|
|
||||||
commands.push('playlist');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type == 'BoxSet' || item.Type == 'Playlist') {
|
|
||||||
commands.push('delete');
|
|
||||||
}
|
|
||||||
else if (item.CanDelete) {
|
|
||||||
commands.push('delete');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.Policy.IsAdministrator) {
|
|
||||||
|
|
||||||
if (itemHelper.canEdit(user, item.Type)) {
|
|
||||||
commands.push('edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
|
|
||||||
commands.push('editsubtitles');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type != 'Timer') {
|
|
||||||
commands.push('editimages');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.Policy.IsAdministrator) {
|
|
||||||
|
|
||||||
commands.push('refresh');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemHelper.canSync(user, item)) {
|
|
||||||
commands.push('sync');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.CanDownload) {
|
|
||||||
if (appHost.supports('filedownload')) {
|
|
||||||
commands.push('download');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LibraryBrowser.canShare(item, user)) {
|
|
||||||
commands.push('share');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemHelper.canIdentify(user, item.Type)) {
|
|
||||||
commands.push('identify');
|
|
||||||
}
|
|
||||||
|
|
||||||
return commands;
|
|
||||||
},
|
|
||||||
|
|
||||||
deleteItems: function (itemIds) {
|
deleteItems: function (itemIds) {
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
@ -784,18 +716,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
editSubtitles: function (itemId) {
|
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
|
||||||
require(['subtitleEditor'], function (subtitleEditor) {
|
|
||||||
|
|
||||||
var serverId = ApiClient.serverInfo().Id;
|
|
||||||
subtitleEditor.show(itemId, serverId).then(resolve, reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
editMetadata: function (itemId) {
|
editMetadata: function (itemId) {
|
||||||
|
|
||||||
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
require(['components/metadataeditor/metadataeditor'], function (metadataeditor) {
|
||||||
|
@ -804,203 +724,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
editTimer: function (id) {
|
|
||||||
|
|
||||||
require(['recordingEditor'], function (recordingEditor) {
|
|
||||||
|
|
||||||
var serverId = ApiClient.serverInfo().Id;
|
|
||||||
recordingEditor.show(id, serverId);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
showMoreCommands: function (positionTo, itemId, itemType, commands) {
|
|
||||||
|
|
||||||
var items = [];
|
|
||||||
|
|
||||||
if (commands.indexOf('addtocollection') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonAddToCollection'),
|
|
||||||
id: 'addtocollection',
|
|
||||||
ironIcon: 'add'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('playlist') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonAddToPlaylist'),
|
|
||||||
id: 'playlist',
|
|
||||||
ironIcon: 'playlist-add'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('delete') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonDelete'),
|
|
||||||
id: 'delete',
|
|
||||||
ironIcon: 'delete'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('download') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonDownload'),
|
|
||||||
id: 'download',
|
|
||||||
ironIcon: 'file-download'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('edit') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEdit'),
|
|
||||||
id: 'edit',
|
|
||||||
ironIcon: 'mode-edit'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('editimages') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEditImages'),
|
|
||||||
id: 'editimages',
|
|
||||||
ironIcon: 'photo'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('editsubtitles') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEditSubtitles'),
|
|
||||||
id: 'editsubtitles',
|
|
||||||
ironIcon: 'closed-caption'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('identify') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonIdentify'),
|
|
||||||
id: 'identify',
|
|
||||||
ironIcon: 'info'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('refresh') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonRefresh'),
|
|
||||||
id: 'refresh',
|
|
||||||
ironIcon: 'refresh'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('share') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonShare'),
|
|
||||||
id: 'share',
|
|
||||||
ironIcon: 'share'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
|
||||||
var serverId = ApiClient.serverInfo().Id;
|
|
||||||
|
|
||||||
require(['actionsheet'], function (actionsheet) {
|
|
||||||
|
|
||||||
actionsheet.show({
|
|
||||||
items: items,
|
|
||||||
positionTo: positionTo,
|
|
||||||
callback: function (id) {
|
|
||||||
|
|
||||||
switch (id) {
|
|
||||||
|
|
||||||
case 'share':
|
|
||||||
require(['sharingmanager'], function (sharingManager) {
|
|
||||||
sharingManager.showMenu({
|
|
||||||
serverId: serverId,
|
|
||||||
itemId: itemId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'addtocollection':
|
|
||||||
require(['collectionEditor'], function (collectionEditor) {
|
|
||||||
|
|
||||||
new collectionEditor().show({
|
|
||||||
items: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'playlist':
|
|
||||||
require(['playlistEditor'], function (playlistEditor) {
|
|
||||||
new playlistEditor().show({
|
|
||||||
items: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
LibraryBrowser.deleteItems([itemId]);
|
|
||||||
break;
|
|
||||||
case 'download':
|
|
||||||
{
|
|
||||||
require(['fileDownloader'], function (fileDownloader) {
|
|
||||||
|
|
||||||
var downloadHref = ApiClient.getUrl("Items/" + itemId + "/Download", {
|
|
||||||
api_key: ApiClient.accessToken()
|
|
||||||
});
|
|
||||||
|
|
||||||
fileDownloader.download([
|
|
||||||
{
|
|
||||||
url: downloadHref,
|
|
||||||
itemId: itemId,
|
|
||||||
serverId: serverId
|
|
||||||
}]);
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit':
|
|
||||||
if (itemType == 'Timer') {
|
|
||||||
LibraryBrowser.editTimer(itemId);
|
|
||||||
} else {
|
|
||||||
LibraryBrowser.editMetadata(itemId);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'editsubtitles':
|
|
||||||
LibraryBrowser.editSubtitles(itemId).then(resolve, reject);
|
|
||||||
break;
|
|
||||||
case 'editimages':
|
|
||||||
LibraryBrowser.editImages(itemId).then(resolve, reject);
|
|
||||||
break;
|
|
||||||
case 'identify':
|
|
||||||
LibraryBrowser.identifyItem(itemId).then(resolve, reject);
|
|
||||||
break;
|
|
||||||
case 'refresh':
|
|
||||||
require(['refreshDialog'], function (refreshDialog) {
|
|
||||||
new refreshDialog({
|
|
||||||
itemIds: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
}).show();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
identifyItem: function (itemId) {
|
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
|
||||||
require(['components/itemidentifier/itemidentifier'], function (itemidentifier) {
|
|
||||||
|
|
||||||
itemidentifier.show(itemId).then(resolve, reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getHref: function (item, context, topParentId) {
|
getHref: function (item, context, topParentId) {
|
||||||
|
|
||||||
var href = LibraryBrowser.getHrefInternal(item, context);
|
var href = LibraryBrowser.getHrefInternal(item, context);
|
||||||
|
@ -1173,16 +896,10 @@
|
||||||
|
|
||||||
var atts = [];
|
var atts = [];
|
||||||
|
|
||||||
var itemCommands = LibraryBrowser.getItemCommands(item, options);
|
|
||||||
|
|
||||||
atts.push({
|
atts.push({
|
||||||
name: 'itemid',
|
name: 'itemid',
|
||||||
value: item.Id
|
value: item.Id
|
||||||
});
|
});
|
||||||
atts.push({
|
|
||||||
name: 'commands',
|
|
||||||
value: itemCommands.join(',')
|
|
||||||
});
|
|
||||||
|
|
||||||
if (options.context) {
|
if (options.context) {
|
||||||
atts.push({
|
atts.push({
|
||||||
|
@ -1217,28 +934,11 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
atts.push({
|
|
||||||
name: 'playaccess',
|
|
||||||
value: item.PlayAccess || ''
|
|
||||||
});
|
|
||||||
|
|
||||||
atts.push({
|
|
||||||
name: 'locationtype',
|
|
||||||
value: item.LocationType || ''
|
|
||||||
});
|
|
||||||
|
|
||||||
atts.push({
|
atts.push({
|
||||||
name: 'index',
|
name: 'index',
|
||||||
value: index
|
value: index
|
||||||
});
|
});
|
||||||
|
|
||||||
if (item.AlbumId) {
|
|
||||||
atts.push({
|
|
||||||
name: 'albumid',
|
|
||||||
value: item.AlbumId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.ChannelId) {
|
if (item.ChannelId) {
|
||||||
atts.push({
|
atts.push({
|
||||||
name: 'channelid',
|
name: 'channelid',
|
||||||
|
@ -1246,13 +946,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.ArtistItems && item.ArtistItems.length) {
|
|
||||||
atts.push({
|
|
||||||
name: 'artistid',
|
|
||||||
value: item.ArtistItems[0].Id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return atts;
|
return atts;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1271,76 +964,6 @@
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemCommands: function (item, options) {
|
|
||||||
|
|
||||||
var itemCommands = [];
|
|
||||||
|
|
||||||
//if (MediaController.canPlay(item)) {
|
|
||||||
// itemCommands.push('playmenu');
|
|
||||||
//}
|
|
||||||
|
|
||||||
itemCommands.push('edit');
|
|
||||||
|
|
||||||
if (item.LocalTrailerCount) {
|
|
||||||
itemCommands.push('trailer');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.CollectionType == "music") {
|
|
||||||
itemCommands.push('instantmix');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.IsFolder || item.Type == "MusicArtist" || item.Type == "MusicGenre") {
|
|
||||||
itemCommands.push('shuffle');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemHelper.supportsAddingToPlaylist(item)) {
|
|
||||||
|
|
||||||
if (options.showRemoveFromPlaylist) {
|
|
||||||
itemCommands.push('removefromplaylist');
|
|
||||||
} else {
|
|
||||||
itemCommands.push('playlist');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.showAddToCollection !== false) {
|
|
||||||
if (itemHelper.supportsAddingToCollection(item)) {
|
|
||||||
itemCommands.push('addtocollection');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.showRemoveFromCollection) {
|
|
||||||
itemCommands.push('removefromcollection');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.playFromHere) {
|
|
||||||
itemCommands.push('playfromhere');
|
|
||||||
itemCommands.push('queuefromhere');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.CanDelete) {
|
|
||||||
itemCommands.push('delete');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemHelper.canSync({ Policy: {} }, item)) {
|
|
||||||
itemCommands.push('sync');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) {
|
|
||||||
|
|
||||||
itemCommands.push('record');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.MediaType == 'Video' && item.Type != 'TvChannel' && item.Type != 'Program' && item.LocationType != 'Virtual') {
|
|
||||||
itemCommands.push('editsubtitles');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.Type != 'Timer') {
|
|
||||||
itemCommands.push('editimages');
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemCommands;
|
|
||||||
},
|
|
||||||
|
|
||||||
shapes: ['square', 'portrait', 'banner', 'smallBackdrop', 'homePageSmallBackdrop', 'backdrop', 'overflowBackdrop', 'overflowPortrait', 'overflowSquare'],
|
shapes: ['square', 'portrait', 'banner', 'smallBackdrop', 'homePageSmallBackdrop', 'backdrop', 'overflowBackdrop', 'overflowPortrait', 'overflowSquare'],
|
||||||
|
|
||||||
getPostersPerRow: function (screenWidth) {
|
getPostersPerRow: function (screenWidth) {
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOverlayHtml(item, currentUser, card, commands) {
|
function getOverlayHtml(item, currentUser, card) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@
|
||||||
buttonCount++;
|
buttonCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commands.indexOf('trailer') != -1) {
|
if (item.LocalTrailerCount) {
|
||||||
html += '<button is="paper-icon-button-light" class="btnPlayTrailer autoSize" data-itemid="' + item.Id + '"><i class="md-icon">videocam</i></button>';
|
html += '<button is="paper-icon-button-light" class="btnPlayTrailer autoSize" data-itemid="' + item.Id + '"><i class="md-icon">videocam</i></button>';
|
||||||
buttonCount++;
|
buttonCount++;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,12 @@
|
||||||
var card = parentWithClass(this, 'card');
|
var card = parentWithClass(this, 'card');
|
||||||
|
|
||||||
showContextMenu(card, {
|
showContextMenu(card, {
|
||||||
showPlayOptions: false
|
shuffle: false,
|
||||||
|
instantMix: false,
|
||||||
|
play: false,
|
||||||
|
playAllFromHere: false,
|
||||||
|
queue: false,
|
||||||
|
queueAllFromHere: false
|
||||||
});
|
});
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -261,404 +266,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemId = card.getAttribute('data-itemid');
|
var itemId = card.getAttribute('data-itemid');
|
||||||
var playlistItemId = card.getAttribute('data-playlistitemid');
|
|
||||||
|
|
||||||
var commands = card.getAttribute('data-commands').split(',');
|
|
||||||
var itemType = card.getAttribute('data-itemtype');
|
|
||||||
var mediaType = card.getAttribute('data-mediatype');
|
|
||||||
var playbackPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
|
||||||
var playAccess = card.getAttribute('data-playaccess');
|
|
||||||
var locationType = card.getAttribute('data-locationtype');
|
|
||||||
var index = card.getAttribute('data-index');
|
|
||||||
|
|
||||||
var albumid = card.getAttribute('data-albumid');
|
|
||||||
var artistid = card.getAttribute('data-artistid');
|
|
||||||
var serverId = ApiClient.serverInfo().Id;
|
var serverId = ApiClient.serverInfo().Id;
|
||||||
|
var type = card.getAttribute('data-itemtype');
|
||||||
|
|
||||||
Dashboard.getCurrentUser().then(function (user) {
|
var apiClient = ConnectionManager.getApiClient(serverId);
|
||||||
|
|
||||||
var items = [];
|
var promise = type == 'Timer' ? apiClient.getLiveTvTimer(itemId) : apiClient.getItem(apiClient.getCurrentUserId(), itemId);
|
||||||
|
|
||||||
if (commands.indexOf('addtocollection') != -1) {
|
promise.then(function (item) {
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonAddToCollection'),
|
|
||||||
id: 'addtocollection',
|
|
||||||
ironIcon: 'add'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('playlist') != -1) {
|
require(['itemContextMenu'], function (itemContextMenu) {
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonAddToPlaylist'),
|
|
||||||
id: 'playlist',
|
|
||||||
ironIcon: 'playlist-add'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.Policy.EnableContentDownloading && appHost.supports('filedownload')) {
|
|
||||||
if (mediaType) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonDownload'),
|
|
||||||
id: 'download',
|
|
||||||
ironIcon: 'file-download'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('delete') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonDelete'),
|
|
||||||
id: 'delete',
|
|
||||||
ironIcon: 'delete'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.Policy.IsAdministrator) {
|
|
||||||
if (commands.indexOf('edit') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEdit'),
|
|
||||||
id: 'edit',
|
|
||||||
ironIcon: 'mode-edit'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('editimages') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEditImages'),
|
|
||||||
id: 'editimages',
|
|
||||||
ironIcon: 'photo'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('editsubtitles') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonEditSubtitles'),
|
|
||||||
id: 'editsubtitles',
|
|
||||||
ironIcon: 'closed-caption'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('instantmix') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonInstantMix'),
|
|
||||||
id: 'instantmix',
|
|
||||||
ironIcon: 'shuffle'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemType == 'Timer' && user.Policy.EnableLiveTvManagement) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonCancel'),
|
|
||||||
id: 'canceltimer',
|
|
||||||
ironIcon: 'cancel'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
items.push({
|
|
||||||
name: itemType == 'Timer' ? Globalize.translate('ButtonEdit') : Globalize.translate('ButtonOpen'),
|
|
||||||
id: 'open',
|
|
||||||
ironIcon: 'folder-open'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (options.showPlayOptions !== false) {
|
|
||||||
|
|
||||||
if (MediaController.canPlayByAttributes(itemType, mediaType, playAccess, locationType)) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonPlay'),
|
|
||||||
id: 'play',
|
|
||||||
ironIcon: 'play-arrow'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (commands.indexOf('playfromhere') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonPlayAllFromHere'),
|
|
||||||
id: 'playallfromhere',
|
|
||||||
ironIcon: 'play-arrow'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mediaType == 'Video' && AppInfo.supportsExternalPlayers && appSettings.enableExternalPlayers()) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonPlayExternalPlayer'),
|
|
||||||
id: 'externalplayer',
|
|
||||||
ironIcon: 'airplay'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (playbackPositionTicks && mediaType != "Audio") {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonResume'),
|
|
||||||
id: 'resume',
|
|
||||||
ironIcon: 'play-arrow'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('trailer') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonPlayTrailer'),
|
|
||||||
id: 'trailer',
|
|
||||||
ironIcon: 'play-arrow'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MediaController.canQueueMediaType(mediaType, itemType)) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonQueue'),
|
|
||||||
id: 'queue',
|
|
||||||
ironIcon: 'playlist-add'
|
|
||||||
});
|
|
||||||
|
|
||||||
if (commands.indexOf('queuefromhere') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonQueueAllFromHere'),
|
|
||||||
id: 'queueallfromhere',
|
|
||||||
ironIcon: 'playlist-add'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('shuffle') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonShuffle'),
|
|
||||||
id: 'shuffle',
|
|
||||||
ironIcon: 'shuffle'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('record') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonRecord'),
|
|
||||||
id: 'record',
|
|
||||||
ironIcon: 'videocam'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('removefromcollection') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonRemoveFromCollection'),
|
|
||||||
id: 'removefromcollection',
|
|
||||||
ironIcon: 'remove'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('removefromplaylist') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonRemoveFromPlaylist'),
|
|
||||||
id: 'removefromplaylist',
|
|
||||||
ironIcon: 'remove'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user.Policy.EnablePublicSharing && commands.indexOf('share') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonShare'),
|
|
||||||
id: 'share',
|
|
||||||
ironIcon: 'share'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commands.indexOf('sync') != -1) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonSync'),
|
|
||||||
id: 'sync',
|
|
||||||
ironIcon: 'sync'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (albumid) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonViewAlbum'),
|
|
||||||
id: 'album',
|
|
||||||
ironIcon: 'album'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (artistid) {
|
|
||||||
items.push({
|
|
||||||
name: Globalize.translate('ButtonViewArtist'),
|
|
||||||
id: 'artist',
|
|
||||||
ironIcon: 'person'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var href = card.getAttribute('data-href') || card.href;
|
|
||||||
|
|
||||||
if (!href) {
|
|
||||||
var links = card.getElementsByTagName('a');
|
|
||||||
if (links.length) {
|
|
||||||
href = links[0].href;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require(['actionsheet'], function (actionsheet) {
|
|
||||||
|
|
||||||
actionsheet.show({
|
|
||||||
items: items,
|
|
||||||
positionTo: displayContextItem,
|
|
||||||
callback: function (id) {
|
|
||||||
|
|
||||||
switch (id) {
|
|
||||||
|
|
||||||
case 'addtocollection':
|
|
||||||
require(['collectionEditor'], function (collectionEditor) {
|
|
||||||
|
|
||||||
new collectionEditor().show({
|
|
||||||
items: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'playlist':
|
|
||||||
require(['playlistEditor'], function (playlistEditor) {
|
|
||||||
new playlistEditor().show({
|
|
||||||
items: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
LibraryBrowser.deleteItems([itemId]);
|
|
||||||
break;
|
|
||||||
case 'download':
|
|
||||||
{
|
|
||||||
require(['fileDownloader'], function (fileDownloader) {
|
|
||||||
var downloadHref = ApiClient.getUrl("Items/" + itemId + "/Download", {
|
|
||||||
api_key: ApiClient.accessToken()
|
|
||||||
});
|
|
||||||
|
|
||||||
fileDownloader.download([
|
|
||||||
{
|
|
||||||
url: downloadHref,
|
|
||||||
itemId: itemId,
|
|
||||||
serverId: serverId
|
|
||||||
}]);
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit':
|
|
||||||
if (itemType == 'Timer') {
|
|
||||||
LibraryBrowser.editTimer(itemId);
|
|
||||||
} else {
|
|
||||||
LibraryBrowser.editMetadata(itemId);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'refresh':
|
|
||||||
require(['refreshDialog'], function (refreshDialog) {
|
|
||||||
new refreshDialog({
|
|
||||||
itemIds: [itemId],
|
|
||||||
serverId: serverId
|
|
||||||
}).show();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'instantmix':
|
|
||||||
MediaController.instantMix(itemId);
|
|
||||||
break;
|
|
||||||
case 'shuffle':
|
|
||||||
MediaController.shuffle(itemId);
|
|
||||||
break;
|
|
||||||
case 'open':
|
|
||||||
if (itemType == 'Timer') {
|
|
||||||
LibraryBrowser.editTimer(itemId);
|
|
||||||
} else {
|
|
||||||
Dashboard.navigate(href);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'album':
|
|
||||||
Dashboard.navigate('itemdetails.html?id=' + albumid);
|
|
||||||
break;
|
|
||||||
case 'record':
|
|
||||||
require(['recordingCreator'], function (recordingCreator) {
|
|
||||||
recordingCreator.show(itemId, serverId);
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'artist':
|
|
||||||
Dashboard.navigate('itemdetails.html?context=music&id=' + artistid);
|
|
||||||
break;
|
|
||||||
case 'play':
|
|
||||||
MediaController.play(itemId);
|
|
||||||
break;
|
|
||||||
case 'playallfromhere':
|
|
||||||
playAllFromHere(index, parentWithClass(card, 'itemsContainer'), 'play');
|
|
||||||
break;
|
|
||||||
case 'queue':
|
|
||||||
MediaController.queue(itemId);
|
|
||||||
break;
|
|
||||||
case 'trailer':
|
|
||||||
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), itemId).then(function (trailers) {
|
|
||||||
MediaController.play({ items: trailers });
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'resume':
|
|
||||||
MediaController.play({
|
|
||||||
ids: [itemId],
|
|
||||||
startPositionTicks: playbackPositionTicks
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'queueallfromhere':
|
|
||||||
playAllFromHere(index, parentWithClass(card, 'itemsContainer'), 'queue');
|
|
||||||
break;
|
|
||||||
case 'sync':
|
|
||||||
require(['syncDialog'], function (syncDialog) {
|
|
||||||
syncDialog.showMenu({
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
Id: itemId
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'editsubtitles':
|
|
||||||
LibraryBrowser.editSubtitles(itemId);
|
|
||||||
break;
|
|
||||||
case 'editimages':
|
|
||||||
LibraryBrowser.editImages(itemId);
|
|
||||||
break;
|
|
||||||
case 'externalplayer':
|
|
||||||
LibraryBrowser.playInExternalPlayer(itemId);
|
|
||||||
break;
|
|
||||||
case 'canceltimer':
|
|
||||||
deleteTimer(itemId, parentWithClass(card, 'itemsContainer'));
|
|
||||||
break;
|
|
||||||
case 'share':
|
|
||||||
require(['sharingmanager'], function (sharingManager) {
|
|
||||||
sharingManager.showMenu({
|
|
||||||
serverId: serverId,
|
|
||||||
itemId: itemId
|
|
||||||
});
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case 'removefromplaylist':
|
|
||||||
var itemsContainer = parentWithClass(card, 'itemsContainer');
|
|
||||||
if (itemsContainer) {
|
|
||||||
itemsContainer.dispatchEvent(new CustomEvent('removefromplaylist', {
|
|
||||||
detail: {
|
|
||||||
playlistItemId: playlistItemId
|
|
||||||
},
|
|
||||||
cancelable: false
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'removefromcollection':
|
|
||||||
var itemsContainer = parentWithClass(card, 'collectionItems');
|
|
||||||
if (itemsContainer) {
|
|
||||||
itemsContainer.dispatchEvent(new CustomEvent('removefromcollection', {
|
|
||||||
detail: {
|
|
||||||
itemId: itemId
|
|
||||||
},
|
|
||||||
cancelable: false
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
itemContextMenu.show(Object.assign(options || {}, {
|
||||||
|
item: item,
|
||||||
|
positionTo: displayContextItem
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -845,7 +467,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var id = dataElement.getAttribute('data-itemid');
|
var id = dataElement.getAttribute('data-itemid');
|
||||||
var commands = dataElement.getAttribute('data-commands').split(',');
|
var type = dataElement.getAttribute('data-itemtype');
|
||||||
|
|
||||||
|
if (type == 'Timer') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), id);
|
var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), id);
|
||||||
var promise2 = Dashboard.getCurrentUser();
|
var promise2 = Dashboard.getCurrentUser();
|
||||||
|
@ -861,7 +487,7 @@
|
||||||
card = card.parentNode;
|
card = card.parentNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
innerElem.innerHTML = getOverlayHtml(item, user, card, commands);
|
innerElem.innerHTML = getOverlayHtml(item, user, card);
|
||||||
|
|
||||||
var btnPlayItem = innerElem.querySelector('.btnPlayItem');
|
var btnPlayItem = innerElem.querySelector('.btnPlayItem');
|
||||||
if (btnPlayItem) {
|
if (btnPlayItem) {
|
||||||
|
@ -1416,15 +1042,6 @@
|
||||||
|
|
||||||
MediaController.instantMix(itemId);
|
MediaController.instantMix(itemId);
|
||||||
}
|
}
|
||||||
else if (action == 'edit') {
|
|
||||||
|
|
||||||
var itemType = elemWithAttributes.getAttribute('data-itemtype');
|
|
||||||
if (itemType == 'Timer') {
|
|
||||||
LibraryBrowser.editTimer(itemId);
|
|
||||||
} else {
|
|
||||||
LibraryBrowser.editMetadata(itemId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
@ -76,9 +76,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableScrollX()) {
|
if (enableScrollX()) {
|
||||||
html += '<div class="itemsContainer hiddenScrollX">';
|
html += '<div is="emby-itemscontainer" class="itemsContainer hiddenScrollX">';
|
||||||
} else {
|
} else {
|
||||||
html += '<div class="itemsContainer">';
|
html += '<div is="emby-itemscontainer" class="itemsContainer">';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += LibraryBrowser.getPosterViewHtml({
|
html += LibraryBrowser.getPosterViewHtml({
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['scripts/livetvcomponents', 'emby-button', 'listViewStyle'], function () {
|
define(['scripts/livetvcomponents', 'emby-button', 'listViewStyle', 'emby-itemscontainer'], function () {
|
||||||
|
|
||||||
function getRecordingGroupHtml(group) {
|
function getRecordingGroupHtml(group) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue