mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Show studio as text in scene cards where studio image isn't set (#965)
This commit is contained in:
@@ -24,6 +24,19 @@ func (r *studioResolver) URL(ctx context.Context, obj *models.Studio) (*string,
|
||||
func (r *studioResolver) ImagePath(ctx context.Context, obj *models.Studio) (*string, error) {
|
||||
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
|
||||
imagePath := urlbuilders.NewStudioURLBuilder(baseURL, obj.ID).GetStudioImageURL()
|
||||
|
||||
qb := models.NewStudioQueryBuilder()
|
||||
hasImage, err := qb.HasStudioImage(obj.ID)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// indicate that image is missing by setting default query param to true
|
||||
if !hasImage {
|
||||
imagePath = imagePath + "?default=true"
|
||||
}
|
||||
|
||||
return &imagePath, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user