hide hidden releases from unauthorised /api/v1/artist/{id}
This commit is contained in:
parent
e69cf78e57
commit
1846203076
3 changed files with 11 additions and 8 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"arimelody-web/admin"
|
||||
"arimelody-web/global"
|
||||
db "arimelody-web/music/controller"
|
||||
music "arimelody-web/music/controller"
|
||||
|
@ -46,8 +47,10 @@ func ServeArtist(artist *model.Artist) http.Handler {
|
|||
}
|
||||
)
|
||||
|
||||
show_hidden_releases := admin.GetSession(r) != nil
|
||||
|
||||
var dbCredits []*model.Credit
|
||||
dbCredits, err := db.GetArtistCredits(global.DB, artist.ID)
|
||||
dbCredits, err := db.GetArtistCredits(global.DB, artist.ID, show_hidden_releases)
|
||||
if err != nil {
|
||||
fmt.Printf("FATAL: Failed to retrieve artist credits for %s: %s\n", artist.ID, err)
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue