mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-06 02:08:47 +01:00
Embed static files used by Subsonic API
This commit is contained in:
parent
f63b1703e6
commit
49f59fe9f4
8 changed files with 337 additions and 8 deletions
|
|
@ -3,12 +3,12 @@ package subsonic
|
|||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/deluan/navidrome/engine"
|
||||
"github.com/deluan/navidrome/log"
|
||||
"github.com/deluan/navidrome/model"
|
||||
"github.com/deluan/navidrome/server/subsonic/responses"
|
||||
"github.com/deluan/navidrome/static"
|
||||
)
|
||||
|
||||
type MediaRetrievalController struct {
|
||||
|
|
@ -20,8 +20,7 @@ func NewMediaRetrievalController(cover engine.Cover) *MediaRetrievalController {
|
|||
}
|
||||
|
||||
func (c *MediaRetrievalController) GetAvatar(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
var f *os.File
|
||||
f, err := os.Open("static/itunes.png")
|
||||
f, err := static.AssetFile().Open("itunes.png")
|
||||
if err != nil {
|
||||
log.Error(r, "Image not found", err)
|
||||
return nil, NewError(responses.ErrorDataNotFound, "Avatar image not found")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue