mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Include subsidiary studios/tags in tab badge counters (#3816)
* Add '_all' counts * Use '_all' counts in UI * Make other counts non-nullable * Hide tab counts if zero * Add resolver parameter
This commit is contained in:
@@ -52,22 +52,24 @@ func CountByPerformerID(ctx context.Context, r CountQueryer, id int) (int, error
|
||||
return r.QueryCount(ctx, filter, nil)
|
||||
}
|
||||
|
||||
func CountByStudioID(ctx context.Context, r CountQueryer, id int) (int, error) {
|
||||
func CountByStudioID(ctx context.Context, r CountQueryer, id int, depth *int) (int, error) {
|
||||
filter := &models.ImageFilterType{
|
||||
Studios: &models.HierarchicalMultiCriterionInput{
|
||||
Value: []string{strconv.Itoa(id)},
|
||||
Modifier: models.CriterionModifierIncludes,
|
||||
Depth: depth,
|
||||
},
|
||||
}
|
||||
|
||||
return r.QueryCount(ctx, filter, nil)
|
||||
}
|
||||
|
||||
func CountByTagID(ctx context.Context, r CountQueryer, id int) (int, error) {
|
||||
func CountByTagID(ctx context.Context, r CountQueryer, id int, depth *int) (int, error) {
|
||||
filter := &models.ImageFilterType{
|
||||
Tags: &models.HierarchicalMultiCriterionInput{
|
||||
Value: []string{strconv.Itoa(id)},
|
||||
Modifier: models.CriterionModifierIncludes,
|
||||
Depth: depth,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user