507 Commits

Author SHA1 Message Date
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
Deluan
1423b44600
Fix PreferSortTags 2026-01-02 20:32:35 +00:00
Deluan
a821c35367
Add context to SQL queries, enabling cancellation 2026-01-02 20:32:35 +00:00
Deluan Quintão
e8861b22a0
Add new PrefSortTags option (#2696) 2026-01-02 20:32:24 +00:00
Deluan
70148afc63
Convert internal disc number representation to int 2026-01-02 20:31:57 +00:00
Deluan
d9ce8b54f0
Add discs to album 2026-01-02 20:31:57 +00:00
Deluan Quintão
274ad1f7d5
Replace beego/orm with dbx (#2693)
* Start migration to dbx package

* Fix annotations and bookmarks bindings

* Fix tests

* Fix more tests

* Remove remaining references to beego/orm

* Add PostScanner/PostMapper interfaces

* Fix importing SmartPlaylists

* Renaming

* More renaming

* Fix artist DB mapping

* Fix playlist updates

* Remove bookmarks at the end of the test

* Remove remaining `orm` struct tags

* Fix user timestamps DB access

* Fix smart playlist evaluated_at DB access

* Fix search3
2026-01-02 20:31:57 +00:00
Deluan
1caef8dc8c
Return genres in bookmark endpoints (OpenSubsonic) 2026-01-02 20:31:56 +00:00
Deluan
417748fe46
Coalesce null annotation values, to better rank them against annotations with value 0 2026-01-02 20:31:56 +00:00
Deluan Quintão
8b14b41e54
Optimize search3, by removing OFFSET when paginating (#2655)
* Optimize pagination, removing offset

* For search, don't add `where` clause for empty queries

* Revert "Replace `COUNT(DISTINCT primary_key)` with `COUNT(*)`"

Genres are required as part of the count queries, so filter by genres work

* Optimize search3 query, using order by id if it is a "" query.

Also fix the optimizePagination query logic

* Allow offset optimizer threshold to be configured
2026-01-02 20:31:30 +00:00
Deluan
bc2461d974
Revert "Replace COUNT(DISTINCT primary_key) with COUNT(*)"
Genres are required as part of the count queries, so filter by genres work
2026-01-02 20:31:30 +00:00
Deluan
a8aa05373d
Replace COUNT(DISTINCT primary_key) with COUNT(*) 2026-01-02 20:31:30 +00:00
Deluan
0887f19708
Show SQL errors in queryAll 2026-01-02 20:31:30 +00:00
Deluan
062889a88a
Generalize BreakUp/RangByChunks functions 2026-01-02 20:31:30 +00:00
Caio Cotts
94eefe62df
Return genres in search3 endpoint. 2026-01-02 20:31:12 +00:00
Kendall Garner
4745950eb9
Do not empty old artist metadata (#2423) 2026-01-02 20:29:59 +00:00
Deluan
edb75f268f
Move string slice functions to slice package as generic functions 2026-01-02 20:27:26 +00:00
Deluan
f80e628442
Order albums by full original date (this time is for real). Fixes #1452 2026-01-02 20:27:26 +00:00
Deluan
cff7d5ccfc
Order albums by full original date. Fixes #1452 2026-01-02 20:27:26 +00:00