mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-05 21:47:36 +03:00
Expose mediafile.AbsolutePath to remove dependency of the persistence layer in the API layer
This commit is contained in:
parent
28ee1f195c
commit
52fc580a2b
6 changed files with 31 additions and 31 deletions
21
api/api.go
21
api/api.go
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"github.com/cloudsonic/sonic-server/api/responses"
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/domain"
|
||||
"github.com/cloudsonic/sonic-server/engine"
|
||||
"github.com/go-chi/chi"
|
||||
)
|
||||
|
@ -18,24 +17,22 @@ const ApiVersion = "1.8.0"
|
|||
type SubsonicHandler = func(http.ResponseWriter, *http.Request) (*responses.Subsonic, error)
|
||||
|
||||
type Router struct {
|
||||
Browser engine.Browser
|
||||
Cover engine.Cover
|
||||
ListGenerator engine.ListGenerator
|
||||
Playlists engine.Playlists
|
||||
Ratings engine.Ratings
|
||||
Scrobbler engine.Scrobbler
|
||||
Search engine.Search
|
||||
MediaFileRepository domain.MediaFileRepository
|
||||
Browser engine.Browser
|
||||
Cover engine.Cover
|
||||
ListGenerator engine.ListGenerator
|
||||
Playlists engine.Playlists
|
||||
Ratings engine.Ratings
|
||||
Scrobbler engine.Scrobbler
|
||||
Search engine.Search
|
||||
|
||||
mux http.Handler
|
||||
}
|
||||
|
||||
func NewRouter(browser engine.Browser, cover engine.Cover, listGenerator engine.ListGenerator,
|
||||
playlists engine.Playlists, ratings engine.Ratings, scrobbler engine.Scrobbler, search engine.Search,
|
||||
mediaFileRepository domain.MediaFileRepository) *Router {
|
||||
playlists engine.Playlists, ratings engine.Ratings, scrobbler engine.Scrobbler, search engine.Search) *Router {
|
||||
|
||||
r := &Router{Browser: browser, Cover: cover, ListGenerator: listGenerator, Playlists: playlists,
|
||||
Ratings: ratings, Scrobbler: scrobbler, Search: search, MediaFileRepository: mediaFileRepository}
|
||||
Ratings: ratings, Scrobbler: scrobbler, Search: search}
|
||||
r.mux = r.routes()
|
||||
return r
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue