diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index bd034d0a0f..4480485a45 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -15,12 +15,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.90", - "_release": "1.4.90", + "version": "1.4.91", + "_release": "1.4.91", "_resolution": { "type": "version", - "tag": "1.4.90", - "commit": "36704279e05a90730af96c13b16c60ecc30cdce8" + "tag": "1.4.91", + "commit": "a4c5466d5a59e57b157aa941fcadb1e0df602f75" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js index 3ff151b3dd..6d40530d21 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js +++ b/dashboard-ui/bower_components/emby-webcomponents/actionsheet/actionsheet.js @@ -112,8 +112,8 @@ } else { dialogOptions.modal = false; - dialogOptions.entryAnimationDuration = 160; - dialogOptions.exitAnimationDuration = 200; + dialogOptions.entryAnimationDuration = 140; + dialogOptions.exitAnimationDuration = 180; dialogOptions.autoFocus = false; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js b/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js index 1c7b58158e..751c121495 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js @@ -40,10 +40,18 @@ return apiClient.getItem(apiClient.getCurrentUserId(), id); } - function showContextMenu(button) { + function showContextMenu(button, itemsContainer) { getItem(button).then(function (item) { + var playlistId = itemsContainer.getAttribute('data-playlistid'); + var collectionId = itemsContainer.getAttribute('data-collectionid'); + + if (playlistId) { + var elem = parentWithAttribute(button, 'data-playlistitemid'); + item.PlaylistItemId = elem ? elem.getAttribute('data-playlistitemid') : null; + } + require(['itemContextMenu'], function (itemContextMenu) { itemContextMenu.show({ positionTo: button, @@ -52,13 +60,23 @@ queue: true, playAllFromHere: !item.IsFolder, queueAllFromHere: !item.IsFolder, - identify: false + identify: false, + playlistId: playlistId, + collectionId: collectionId - }).then(function(result) { + }).then(function (result) { if (result.command == 'playallfromhere' || result.command == 'queueallfromhere') { itemShortcuts.execute(button, result.command); } + else if (result.command == 'removefromplaylist' || result.command == 'removefromcollection') { + + itemsContainer.dispatchEvent(new CustomEvent('needsrefresh', { + detail: {}, + cancelable: false, + bubbles: true + })); + } }); }); }); @@ -66,9 +84,11 @@ function onClick(e) { + var itemsContainer = this; + var menuButton = parentWithClass(e.target, 'menuButton'); if (menuButton) { - showContextMenu(menuButton); + showContextMenu(menuButton, itemsContainer); e.stopPropagation(); return false; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 17d5561e83..8d8afc0752 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -12,6 +12,8 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', var serverId = item.ServerId; var apiClient = connectionManager.getApiClient(serverId); + var canPlay = playbackManager.canPlay(item); + return apiClient.getCurrentUser().then(function (user) { var commands = []; @@ -42,7 +44,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', if (!isTheater) { commands.push({ - name: globalize.translate('sharedcomponents#Edit'), + name: globalize.translate('sharedcomponents#EditInfo'), id: 'edit' }); commands.push({ @@ -85,7 +87,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } if (options.open !== false) { - if (item.Type != 'Timer') { + if (item.Type != 'Timer' && item.Type != 'Audio') { commands.push({ name: globalize.translate('sharedcomponents#Open'), id: 'open' @@ -93,34 +95,36 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } - if (options.play !== false) { - commands.push({ - name: globalize.translate('sharedcomponents#Play'), - id: 'resume' - }); - } - - if (options.playAllFromHere) { - commands.push({ - name: globalize.translate('sharedcomponents#PlayAllFromHere'), - id: 'playallfromhere' - }); - } - - if (playbackManager.canQueueMediaType(item.MediaType)) { - if (options.queue !== false) { + if (canPlay) { + if (options.play !== false) { commands.push({ - name: globalize.translate('sharedcomponents#Queue'), - id: 'queue' + name: globalize.translate('sharedcomponents#Play'), + id: 'resume' }); } - if (options.queueAllFromHere) { + if (options.playAllFromHere) { commands.push({ - name: globalize.translate('sharedcomponents#QueueAllFromHere'), - id: 'queueallfromhere' + name: globalize.translate('sharedcomponents#PlayAllFromHere'), + id: 'playallfromhere' }); } + + if (playbackManager.canQueueMediaType(item.MediaType)) { + if (options.queue !== false) { + commands.push({ + name: globalize.translate('sharedcomponents#Queue'), + id: 'queue' + }); + } + + if (options.queueAllFromHere) { + commands.push({ + name: globalize.translate('sharedcomponents#QueueAllFromHere'), + id: 'queueallfromhere' + }); + } + } } if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) { @@ -141,6 +145,20 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } + if (item.PlaylistItemId && options.playlistId) { + commands.push({ + name: globalize.translate('sharedcomponents#RemoveFromPlaylist'), + id: 'removefromplaylist' + }); + } + + if (options.collectionId) { + commands.push({ + name: globalize.translate('sharedcomponents#RemoveFromCollection'), + id: 'removefromcollection' + }); + } + if (options.share !== false) { if (itemHelper.canShare(user, item)) { commands.push({ @@ -197,7 +215,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }; } - function executeCommand(item, id) { + function executeCommand(item, id, options) { var itemId = item.Id; var serverId = item.ServerId; @@ -378,6 +396,37 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', getResolveFunction(resolve, id)(); break; } + case 'removefromplaylist': + + apiClient.ajax({ + + url: apiClient.getUrl('Playlists/' + options.playlistId + '/Items', { + EntryIds: [item.PlaylistItemId].join(',') + }), + + type: 'DELETE' + + }).then(function () { + + getResolveFunction(resolve, id, true)(); + }); + + break; + case 'removefromcollection': + + apiClient.ajax({ + type: "DELETE", + url: apiClient.getUrl("Collections/" + options.collectionId + "/Items", { + + Ids: [item.Id].join(',') + }) + + }).then(function () { + + getResolveFunction(resolve, id, true)(); + }); + + break; default: reject(); break; @@ -464,7 +513,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', positionTo: options.positionTo }).then(function (id) { - executeCommand(options.item, id).then(resolve); + executeCommand(options.item, id, options).then(resolve); }, reject); }); }); diff --git a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js index dec497e8a1..77e78850e5 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js +++ b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js @@ -237,6 +237,10 @@ define(['datetime', 'globalize', 'embyRouter', 'material-icons', 'css!./mediainf miscInfo.push(item.Width + "x" + item.Height); } + if (item.Type == 'Audio' && item.Container) { + miscInfo.push(item.Container); + } + html += miscInfo.map(function (m) { return getMediaInfoItem(m); }).join(''); diff --git a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json index d5924228cc..3078e9bbed 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json +++ b/dashboard-ui/bower_components/emby-webcomponents/strings/en-US.json @@ -105,10 +105,12 @@ "Shuffle": "Shuffle", "Identify": "Identify", "EditImages": "Edit Images", + "EditInfo": "Edit Info", "Sync": "Sync", "InstantMix": "Instant Mix", "ViewAlbum": "View Album", "ViewArtist": "View Artist", "QueueAllFromHere": "Queue All from Here", - "PlayAllFromHere": "Play All from Here" + "PlayAllFromHere": "Play All from Here", + "RemoveFromPlaylist": "Remove from Playlist" } \ No newline at end of file diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index b1c94daa49..42c17211a0 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -881,11 +881,11 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { font-size: 200%; } -.playedIndicator + .syncIndicator { +.playedIndicator + .syncIndicator, .countIndicator + .syncIndicator { top: 32px; } -.card .playedIndicator { +.card .playedIndicator, .card .countIndicator { position: absolute; top: 5px; right: 5px; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 8fbe7fa9a4..810ff0b21d 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1,4 +1,4 @@ -define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'scrollStyles'], function (layoutManager, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper) { +define(['layoutManager', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'scrollStyles', 'emby-itemscontainer'], function (layoutManager, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper) { var currentItem; @@ -1133,7 +1133,7 @@ html += ''; html += ''; - html += '