525 Commits

Author SHA1 Message Date
Deluan Quintão
f3f66da3da
refactor(server): replace RangeByChunks with Go 1.23 iterators (#3292)
* refactor(server): replace RangeByChunks with Go 1.23 iterators

* chore: fix comments re: SQLITE_MAX_VARIABLE_NUMBER

* test: improve playqueue test

* refactor(server): don't create a new iterator when it is not required
2026-01-02 20:39:44 +00:00
Caio Cotts
181adf8690
fix(ui): sort mappings (#3296)
* fix(ui): update sort mapping for title in mediafile repository

* fix(ui): create sort mapping for username in share repository

* fix(ui): create sort mapping for owner_name in playlist repository

* fix(ui): create sort mapping for username in player repository

* fix(ui): remove sort mapping for track number in mediafile repository

* chore: add todo to change user_name
2026-01-02 20:39:43 +00:00
Deluan
2664808fa6
fix(subsonic): random albums not reshuffling.
See: https://github.com/navidrome/navidrome/issues/3277#issuecomment-2364269787
2026-01-02 20:39:43 +00:00
Deluan
b2ebc90ef6
fix(server): play queue should not return empty entries for deleted tracks 2026-01-02 20:39:43 +00:00
naiar
d09e15e3f0
fix(subsonic): honour PreferSortTag when building indexes for getArtist and getIndexes (#3286)
* fix(scanner): use sort_artist_name when the config PreferSortTags is true - #3285

* revert unwanted modifications

* refactor(server): use cmp.Or to simplify nested ifs

---------

Co-authored-by: Deluan <deluan@navidrome.org>
2026-01-02 20:39:43 +00:00
Deluan
a275fe88ad
fix(ui): sort by favourited 2026-01-02 20:39:43 +00:00
Deluan
6f353ea6c4
fix(ui): sort playlist by song duration (#3284) 2026-01-02 20:39:42 +00:00
Deluan
be25753d37
fix(scanner): improve M3U playlist import times (#2706) 2026-01-02 20:39:42 +00:00
Kendall Garner
d5b5fc0885
random -> SEEDRAND (#3274) 2026-01-02 20:39:42 +00:00
Deluan Quintão
147fd54aac
Fix genre and id filters (#3273) 2026-01-02 20:39:42 +00:00
Reilly MacKenzie-Cree
bc08a2f9f2
Recursively refresh playlist tracks within smart playlist rules (#3018)
* Recursively refresh playlists within smart playlist rules

Signed-off-by: reillymc <reilly@mackenzie-cree.net>

* Clean up recursive smart playlist functions

Signed-off-by: reillymc <reilly@mackenzie-cree.net>

* Add smart playlist refresh timeout config and tests for nested track refetching

Signed-off-by: reillymc <reilly@mackenzie-cree.net>

* Change SmartPlaylistRefreshTimeout to SmartPlaylistRefreshDelay, increase default value

* Revert `smartPlaylistRefreshDelay` default to 5 seconds

---------

Signed-off-by: reillymc <reilly@mackenzie-cree.net>
Co-authored-by: Deluan <deluan@navidrome.org>
2026-01-02 20:39:42 +00:00
Deluan
25b4a164ed
Improve SQL sanitization 2026-01-02 20:39:41 +00:00
Deluan
5507f2640c
Small refactoring
- Remove duplication
- Remove warning about builtin keyword `new`
2026-01-02 20:39:41 +00:00
Deluan
ade8d6f374
Fix Player filter 2026-01-02 20:37:43 +00:00
Kendall Garner
a50af42872
Use userId in player, other fixes (#3182)
* [bugfix] player: use userId, other fixes

This PR primarily resolves #1928 by switching the foreign key of `player` from `user.user_name` to `user.id`.
There are also a few other fixes/changes:

- For some bizarre reason, `ip_address` is never returned from `read`/`get`. Change the field to `ip`, which works. Somehow
- Update `players_test.go` mock to also check for user agent, replicating the actual code
- Update `player_repository.go` `isPermitted` to check user id. I don't know how this worked before...
- tests!
- a few places referred to `typ`, when it is really `userAgent`. Change the field names

* baseRequest -> selectPlayer

* remove comment

* update migration, make all of persistence foreign key enabled

* maybe don't forget to save the file first
2026-01-02 20:37:43 +00:00
Deluan
b3450dd880
Remove unnecessary annotation table primary key 2026-01-02 20:37:16 +00:00
Deluan
a576221f02
Don't panic on PostScan errors. Fix #3118 2026-01-02 20:37:15 +00:00
Kendall Garner
6f4c5b34ec
fix album/media file random sort (#3089) 2026-01-02 20:37:15 +00:00
Deluan
f6552d9e36
Small refactoring 2026-01-02 20:36:59 +00:00
Deluan
38a219648d
Refactor string utilities into its own package str 2026-01-02 20:36:59 +00:00
Deluan
db56fa3b9d
Simplify dbx wrapper 2026-01-02 20:36:59 +00:00
Deluan
47068d2dea
Optimize SQLite3 access. Mainly separate read access from write access.
Based on tips from https://archive.is/Xfjh6#selection-257.0-278.0
2026-01-02 20:36:58 +00:00
Deluan
5c45495070
Show number of results from a query in the logs 2026-01-02 20:36:58 +00:00
Deluan
acb7468fdb
Make first WebUI random page stick 2026-01-02 20:36:58 +00:00
Guilherme Souza
c9a39d9986
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>
2026-01-02 20:36:58 +00:00
Deluan
ffbc1cebd4
Associate main entities with library 2026-01-02 20:36:57 +00:00
Deluan
82e79073cd
Store MusicFolder as a library in DB 2026-01-02 20:36:57 +00:00
Deluan
b0f6a395a8
Rename MediaFolder to Library 2026-01-02 20:36:57 +00:00
Deluan
d68cdac3d2
Do not panic if when updatePlaylist is called with a non-existent ID.
Fix #2876
2026-01-02 20:36:55 +00:00
Deluan
df22d69765
Simplify normalized AlbumPlayCountMode calc 2026-01-02 20:36:55 +00:00
Deluan
5be6dfc54b
Clean up runNavidrome function 2026-01-02 20:36:55 +00:00
Deluan Quintão
9e9f72ae8a
Make sorting lists by name/title case-insensitive (#2993)
* Make sort by order_* fields case-insensitive.

* Sort internet radios by name case-insensitive
2026-01-02 20:36:55 +00:00
Deluan
7500b17eb1
Fix ambiguous column when sorting media_files by created_at.
Fix #3006
2026-01-02 20:36:54 +00:00
Deluan
33c96640e8
Fix PlaylistTracks's loadAllGenres. Fix #2988 2026-01-02 20:35:32 +00:00
Deluan
ad2a40a712
Fix AlbumPlayCountMode. Closes #2984 2026-01-02 20:35:32 +00:00
Deluan
786a65aa07
Refactor loadGenres, remove duplication 2026-01-02 20:35:32 +00:00
Deluan
ad4918135d
Refactor DB Album mapping to model.Album 2026-01-02 20:35:32 +00:00
Deluan
e95e88950c
Add tests for AlbumPlayCountMode, change the calc to match the request from #1032 2026-01-02 20:35:32 +00:00
Deluan
054475a127
Add tests for AlbumPlayCountMode 2026-01-02 20:35:32 +00:00
vvdveen
60209152ec
Add AlbumPlayCountMode config option (#2803)
Closes #1032

* feat(album_repository.go): add kodi-style album playcount option - #1032

Signed-off-by: Victor van der Veen <vvdveen@gmail.com>

* fix format issue and remove reference to kodi (now normalized)

Signed-off-by: Victor van der Veen <vvdveen@gmail.com>

* reduced complexity but added rounding

Signed-off-by: Victor van der Veen <vvdveen@gmail.com>

* Use constants for AlbumPlayCountMode values

---------

Signed-off-by: Victor van der Veen <vvdveen@gmail.com>
Co-authored-by: Deluan <deluan@navidrome.org>
2026-01-02 20:35:32 +00:00
Deluan
d46740771c
Fix scrobble error spam in the logs.
Relates to #2831 and #2975
2026-01-02 20:35:04 +00:00
Deluan
cd805d24da
Block regular users from changing their own playlists ownership 2026-01-02 20:35:03 +00:00
looklose
217b92c40a
Fix function name in comment (#2947)
Signed-off-by: looklose <shishuaiqun@yeah.net>
2026-01-02 20:35:02 +00:00
Deluan
a0bac6c068
Send Subsonic formatted response on marshalling errors 2026-01-02 20:33:14 +00:00
Deluan
2ec9f6166e
Use order/sort album/artist when sorting tracks in playlists. Fixes #2819 2026-01-02 20:32:59 +00:00
Deluan
48751c0936
Add tests for toSQL 2026-01-02 20:32:59 +00:00
caiocotts
61653f15ad
Fix fields not being sent on getPlaylist.view responses. 2026-01-02 20:32:59 +00:00
Deluan
7d33f15eaa
Remove offset and limit from count queries. Fixes #2443 2026-01-02 20:32:58 +00:00
Deluan
020f9db5bd
Add log message to try to capture error in #2735 2026-01-02 20:32:58 +00:00
Deluan
faed89622d
Fix ReplayGain values not being retrieved from DB 2026-01-02 20:32:37 +00:00