stash/internal/api/resolver_query_find_scene_m...

27 lines
640 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package api
import (
"context"
2019-02-14 23:42:52 +00:00
"github.com/stashapp/stash/pkg/models"
2019-02-09 12:30:49 +00:00
)
func (r *queryResolver) FindSceneMarkers(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, filter *models.FindFilterType) (ret *models.FindSceneMarkersResultType, err error) {
if err := r.withReadTxn(ctx, func(repo models.ReaderRepository) error {
sceneMarkers, total, err := repo.SceneMarker().Query(sceneMarkerFilter, filter)
if err != nil {
return err
}
ret = &models.FindSceneMarkersResultType{
Count: total,
SceneMarkers: sceneMarkers,
}
return nil
}); err != nil {
return nil, err
}
return ret, nil
2019-02-09 12:30:49 +00:00
}