stash/pkg/models/scene_marker.go
DingDongSoLong4 1c13c9e1b1
SQLite model refactoring (#3791)
* Remove ID from PerformerPartial
* Separate studio model from sqlite model
* Separate movie model from sqlite model
* Separate tag model from sqlite model
* Separate saved filter model from sqlite model
* Separate scene marker model from sqlite model
* Separate gallery chapter model from sqlite model
* Move ErrNoRows checks into sqlite, improve empty result error messages
* Move SQLiteDate and SQLiteTimestamp to sqlite
* Use changesetTranslator everywhere, refactor for consistency
* Make PerformerStore.DestroyImage private
* Fix rating on movie create
2023-06-15 12:46:09 +10:00

55 lines
2.1 KiB
Go

package models
import "context"
type SceneMarkerFilterType struct {
// Filter to only include scene markers with this tag
TagID *string `json:"tag_id"`
// Filter to only include scene markers with these tags
Tags *HierarchicalMultiCriterionInput `json:"tags"`
// Filter to only include scene markers attached to a scene with these tags
SceneTags *HierarchicalMultiCriterionInput `json:"scene_tags"`
// Filter to only include scene markers with these performers
Performers *MultiCriterionInput `json:"performers"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
// Filter by scenes date
SceneDate *DateCriterionInput `json:"scene_date"`
// Filter by scenes created at
SceneCreatedAt *TimestampCriterionInput `json:"scene_created_at"`
// Filter by scenes updated at
SceneUpdatedAt *TimestampCriterionInput `json:"scene_updated_at"`
}
type MarkerStringsResultType struct {
Count int `json:"count"`
ID string `json:"id"`
Title string `json:"title"`
}
type SceneMarkerReader interface {
Find(ctx context.Context, id int) (*SceneMarker, error)
FindMany(ctx context.Context, ids []int) ([]*SceneMarker, error)
FindBySceneID(ctx context.Context, sceneID int) ([]*SceneMarker, error)
CountByTagID(ctx context.Context, tagID int) (int, error)
GetMarkerStrings(ctx context.Context, q *string, sort *string) ([]*MarkerStringsResultType, error)
Wall(ctx context.Context, q *string) ([]*SceneMarker, error)
Count(ctx context.Context) (int, error)
All(ctx context.Context) ([]*SceneMarker, error)
Query(ctx context.Context, sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) ([]*SceneMarker, int, error)
GetTagIDs(ctx context.Context, imageID int) ([]int, error)
}
type SceneMarkerWriter interface {
Create(ctx context.Context, newSceneMarker *SceneMarker) error
Update(ctx context.Context, updatedSceneMarker *SceneMarker) error
Destroy(ctx context.Context, id int) error
UpdateTags(ctx context.Context, markerID int, tagIDs []int) error
}
type SceneMarkerReaderWriter interface {
SceneMarkerReader
SceneMarkerWriter
}