44 Commits

Author SHA1 Message Date
Deluan
03fa2920a2
fix(server): more race conditions when updating artist/album from external sources
Signed-off-by: Deluan <deluan@navidrome.org>
2026-01-02 20:41:57 +00:00
Deluan
b7bb44cc7e
fix(server): race condition when updating artist/album from external sources
Signed-off-by: Deluan <deluan@navidrome.org>
2026-01-02 20:41:56 +00:00
Deluan
17755b7676
refactor: better implementation of newRefreshQueue.
- use pointer references in channel
 - actually exits when context is canceled

Signed-off-by: Deluan <deluan@navidrome.org>
2026-01-02 20:41:55 +00:00
Deluan
fe600067da
Fix race condition in external metadata retrieval 2026-01-02 20:37:00 +00:00
Deluan
4783fe395e
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
880af2efe1
Refactor random.WeightedChooser, unsing generics 2026-01-02 20:36:57 +00:00
Deluan
af627aa18e
Refactor random functions 2026-01-02 20:36:56 +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
bb0c49e8ba
Use Go builtin min/max func 2026-01-02 20:33:14 +00:00
Caio Cotts
b57ba9e232
Fix null values in DB (#2840)
* Fix album image_files being null.

* Fix small nitpick.

* Use ExecContext instead of Exec.

* Change more columns to not null and set default values.

* Remove columns that don't need to be changed from migration.

* Fix typo.

* Remove unnecessary select statements.

* Remove duplicate code.

* Do not apply changes to radio table.

* Do not apply changes full_text columns and respective indexes.

* Fix musicbrainz columns.

* Rename migration.

* Make ExternalInfoUpdatedAt nullable

* Make Share's timestamps nullable

---------

Co-authored-by: Deluan Quintão <deluan@navidrome.org>
2026-01-02 20:32:59 +00:00
Stephan Wahlen
727b2a4a67
Improve TopSongs findMatchingTrack by de-prioritizing compilations (#2532)
in reference to https://github.com/navidrome/navidrome/issues/1701
2026-01-02 20:29:58 +00:00
Philipp Wolfer
cd62da04f8
Fix listenbrainz submission and clarify MusicBrainz recording ID field (#2279)
* Fix MB recording ID parameter name for ListenBrainz submission

This follows the ListenBrainz API documentation.

Fixes #1657

* Rename MediaFile.MbzTrackID to MbzRecordingID

This better reflects the actual data. That the MusicBrainz
recording ID is stored in file metadata as musicbrainz_trackid
is a historical artifact.

* Rename database column mbz_track_id to mbz_recording_id
2026-01-02 20:27:27 +00:00
Deluan
9b1ff0d815
Don't retrieve Various Artists and Unknown Artist info from Last.fm 2026-01-02 20:22:24 +00:00
Deluan
b5a8e82097
Replace custom code with errgroup 2026-01-02 20:22:23 +00:00
Deluan
679e897d68
Enqueue external metadata refreshes 2026-01-02 20:22:23 +00:00
Deluan
b304c8a043
Don't retrieve all artist external metadata if we just want artist images 2026-01-02 20:22:23 +00:00
Deluan
9e4e7a2f94
Fix Mapped Similar Artists log 2026-01-02 20:22:23 +00:00
Deluan
5390670cc3
Add dev option to increase external metadata cache expiration. More logs 2026-01-02 20:22:23 +00:00
Deluan
79c8d2f368
When retrieving images from external sources, avoid calling it again if data is already cached locally.
Relates to https://github.com/navidrome/navidrome/issues/2130#issuecomment-1412742918
2026-01-02 20:22:03 +00:00
Kendall Garner
3242ae96b7
Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061)
* lastfm album.getInfo, getAlbuminfo(2) endpoints

* ... for description and reduce not found log level

* address first comments

* return all images

* Update migration timestamp

* Handle a few edge cases

* Add CoverArtPriority option to retrieve albumart from external sources

* Make agents methods more descriptive

* Use Last.fm name consistently

Co-authored-by: Deluan <deluan@navidrome.org>
2026-01-02 20:21:18 +00:00
Deluan
f0b8274f83
PreCache artist images 2026-01-02 20:21:16 +00:00
Deluan
d1cf8e9b71
Artwork reader for Artist 2026-01-02 20:21:16 +00:00
Deluan
7e7efed112
Rename WeightedChooser's method Put to Add, a better name 2026-01-02 20:21:15 +00:00
Deluan
4bd0f4400e
Use custom sanitize package, fix #2070 2026-01-02 20:20:21 +00:00
Deluan
35ca63143f
Handle "naked" CoverArtIDs (IDs of album, mediafiles and playlists) 2026-01-02 20:20:20 +00:00
Deluan
9cf05a6b60
Moved logic of collapsing songs into albums to model package
(it should really be called domain.... maybe will rename it later)
2026-01-02 20:20:17 +00:00
Deluan
542496b2f3
Replace MinInt/MaxInt with generic versions 2026-01-02 20:20:17 +00:00
Deluan
0aff70f816
Smarter cache of external info calls (last.fm / spotify) 2026-01-02 20:09:30 +00:00
Steve Richter
310ce67c2e
Listenbrainz scrobbling (#1424)
* Refactor session_keys to its own package

* Adjust play_tracker

- Don't send external NowPlaying/Scrobble for tracks with unknown artist
- Continue to the next agent on error

* Implement ListenBrainz Agent and Auth Router

* Implement frontend for ListenBrainz linking

* Update listenBrainzRequest

- Don't marshal Player to json
- Rename Track to Title

* Return ErrRetryLater on ListenBrainz server errors

* Add tests for listenBrainzAgent

* Add tests for ListenBrainz Client

* Adjust ListenBrainzTokenDialog to handle errors better

* Refactor listenbrainz.formatListen and listenBrainzRequest structs

* Refactor agent auth_routers

* Refactor session_keys to agents package

* Add test for listenBrainzResponse

* Add tests for ListenBrainz auth_router

* Update ListenBrainzTokenDialog and auth_router

* Adjust player scrobble toggle
2026-01-02 20:09:02 +00:00
Deluan
bb29e2bdd6
Fix double escaped lyrics and comments 2026-01-02 20:09:01 +00:00
Deluan
216e51acae
Tweak SimilarSongs algorithm to prioritize the requested main artist 2026-01-02 20:09:00 +00:00
Deluan
dc70dc99c8
Better way to match top songs from external sources (Last.fm) 2026-01-02 20:09:00 +00:00
Deluan
988cb46862
Fix loadSimilar method, was causing "internal error". Fix #1293 2026-01-02 20:06:12 +00:00
Deluan
040a0b1686
Fix getTopSongs endpoint 2026-01-02 20:06:12 +00:00
Deluan
0a9f6cb807
Refactor Agents to be singleton
Initial work for Last.fm scrobbler
2026-01-02 20:05:04 +00:00
Deluan
df6f611377
Refactored agents calling into its own struct 2026-01-02 19:32:16 +00:00
Deluan
8b6e29e9c2
Add tests for WeightedRandomChooser 2026-01-02 19:31:51 +00:00
Deluan
5c8708daec
Rename variable with conflicting name 2026-01-02 19:31:51 +00:00
Deluan
4bbd2a720c
Better SimilarSongs algorithm 2026-01-02 19:31:51 +00:00
Deluan
8149e99dda
Add a timeout to background task 2026-01-02 19:31:51 +00:00
Deluan
49dc6116f7
Don't use request's context when refreshing artist info in background 2026-01-02 19:31:51 +00:00
Deluan
8fdab93efa
Always update artist info, even if info is fresh 2026-01-02 19:31:51 +00:00
Deluan
fdd9a94144
Rename ExternalInfo to ExternalMetadata 2026-01-02 19:21:28 +00:00