2019-02-09 12:30:49 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-02-10 02:53:08 +00:00
|
|
|
"github.com/stashapp/stash/models"
|
2019-02-09 12:30:49 +00:00
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (r *galleryResolver) ID(ctx context.Context, obj *models.Gallery) (string, error) {
|
|
|
|
return strconv.Itoa(obj.ID), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *galleryResolver) Title(ctx context.Context, obj *models.Gallery) (*string, error) {
|
|
|
|
return nil, nil // TODO remove this from schema
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *galleryResolver) Files(ctx context.Context, obj *models.Gallery) ([]models.GalleryFilesType, error) {
|
|
|
|
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
|
|
|
|
return obj.GetFiles(baseURL), nil
|
|
|
|
}
|