Skip to content

Commit

Permalink
Return absolute paths in Subsonic API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jul 31, 2020
1 parent 0cf5741 commit 338cbac
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions engine/common.go
Expand Up @@ -2,7 +2,6 @@ package engine

import (
"context"
"fmt"
"time"

"github.com/deluan/navidrome/consts"
Expand Down Expand Up @@ -42,8 +41,6 @@ type Entry struct {
PlayerId int
PlayerName string
AlbumCount int

AbsolutePath string
}

type Entries []Entry
Expand Down Expand Up @@ -105,11 +102,7 @@ func FromMediaFile(mf *model.MediaFile) Entry {
e.CoverArt = "al-" + mf.AlbumID
}
e.ContentType = mf.ContentType()
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)
}
e.Path = mf.Path
e.DiscNumber = mf.DiscNumber
e.Created = mf.CreatedAt
e.AlbumId = mf.AlbumID
Expand Down

0 comments on commit 338cbac

Please sign in to comment.