fix scanning from jamstash

This commit is contained in:
sentriz
2019-07-31 15:01:48 +01:00
parent c514f83cf7
commit 7580835146
3 changed files with 44 additions and 5 deletions

View File

@@ -102,6 +102,18 @@ func (c *Controller) ServeGetScanStatus(r *http.Request) *spec.Response {
return sub
}
func (c *Controller) ServeGetUser(r *http.Request) *spec.Response {
user := r.Context().Value(key.User).(*model.User)
sub := spec.NewResponse()
sub.User = &spec.User{
Username: user.Name,
AdminRole: user.IsAdmin,
ScrobblingEnabled: user.LastFMSession != "",
Folder: []int{1},
}
return sub
}
func (c *Controller) ServeNotFound(r *http.Request) *spec.Response {
return spec.NewError(70, "view not found")
}