No description
Find a file
Terry Raimondo 03120bac32
feat(subsonic): Add avgRating from subsonic spec (#4900)
* feat(subsonic): add averageRating to API responses

Add averageRating attribute to Subsonic API responses for artists,
albums, and songs. The average is calculated across all user ratings.

* perf(db): add index for average rating queries

Add composite index on (item_id, item_type, rating) to optimize
the correlated subquery used for calculating average ratings.

Signed-off-by: Terry Raimondo <terry.raimondo@gmail.com>

* test: add tests for averageRating feature

Add tests for:
- Album.AverageRating calculation in persistence layer
- MediaFile.AverageRating calculation in persistence layer
- AverageRating mapping in subsonic response helpers

Signed-off-by: Terry Raimondo <terry.raimondo@gmail.com>

* test: improve averageRating rounding test with 3 users

Add third test user to fixtures and update rounding test to use
3 ratings (5 + 4 + 4) / 3 = 4.33 for proper decimal rounding coverage.

Signed-off-by: Terry Raimondo <terry.raimondo@gmail.com>

* perf: store avg_rating on entity tables instead of using subquery

- Add avg_rating column to album, media_file, and artist tables
- Update SetRating() to recalculate and store average when ratings change
- Read avg_rating directly from entity table in withAnnotation()
- Remove old annotation index migration (no longer needed)

This trades write-time computation for read-time performance by
pre-computing the average rating instead of using a correlated
subquery on every read.

* feat: add Subsonic.EnableAverageRating config option (default true)

Allow administrators to disable exposing averageRating in Subsonic API
responses if they don't want to expose other users' rating data.

The avg_rating column is still updated internally when users rate items,
but the value is only included in API responses when this option is enabled.

* address PR comments

- Use structs:"avg_rating" with db:"avg_rating" tag instead of SQL alias
- Remove avg_rating indexes (not needed)
- Populate avg_rating columns from existing ratings in migration

* Woops

* rename avg_rating column to average_rating

---------

Signed-off-by: Terry Raimondo <terry.raimondo@gmail.com>
2026-01-18 17:42:42 -05:00
.devcontainer fix: build on Go 1.25.6 2026-01-15 19:30:08 -05:00
.github fix: build on Go 1.25.6 2026-01-15 19:31:23 -05:00
adapters feat: add go-taglib pure Go metadata extractor (#4902) 2026-01-18 14:42:53 -05:00
cmd feat: add go-taglib pure Go metadata extractor (#4902) 2026-01-18 14:42:53 -05:00
conf feat(subsonic): Add avgRating from subsonic spec (#4900) 2026-01-18 17:42:42 -05:00
consts feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
contrib build: add packages for deb and rpm to release (#3202) 2024-10-26 13:31:45 -04:00
core feat(insights): add file suffix counting 2026-01-18 17:00:35 -05:00
db feat(subsonic): Add avgRating from subsonic spec (#4900) 2026-01-18 17:42:42 -05:00
git feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
log feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
model feat(subsonic): Add avgRating from subsonic spec (#4900) 2026-01-18 17:42:42 -05:00
persistence feat(subsonic): Add avgRating from subsonic spec (#4900) 2026-01-18 17:42:42 -05:00
plugins docs: update README to reflect usage of nd-pdk library 2026-01-16 15:14:31 -05:00
release feat(insights): detecting packaging method (#3841) 2025-11-09 12:57:55 -05:00
resources fix(ui): update Spanish translations (#4904) 2026-01-18 13:28:40 -05:00
scanner perf: optimize cross-library move detection for single-library setups (#4888) 2026-01-15 17:22:46 -05:00
scheduler feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
server feat(subsonic): Add avgRating from subsonic spec (#4900) 2026-01-18 17:42:42 -05:00
tests feat: add support for public/private playlists in NSP import 2026-01-16 19:10:19 -05:00
ui feat(ui): add composer field to table views (#4857) 2026-01-18 13:15:53 -05:00
utils chore(deps): remove direct dependency on golang.org/x/exp 2025-12-31 17:03:44 -05: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 feat: add go-taglib pure Go metadata extractor (#4902) 2026-01-18 14:42:53 -05:00
.golangci.yml chore(deps) upgrade Go dependencies, including golangci-lint (#3937) 2025-04-07 19:42:00 -03:00
.nvmrc chore(deps): update all dependencies (#4618) 2025-10-25 17:05:16 -04: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: build on Go 1.25.6 2026-01-15 19:30:08 -05:00
go.mod feat: add go-taglib pure Go metadata extractor (#4902) 2026-01-18 14:42:53 -05:00
go.sum feat: add go-taglib pure Go metadata extractor (#4902) 2026-01-18 14:42:53 -05: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 chore: refactor Makefile 2026-01-15 19:59:58 -05: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): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05: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