mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add + button to song lists
This commit is contained in:
parent
dc02d75161
commit
3ed10f65e5
12 changed files with 76 additions and 16 deletions
|
@ -14,12 +14,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.465",
|
||||
"_release": "1.4.465",
|
||||
"version": "1.4.466",
|
||||
"_release": "1.4.466",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.465",
|
||||
"commit": "13b0fddbfbc24ac9dff0db7007be0cde3a94aed2"
|
||||
"tag": "1.4.466",
|
||||
"commit": "ae0866aa2337e97515ea80a82a813b17ef662613"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.1",
|
||||
|
|
|
@ -247,6 +247,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
else if (options.shape === 'square') {
|
||||
options.width = options.width || 243;
|
||||
}
|
||||
else if (options.shape === 'banner') {
|
||||
options.width = options.width || 800;
|
||||
}
|
||||
}
|
||||
|
||||
options.width = options.width || getImageWidth(options.shape);
|
||||
|
@ -504,6 +507,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
if (shape.indexOf('square') !== -1) {
|
||||
return 1;
|
||||
}
|
||||
if (shape.indexOf('banner') !== -1) {
|
||||
return (1000 / 185);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -398,6 +398,10 @@ define(['itemHelper', 'mediaInfo', 'indicators', 'connectionManager', 'layoutMan
|
|||
|
||||
if (!clickEntireItem) {
|
||||
|
||||
if (options.queueButton) {
|
||||
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="queue"><i class="md-icon"></i></button>';
|
||||
}
|
||||
|
||||
if (options.moreButton !== false) {
|
||||
html += '<button is="paper-icon-button-light" class="listItemButton itemAction autoSize" data-action="menu"><i class="md-icon">' + moreIcon + '</i></button>';
|
||||
}
|
||||
|
|
|
@ -2355,7 +2355,36 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g
|
|||
return player.queue(item);
|
||||
}
|
||||
|
||||
// TODO
|
||||
if (options.items) {
|
||||
|
||||
return translateItemsForPlayback(options.items, options).then(function (items) {
|
||||
|
||||
queueAll(items, mode);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
if (!options.serverId) {
|
||||
throw new Error('serverId required!');
|
||||
}
|
||||
|
||||
return getItemsForPlayback(options.serverId, {
|
||||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).then(function (result) {
|
||||
|
||||
return translateItemsForPlayback(result.Items, options).then(function (items) {
|
||||
queueAll(items, mode);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function queueAll(items, mode) {
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
playlist.push(items[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function onPlaybackStarted(player, streamInfo, mediaSource) {
|
||||
|
|
|
@ -209,6 +209,12 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
|
|||
});
|
||||
}
|
||||
|
||||
function sendToast(text) {
|
||||
require(['toast'], function (toast) {
|
||||
toast(text);
|
||||
});
|
||||
}
|
||||
|
||||
function executeAction(card, target, action) {
|
||||
|
||||
target = target || card;
|
||||
|
@ -257,6 +263,22 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g
|
|||
});
|
||||
}
|
||||
|
||||
else if (action === 'queue') {
|
||||
|
||||
if (playbackManager.isPlaying()) {
|
||||
playbackManager.queue({
|
||||
ids: [playableItemId],
|
||||
serverId: serverId
|
||||
});
|
||||
sendToast(globalize.translate('sharedcomponents#MediaQueued'));
|
||||
} else {
|
||||
playbackManager.queue({
|
||||
ids: [playableItemId],
|
||||
serverId: serverId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
else if (action === 'playallfromhere') {
|
||||
playAllFromHere(card, serverId);
|
||||
}
|
||||
|
|
|
@ -377,5 +377,6 @@
|
|||
"SyncJobItemStatusRemovedFromDevice": "Removed from device",
|
||||
"SyncJobItemStatusCancelled": "Cancelled",
|
||||
"Retry": "Retry",
|
||||
"HeaderMyDevice": "My Device"
|
||||
"HeaderMyDevice": "My Device",
|
||||
"MediaQueued": "Media queued."
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue