mirror of
https://github.com/navidrome/navidrome.git
synced 2025-09-02 22:28:13 +03:00
Return absolute paths in Subsonic API responses
This commit is contained in:
@@ -2,7 +2,6 @@ package engine
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/deluan/navidrome/consts"
|
"github.com/deluan/navidrome/consts"
|
||||||
@@ -42,8 +41,6 @@ type Entry struct {
|
|||||||
PlayerId int
|
PlayerId int
|
||||||
PlayerName string
|
PlayerName string
|
||||||
AlbumCount int
|
AlbumCount int
|
||||||
|
|
||||||
AbsolutePath string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Entries []Entry
|
type Entries []Entry
|
||||||
@@ -105,11 +102,7 @@ func FromMediaFile(mf *model.MediaFile) Entry {
|
|||||||
e.CoverArt = "al-" + mf.AlbumID
|
e.CoverArt = "al-" + mf.AlbumID
|
||||||
}
|
}
|
||||||
e.ContentType = mf.ContentType()
|
e.ContentType = mf.ContentType()
|
||||||
e.AbsolutePath = mf.Path
|
e.Path = 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)
|
|
||||||
}
|
|
||||||
e.DiscNumber = mf.DiscNumber
|
e.DiscNumber = mf.DiscNumber
|
||||||
e.Created = mf.CreatedAt
|
e.Created = mf.CreatedAt
|
||||||
e.AlbumId = mf.AlbumID
|
e.AlbumId = mf.AlbumID
|
||||||
|
Reference in New Issue
Block a user