Gallery list improvement (#622)

* Add grid view to galleries
* Show scene in gallery card
* Add is missing scene gallery filter
* Don't store galleries with no images
This commit is contained in:
WithoutPants
2020-06-21 21:43:57 +10:00
committed by GitHub
parent e50f1d01be
commit d3ababf0a1
26 changed files with 296 additions and 35 deletions

View File

@@ -2,6 +2,7 @@ package api
import (
"context"
"github.com/stashapp/stash/pkg/models"
)
@@ -13,3 +14,12 @@ func (r *galleryResolver) Files(ctx context.Context, obj *models.Gallery) ([]*mo
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
return obj.GetFiles(baseURL), nil
}
func (r *galleryResolver) Scene(ctx context.Context, obj *models.Gallery) (*models.Scene, error) {
if !obj.SceneID.Valid {
return nil, nil
}
qb := models.NewSceneQueryBuilder()
return qb.Find(int(obj.SceneID.Int64))
}