mirror of
https://github.com/stashapp/stash.git
synced 2025-12-25 17:53:23 +01:00
* Add '_all' counts * Use '_all' counts in UI * Make other counts non-nullable * Hide tab counts if zero * Add resolver parameter
28 lines
792 B
Go
28 lines
792 B
Go
package scene
|
|
|
|
import (
|
|
"context"
|
|
"strconv"
|
|
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
type MarkerQueryer interface {
|
|
Query(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, findFilter *models.FindFilterType) ([]*models.SceneMarker, int, error)
|
|
}
|
|
|
|
type MarkerCountQueryer interface {
|
|
QueryCount(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, findFilter *models.FindFilterType) (int, error)
|
|
}
|
|
|
|
func MarkerCountByTagID(ctx context.Context, r MarkerCountQueryer, id int, depth *int) (int, error) {
|
|
filter := &models.SceneMarkerFilterType{
|
|
Tags: &models.HierarchicalMultiCriterionInput{
|
|
Value: []string{strconv.Itoa(id)},
|
|
Modifier: models.CriterionModifierIncludes,
|
|
Depth: depth,
|
|
},
|
|
}
|
|
|
|
return r.QueryCount(ctx, filter, nil)
|
|
}
|