Sort users by most recently used#1287
Open
Tryum wants to merge 2 commits into
Open
Conversation
Track a `lastUsedAt` timestamp on each saved JellyfinUser and order the user-switcher by recency, so the account the user jumps between most often lands first. Users that haven't been signed into since the upgrade fall back to alphabetical. - Add a nullable `lastUsedAt` column to the `users` table (autoMigration 31 -> 32). - Stamp the timestamp in `ServerRepository.changeUser`, the single chokepoint hit by direct user switch, username/password login, Quick Connect, and session restore. - Replace the alphabetical sort in `SwitchUserViewModel.getUsers` with `lastUsedAt` descending, then case-insensitive name for ties.
6ddaccd to
e09f0ae
Compare
damontecres
reviewed
Apr 27, 2026
Owner
damontecres
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
The official app has a setting to set the sort, so I think it would be a good idea to have a setting here too.
| val serverId: UUID, | ||
| val accessToken: String?, | ||
| val pin: String? = null, | ||
| val lastUsedAt: Long? = null, |
Owner
There was a problem hiding this comment.
I think Date or LocalDateTime would be better. Might need a add a converter for those.
Owner
|
Just an FYI, since I had to make some databases changes in #1367, I also added the So if you rebase on top of that, should be easier to implement this change. |
Author
|
Thanks ! |
damontecres
added a commit
that referenced
this pull request
May 20, 2026
## Description This PR adds a new method of protecting a user profile when switching to it: server login. When enabled, switching to the user requires authenticating with the server again via Quick Connect or username & password. This is basically the same as the official client. ### Related issues Closes #321 Related to #1330 - might cause merge conflicts Related to #1287 - definitely causes merge conflicts ### Testing Emulator with various uses cases including auto sign-in, switching between server login & PIN protection, and removing the protection ## Screenshots N/A, the login looks identical as adding a new user ## AI or LLM usage None
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Sort users by last recently used on User selection screen.
Testing
Manual testing on Fire TV Stick 4k Max
Screenshots
AI or LLM usage
Claude Opus used.
Tested on device.