Show O Counter in Studio card (#5982)

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
Slick Daddy
2025-11-25 02:06:36 +03:00
committed by GitHub
parent ca8ee6bc2a
commit ecd9c6ec5b
13 changed files with 138 additions and 6 deletions

View File

@@ -682,6 +682,20 @@ func (qb *ImageStore) OCountByPerformerID(ctx context.Context, performerID int)
return ret, nil
}
func (qb *ImageStore) OCountByStudioID(ctx context.Context, studioID int) (int, error) {
table := qb.table()
q := dialect.Select(goqu.COALESCE(goqu.SUM("o_counter"), 0)).From(table).Where(
table.Col(studioIDColumn).Eq(studioID),
)
var ret int
if err := querySimple(ctx, q, &ret); err != nil {
return 0, err
}
return ret, nil
}
func (qb *ImageStore) OCount(ctx context.Context) (int, error) {
table := qb.table()