2019-02-09 12:30:49 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-01-18 01:23:20 +00:00
|
|
|
|
2019-02-14 23:42:52 +00:00
|
|
|
"github.com/stashapp/stash/pkg/models"
|
2019-02-09 12:30:49 +00:00
|
|
|
)
|
|
|
|
|
2021-01-18 01:23:20 +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
|
|
|
}
|