mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Contributors file updated correctly
Adds shortcuts.js function to get sort order Added sort order technique to most types of media on playbackmanager.js
This commit is contained in:
parent
ecba6dccb9
commit
f922742d86
3 changed files with 28 additions and 17 deletions
|
@ -66,6 +66,7 @@
|
||||||
- [Fishbigger](https://github.com/fishbigger)
|
- [Fishbigger](https://github.com/fishbigger)
|
||||||
- [sleepycatcoding](https://github.com/sleepycatcoding)
|
- [sleepycatcoding](https://github.com/sleepycatcoding)
|
||||||
- [TheMelmacian](https://github.com/TheMelmacian)
|
- [TheMelmacian](https://github.com/TheMelmacian)
|
||||||
|
- [v0idMrK](https://github.com/v0idMrK)
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
|
||||||
|
@ -132,4 +133,3 @@
|
||||||
- [jomp16](https://github.com/jomp16)
|
- [jomp16](https://github.com/jomp16)
|
||||||
- [Leon de Klerk](https://github.com/leondeklerk)
|
- [Leon de Klerk](https://github.com/leondeklerk)
|
||||||
- [CrispyBaguette](https://github.com/CrispyBaguette)
|
- [CrispyBaguette](https://github.com/CrispyBaguette)
|
||||||
- [v0idMrK](https://github.com/v0idMrK)
|
|
||||||
|
|
|
@ -1773,6 +1773,18 @@ class PlaybackManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSortOptions(options) {
|
||||||
|
const sortOptions = options.sortOptions || {};
|
||||||
|
let sortByValue = options.shuffle ? 'Random' : sortOptions.sortBy;
|
||||||
|
if (sortByValue == null) {
|
||||||
|
sortByValue = 'SortName';
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
sortBy: sortByValue,
|
||||||
|
sortOrder: sortOptions.sortOrder
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function translateItemsForPlayback(items, options) {
|
function translateItemsForPlayback(items, options) {
|
||||||
if (items.length > 1 && options && options.ids) {
|
if (items.length > 1 && options && options.ids) {
|
||||||
// Use the original request id array for sorting the result in the proper order
|
// Use the original request id array for sorting the result in the proper order
|
||||||
|
@ -1788,6 +1800,8 @@ class PlaybackManager {
|
||||||
|
|
||||||
const queryOptions = options.queryOptions || {};
|
const queryOptions = options.queryOptions || {};
|
||||||
|
|
||||||
|
const sortOptions = getSortOptions(options);
|
||||||
|
|
||||||
if (firstItem.Type === 'Program') {
|
if (firstItem.Type === 'Program') {
|
||||||
promise = getItemsForPlayback(serverId, {
|
promise = getItemsForPlayback(serverId, {
|
||||||
Ids: firstItem.ChannelId
|
Ids: firstItem.ChannelId
|
||||||
|
@ -1802,21 +1816,17 @@ class PlaybackManager {
|
||||||
ArtistIds: firstItem.Id,
|
ArtistIds: firstItem.Id,
|
||||||
Filters: 'IsNotFolder',
|
Filters: 'IsNotFolder',
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
SortBy: options.shuffle ? 'Random' : 'SortName',
|
SortBy: sortOptions.sortBy,
|
||||||
|
SortOrder: sortOptions.sortOrder,
|
||||||
MediaTypes: 'Audio'
|
MediaTypes: 'Audio'
|
||||||
});
|
});
|
||||||
} else if (firstItem.MediaType === 'Photo') {
|
} else if (firstItem.MediaType === 'Photo') {
|
||||||
const sortOptions = options.sortOptions || {};
|
|
||||||
let sortByValue = options.shuffle ? 'Random' : sortOptions.sortBy;
|
|
||||||
if (sortByValue == null) {
|
|
||||||
sortByValue = 'SortName';
|
|
||||||
}
|
|
||||||
promise = getItemsForPlayback(serverId, {
|
promise = getItemsForPlayback(serverId, {
|
||||||
ParentId: firstItem.ParentId,
|
ParentId: firstItem.ParentId,
|
||||||
Filters: 'IsNotFolder',
|
Filters: 'IsNotFolder',
|
||||||
// Setting this to true may cause some incorrect sorting
|
// Setting this to true may cause some incorrect sorting
|
||||||
Recursive: false,
|
Recursive: false,
|
||||||
SortBy: sortByValue,
|
SortBy: sortOptions.sortBy,
|
||||||
SortOrder: sortOptions.sortOrder,
|
SortOrder: sortOptions.sortOrder,
|
||||||
MediaTypes: 'Photo,Video',
|
MediaTypes: 'Photo,Video',
|
||||||
Limit: UNLIMITED_ITEMS
|
Limit: UNLIMITED_ITEMS
|
||||||
|
@ -1841,7 +1851,8 @@ class PlaybackManager {
|
||||||
Filters: 'IsNotFolder',
|
Filters: 'IsNotFolder',
|
||||||
// Setting this to true may cause some incorrect sorting
|
// Setting this to true may cause some incorrect sorting
|
||||||
Recursive: false,
|
Recursive: false,
|
||||||
SortBy: options.shuffle ? 'Random' : 'SortName',
|
SortBy: sortOptions.sortBy,
|
||||||
|
SortOrder: sortOptions.sortOrder,
|
||||||
// Only include Photos because we do not handle mixed queues currently
|
// Only include Photos because we do not handle mixed queues currently
|
||||||
MediaTypes: 'Photo',
|
MediaTypes: 'Photo',
|
||||||
Limit: UNLIMITED_ITEMS
|
Limit: UNLIMITED_ITEMS
|
||||||
|
@ -1851,20 +1862,16 @@ class PlaybackManager {
|
||||||
GenreIds: firstItem.Id,
|
GenreIds: firstItem.Id,
|
||||||
Filters: 'IsNotFolder',
|
Filters: 'IsNotFolder',
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
SortBy: options.shuffle ? 'Random' : 'SortName',
|
SortBy: sortOptions.sortBy,
|
||||||
|
SortOrder: sortOptions.sortOrder,
|
||||||
MediaTypes: 'Audio'
|
MediaTypes: 'Audio'
|
||||||
});
|
});
|
||||||
} else if (firstItem.IsFolder && firstItem.CollectionType === 'homevideos') {
|
} else if (firstItem.IsFolder && firstItem.CollectionType === 'homevideos') {
|
||||||
const sortOptions = options.sortOptions || {};
|
|
||||||
let sortByValue = options.shuffle ? 'Random' : sortOptions.sortBy;
|
|
||||||
if (sortByValue == null) {
|
|
||||||
sortByValue = 'SortName';
|
|
||||||
}
|
|
||||||
promise = getItemsForPlayback(serverId, mergePlaybackQueries({
|
promise = getItemsForPlayback(serverId, mergePlaybackQueries({
|
||||||
ParentId: firstItem.Id,
|
ParentId: firstItem.Id,
|
||||||
Filters: 'IsNotFolder',
|
Filters: 'IsNotFolder',
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
SortBy: sortByValue,
|
SortBy: sortOptions.sortBy,
|
||||||
SortOrder: sortOptions.sortOrder,
|
SortOrder: sortOptions.sortOrder,
|
||||||
// Only include Photos because we do not handle mixed queues currently
|
// Only include Photos because we do not handle mixed queues currently
|
||||||
MediaTypes: 'Photo',
|
MediaTypes: 'Photo',
|
||||||
|
@ -1872,10 +1879,12 @@ class PlaybackManager {
|
||||||
}, queryOptions));
|
}, queryOptions));
|
||||||
} else if (firstItem.IsFolder) {
|
} else if (firstItem.IsFolder) {
|
||||||
let sortBy = null;
|
let sortBy = null;
|
||||||
|
let sortOrder = null;
|
||||||
if (options.shuffle) {
|
if (options.shuffle) {
|
||||||
sortBy = 'Random';
|
sortBy = 'Random';
|
||||||
} else if (firstItem.Type !== 'BoxSet') {
|
} else if (firstItem.Type !== 'BoxSet') {
|
||||||
sortBy = 'SortName';
|
sortBy = sortOptions.sortBy;
|
||||||
|
sortOrder = sortOptions.sortOrder;
|
||||||
}
|
}
|
||||||
promise = getItemsForPlayback(serverId, mergePlaybackQueries({
|
promise = getItemsForPlayback(serverId, mergePlaybackQueries({
|
||||||
ParentId: firstItem.Id,
|
ParentId: firstItem.Id,
|
||||||
|
@ -1883,6 +1892,7 @@ class PlaybackManager {
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
// These are pre-sorted
|
// These are pre-sorted
|
||||||
SortBy: sortBy,
|
SortBy: sortBy,
|
||||||
|
SortOrder: sortOrder,
|
||||||
MediaTypes: 'Audio,Video'
|
MediaTypes: 'Audio,Video'
|
||||||
}, queryOptions));
|
}, queryOptions));
|
||||||
} else if (firstItem.Type === 'Episode' && items.length === 1 && getPlayer(firstItem, options).supportsProgress !== false) {
|
} else if (firstItem.Type === 'Episode' && items.length === 1 && getPlayer(firstItem, options).supportsProgress !== false) {
|
||||||
|
|
|
@ -213,6 +213,7 @@ function executeAction(card, target, action) {
|
||||||
});
|
});
|
||||||
} else if (action === 'play' || action === 'resume') {
|
} else if (action === 'play' || action === 'resume') {
|
||||||
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0', 10);
|
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0', 10);
|
||||||
|
|
||||||
if (playbackManager.canPlay(item)) {
|
if (playbackManager.canPlay(item)) {
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
ids: [playableItemId],
|
ids: [playableItemId],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue