mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #10011] Prefer unplayed items when sorting randomly #12302
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/jellyfin/jellyfin/pull/10011
State: closed
Merged: No
Changes
This PR adjusts the "Random" sorting strategy to prefer unplayed items over played items, as a simple way of addressing feature request 717.
The idea here is that when a user hits the "Shuffle" button in any given context (e.g. a show, a library, a collection), they are probably not interested in seeing items that they have recently already played via shuffle. Tying the priority to the "Played" flag gives the user some control over this behavior, e.g. if they want to "reset" their shuffle exclusion, they can mark a folder as unplayed.
Looking for feedback and suggestions
I'm definitely open to suggestions about this approach and implementation! In particular, I notice that besides the
ORDER BY RANDOM()strategy implemented inSqliteItemRepository, there are two other possible ways for items to be shuffled:RandomComparerandShuffleExtensions. I'm unsure about whether these need to be adjusted as well, and I was unable to figure how they could get invoked from front-end actions.Issues
https://features.jellyfin.org/posts/717/shuffle-weight-recently-played-media-should-be-less-likely-to-be-next