-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sort options to playback requests #4786
Add sort options to playback requests #4786
Conversation
Adds shortcuts.js function to get sort order Added sort order technique to most types of media on playbackmanager.js
@dmitrylyzo Just updated this with improvements suggested by your comments. Also added the same technique to the other media types on playbackmanager.js. Tested them and they seemed to work fine. Please let me know if you have any other sugestion! Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add sort here (Play
in the context menu):
jellyfin-web/src/components/itemContextMenu.js
Lines 592 to 595 in 1e47abb
playbackManager[method]({ | |
items: [item], | |
startPositionTicks: startPosition | |
}); |
…js and list.js to use the above method
@dmitrylyzo Hey, applied the changes. Let me know if anything else is missing :D Thank you for your feedback. |
We should add sort for There is also adding to the play queue, but it doesn't work for photos, so we can leave it for the future. |
@dmitrylyzo @v0idMrK
jellyfin-web/src/components/playback/playbackmanager.js Lines 1852 to 1860 in 055a500
|
I will try to check today. If I don't have time, then I will go after it tomorrow. Thank you for the feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick Question I wonder what is the use of
queryOptions
?
It doesn't seem to be passed anywhere in options
, but good catch.
In theory it could be used to adjust the base query (only folders are currently using it).
Looking at list.js
, the sort options (SortBy
and SortOrder
) can be placed in queryOptions
.
For reference:
jellyfin-web/src/controllers/list.js
Lines 77 to 78 in 055a500
query.SortBy = sortValues.sortBy; | |
query.SortOrder = sortValues.sortOrder; |
In the list.js
and shortcut.js
, we can put sort options as queryOptions.SortBy
and queryOptions.SortOrder
.
In the playbackmanager.js
, we can drop getSortOptions
and revert my suggestion (#4786 (comment), most of f922742), and instead merge queryOptions
using mergePlaybackQueries
.
I made test changes:
test-photo.diff.txt
Btw, SyncPlay duplicates the playback manager. So it should be revised as well.
export function translateItemsForPlayback(apiClient, items, options) { |
But it doesn't seem to support Photos, so I am not sure if we should fix it right now.
@dmitrylyzo thanks for the clarification. the test change is better in my opinion |
Null verification for parentid on shortcuts.js itemContextMenu is now obeying to sorting
@dmitrylyzo @grafixeyehero Hi! Implemented the suggestions. Anything else please let me know! Thank you for the feedback 👍 |
… only play 1 item
UserSettings added param to function comment
Restoring "Play All" functionality
@dmitrylyzo it needs your Approval to Thanks👍 |
I agree with the above points. As soon as I have time I will implement them :) (Not sure if today or tomorrow) Thank you all for the feedback! |
… with the "Play" action Code cleanup
@dmitrylyzo Hey! Just pushed the latest changes 👍 Please let me know if anything else is missing! Thank you for the feedback. |
Sorry for not being able to fix this right away. Been busy lately with stuff in life. Hopefully next week Im able to finish it :) |
no worries @v0idMrK whenever you are able to get to it will be fine! |
…lists Revert line change on playbackmanager.js
@dmitrylyzo Finally got to it after a while :D Please let me know if there is anything else missing! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good.
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Need to update the PR title to suit the changelog.
Found another regression: SortMenu
doesn't restore current settings because it expects a PascalCase but receives camelCase.
jellyfin-web/src/components/sortmenu/sortmenu.js
Lines 21 to 22 in c8bed05
context.querySelector('.selectSortOrder').value = settings.SortOrder; | |
context.querySelector('.selectSortBy').value = settings.SortBy; |
jellyfin-web/src/controllers/list.js
Lines 964 to 965 in c8bed05
sortBy: userSettings.getFilter(basekey + '-sortby') || this.getDefaultSortBy(), | |
sortOrder: userSettings.getFilter(basekey + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending' |
This should be fixed in a separate PR. Maybe just use PascalCase for SortBy
and SortOrder
everywhere (list, shortcuts, etc.).
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
|
Hey! Sorry still didnt have time! When I do I will fix it, just wanted you to know that I didnt forget |
Could you please check it out when you find the time 😃 Thank you ! |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Cloudflare Pages deployment
|
Changes
Added getting the SortOptions on shortcuts.js and list.js files and sending them in the playbackmanager.js play method
Issues
Fixes #4841