feat: OpenSubsonic playback, covers, lists and search

Apps can play and browse: stream and download send the original file (Range,
HEAD), getCoverArt serves the cover of an album, an artist or the album of a
song (300 pixels or less is the small one), getAlbumList2 knows every kind of
list, getRandomSongs and getSongsByGenre list songs, search3 finds artists,
albums and songs, and the starred calls answer with nothing so apps do not break.

- catalog.Filter has IDs to read albums and songs by id
- storage.SubsonicRepo answers the album and song lists (random, newest,
  frequent, recent, by name, by artist, by year, by genre)
This commit is contained in:
tgiachi 2026-11-16 09:45:07 +01:00
commit ccee5e8719

View file

@ -303,6 +303,8 @@ func run() error {
// Other apps (OpenSubsonic) log in with the password of a device, never with the account password.
deviceSvc := devices.NewService(storage.NewDevicesRepo(db), []byte(cfg.Auth.JWTSecret))
catalogSvc := catalog.NewService(storage.NewCatalogRepo(db))
streamSvc := streaming.NewService(libraryRepo)
subsonicRepo := storage.NewSubsonicRepo(db, cfg.Listening.MinListen())
router := httpapi.NewRouter(httpapi.Deps{
Logger: logger,
@ -315,7 +317,8 @@ func run() error {
Devices: deviceSvc,
OpenSubsonic: &opensubsonic.Deps{
Login: deviceSvc, Catalog: catalogSvc, Libraries: libraries,
Extras: storage.NewSubsonicRepo(db), ServerVersion: version,
Extras: subsonicRepo, Lists: subsonicRepo, Streams: streamSvc, Covers: pictures, ArtistImages: pictures,
ServerVersion: version,
},
Scan: scanControl{ctx: ctx, m: scans},
Libraries: libraries,
@ -344,7 +347,7 @@ func run() error {
ArtistImages: pictures,
About: descriptions,
Settings: userSettings,
Streams: streaming.NewService(libraryRepo),
Streams: streamSvc,
Federation: federation.NewService(storage.NewFederationRepo(db), federation.NewClient()),
PeerCatalog: catalog.NewService(storage.NewSharedCatalogRepo(db)),
PeerStreams: streaming.NewService(libraryRepo.Shared()),