No description
Find a file
Deluan Quintão 36d73eec0d
fix(scanner): prevent foreign key constraint error in tag UpdateCounts (#4370)
* fix: prevent foreign key constraint error in tag UpdateCounts

Added JOIN clause with tag table in UpdateCounts SQL query to filter out
tag IDs from JSON that don't exist in the tag table. This prevents
'FOREIGN KEY constraint failed' errors when the library_tag table
tries to reference non-existent tag IDs during scanner operations.

The fix ensures only valid tag references are counted while maintaining
data integrity and preventing scanner failures during library updates.

* test(tag): add regression tests for foreign key constraint fix

Add comprehensive regression tests to prevent the foreign key constraint
error when tag IDs in JSON data don't exist in the tag table. Tests cover
both album and media file scenarios with non-existent tag IDs.

- Test UpdateCounts() with albums containing non-existent tag IDs
- Test UpdateCounts() with media files containing non-existent tag IDs
- Verify operations complete without foreign key errors

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-21 22:55:28 -04:00
.devcontainer chore(deps): upgrade to Go 1.24.1 (#3851) 2025-03-17 21:08:10 -04:00
.github feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
adapters/taglib fix(scanner): lyrics tag parsing to properly handle both ID3 and aliased tags 2025-07-09 00:27:40 -03:00
cmd feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
conf fix(plugins): silence plugin warnings and folder creation when plugins disabled (#4297) 2025-07-02 13:17:59 -04:00
consts feat(scanner): add Scanner.PurgeMissing configuration option (#4107) 2025-05-22 20:50:15 -04:00
contrib build: add packages for deb and rpm to release (#3202) 2024-10-26 13:31:45 -04:00
core fix(server): headless library access improvements (#4362) 2025-07-20 15:58:21 -04:00
db feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
git feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
log feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
model fix(server): headless library access improvements (#4362) 2025-07-20 15:58:21 -04:00
persistence fix(scanner): prevent foreign key constraint error in tag UpdateCounts (#4370) 2025-07-21 22:55:28 -04:00
plugins fix(plugins): prevent race condition in plugin tests 2025-07-20 10:43:04 -04:00
release chore: fix some typos in comment and logs (#4333) 2025-07-13 14:31:15 -04:00
resources fix(ui): update Portuguese translation and remove unused terms 2025-07-18 18:59:52 -04:00
scanner feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
scheduler feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
server fix(subsonic): only use genre tag when searching by genre (#4361) 2025-07-19 21:52:29 -04:00
tests feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
ui fix(server): headless library access improvements (#4362) 2025-07-20 15:58:21 -04:00
utils feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
.dockerignore fix(insights): fix issues and improve reports (#3558) 2024-12-18 20:37:35 -05:00
.git-blame-ignore-revs Move project to Navidrome GitHub organization 2021-02-06 21:47:19 -05:00
.gitignore test: improve serve_index_test code 2025-06-28 20:01:47 -04:00
.golangci.yml chore(deps) upgrade Go dependencies, including golangci-lint (#3937) 2025-04-07 19:42:00 -03:00
.nvmrc Upgrade to Go 1.22 and Node v20 (#2861) 2024-02-16 20:29:16 -05:00
CODE_OF_CONDUCT.md Use Contributor Covenant v2.0 2020-07-21 14:40:21 -04:00
CONTRIBUTING.md build(ci): change GitHub release notes (#3300) 2024-09-21 17:00:13 -04:00
Dockerfile fix: typo in Dockerfile (#4363) 2025-07-20 13:36:46 -04:00
go.mod chore(deps): update Go dependencies to latest versions 2025-06-27 21:24:47 -04:00
go.sum chore(deps): update Go dependencies to latest versions 2025-06-27 21:24:47 -04:00
LICENSE Change license to GPLv3 2020-01-22 14:48:38 -05:00
main.go build(netgo): make sure the project is always compiled with netgo build tag (#3428) 2024-10-26 13:28:23 -04:00
Makefile test: add translation validation system with CI integration (#4306) 2025-07-03 09:59:39 -04:00
Procfile.dev chore(deps): upgrade to Go 1.24.1 (#3851) 2025-03-17 21:08:10 -04:00
README.md feat: add Navidrome Guru on Gurubase.io (#3491) 2024-11-23 17:29:00 -05:00
reflex.conf feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00

Navidrome logo

Navidrome Music Server  Tweet

Last Release Build Downloads Docker Pulls Dev Chat Subreddit Contributor Covenant Gurubase

Navidrome is an open source web-based music collection server and streamer. It gives you freedom to listen to your music collection from any browser or mobile device. It's like your personal Spotify!

Note: The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order to get a stable set of binaries.

Check out our Live Demo!

Any feedback is welcome! If you need/want a new feature, find a bug or think of any way to improve Navidrome, please file a GitHub issue or join the discussion in our Subreddit. If you want to contribute to the project in any other way (ui/backend dev, translations, themes), please join the chat in our Discord server.

Installation

See instructions on the project's website

Cloud Hosting

PikaPods has partnered with us to offer you an officially supported, cloud-hosted solution. A share of the revenue helps fund the development of Navidrome at no additional cost for you.

PikaPods

Features

  • Handles very large music collections
  • Streams virtually any audio format available
  • Reads and uses all your beautifully curated metadata
  • Great support for compilations (Various Artists albums) and box sets (multi-disc albums)
  • Multi-user, each user has their own play counts, playlists, favourites, etc...
  • Very low resource usage
  • Multi-platform, runs on macOS, Linux and Windows. Docker images are also provided
  • Ready to use binaries for all major platforms, including Raspberry Pi
  • Automatically monitors your library for changes, importing new files and reloading new metadata
  • Themeable, modern and responsive Web interface based on Material UI
  • Compatible with all Subsonic/Madsonic/Airsonic clients
  • Transcoding on the fly. Can be set per user/player. Opus encoding is supported
  • Translated to various languages

Translations

Navidrome uses POEditor for translations, and we are always looking for more contributors

Documentation

All documentation can be found in the project's website: https://www.navidrome.org/docs. Here are some useful direct links:

Screenshots