Deterministic pagination in random albums sort (#1841)
* Deterministic pagination in random albums sort * Reseed on first random page * Add unit tests * Use rand in Subsonic API * Use different seeds per user on SEEDEDRAND() SQLite3 function * Small refactor * Fix id mismatch * Add seeded random to media_file (subsonic endpoint `getRandomSongs`) * Refactor * Remove unneeded import --------- Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -24,7 +24,7 @@ func AlbumsByFrequent() Options {
|
||||
}
|
||||
|
||||
func AlbumsByRandom() Options {
|
||||
return Options{Sort: "random()"}
|
||||
return Options{Sort: "random"}
|
||||
}
|
||||
|
||||
func AlbumsByName() Options {
|
||||
@@ -100,7 +100,7 @@ func SongsByAlbum(albumId string) Options {
|
||||
|
||||
func SongsByRandom(genre string, fromYear, toYear int) Options {
|
||||
options := Options{
|
||||
Sort: "random()",
|
||||
Sort: "random",
|
||||
}
|
||||
ff := squirrel.And{}
|
||||
if genre != "" {
|
||||
|
||||
Reference in New Issue
Block a user