Clear image (#722)

* Allow clearing of tag images
* Allow clearing of studio images
* Allow clearing of performer images
* Allow clearing of movie images
* Add filtering for missing images
This commit is contained in:
WithoutPants
2020-08-12 09:19:27 +10:00
committed by GitHub
parent c0afd31b1c
commit e16118f551
24 changed files with 287 additions and 42 deletions

View File

@@ -27,6 +27,12 @@ func (rs studioRoutes) Image(w http.ResponseWriter, r *http.Request) {
studio := r.Context().Value(studioKey).(*models.Studio)
qb := models.NewStudioQueryBuilder()
image, _ := qb.GetStudioImage(studio.ID, nil)
defaultParam := r.URL.Query().Get("default")
if len(image) == 0 || defaultParam == "true" {
_, image, _ = utils.ProcessBase64Image(models.DefaultStudioImage)
}
utils.ServeImage(image, w, r)
}