mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Gallery scrubber (#5133)
This commit is contained in:
@@ -46,8 +46,12 @@ func (rs imageRoutes) Routes() chi.Router {
|
||||
}
|
||||
|
||||
func (rs imageRoutes) Thumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
mgr := manager.GetInstance()
|
||||
img := r.Context().Value(imageKey).(*models.Image)
|
||||
rs.serveThumbnail(w, r, img)
|
||||
}
|
||||
|
||||
func (rs imageRoutes) serveThumbnail(w http.ResponseWriter, r *http.Request, img *models.Image) {
|
||||
mgr := manager.GetInstance()
|
||||
filepath := mgr.Paths.Generated.GetThumbnailPath(img.Checksum, models.DefaultGthumbWidth)
|
||||
|
||||
// if the thumbnail doesn't exist, encode on the fly
|
||||
|
||||
Reference in New Issue
Block a user