mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-16 23:28:44 +01: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
|
|
@ -39,6 +39,8 @@ type Entry struct {
|
|||
PlayerId int
|
||||
PlayerName string
|
||||
AlbumCount int
|
||||
|
||||
AbsolutePath string
|
||||
}
|
||||
|
||||
type Entries []Entry
|
||||
|
|
@ -94,7 +96,8 @@ func FromMediaFile(mf *domain.MediaFile) Entry {
|
|||
e.CoverArt = mf.ID
|
||||
}
|
||||
e.ContentType = mf.ContentType()
|
||||
// Creates a "pseudo" path, to avoid sending absolute paths to the client
|
||||
e.AbsolutePath = mf.Path
|
||||
// Creates a "pseudo" Path, to avoid sending absolute paths to the client
|
||||
if mf.Path != "" {
|
||||
e.Path = fmt.Sprintf("%s/%s/%s.%s", realArtistName(mf), mf.Album, mf.Title, mf.Suffix)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue