stash/pkg/models/scene.go

57 lines
2.0 KiB
Go
Raw Normal View History

2020-09-15 07:28:53 +00:00
package models
type SceneReader interface {
Find(id int) (*Scene, error)
2020-09-15 07:28:53 +00:00
FindMany(ids []int) ([]*Scene, error)
FindByChecksum(checksum string) (*Scene, error)
FindByOSHash(oshash string) (*Scene, error)
FindByPath(path string) (*Scene, error)
FindByPerformerID(performerID int) ([]*Scene, error)
2021-02-01 20:56:54 +00:00
FindByGalleryID(performerID int) ([]*Scene, error)
FindDuplicates(distance int) ([][]*Scene, error)
CountByPerformerID(performerID int) (int, error)
2020-09-15 07:28:53 +00:00
// FindByStudioID(studioID int) ([]*Scene, error)
FindByMovieID(movieID int) ([]*Scene, error)
CountByMovieID(movieID int) (int, error)
Count() (int, error)
Size() (float64, error)
Duration() (float64, error)
2020-09-15 07:28:53 +00:00
// SizeCount() (string, error)
CountByStudioID(studioID int) (int, error)
CountByTagID(tagID int) (int, error)
CountMissingChecksum() (int, error)
CountMissingOSHash() (int, error)
Wall(q *string) ([]*Scene, error)
2020-09-15 07:28:53 +00:00
All() ([]*Scene, error)
Query(sceneFilter *SceneFilterType, findFilter *FindFilterType) ([]*Scene, int, error)
GetCover(sceneID int) ([]byte, error)
GetMovies(sceneID int) ([]MoviesScenes, error)
2021-02-01 20:56:54 +00:00
GetTagIDs(sceneID int) ([]int, error)
GetGalleryIDs(sceneID int) ([]int, error)
GetPerformerIDs(sceneID int) ([]int, error)
GetStashIDs(sceneID int) ([]*StashID, error)
2020-09-15 07:28:53 +00:00
}
type SceneWriter interface {
Create(newScene Scene) (*Scene, error)
Update(updatedScene ScenePartial) (*Scene, error)
UpdateFull(updatedScene Scene) (*Scene, error)
IncrementOCounter(id int) (int, error)
DecrementOCounter(id int) (int, error)
ResetOCounter(id int) (int, error)
UpdateFileModTime(id int, modTime NullSQLiteTimestamp) error
Destroy(id int) error
UpdateCover(sceneID int, cover []byte) error
DestroyCover(sceneID int) error
UpdatePerformers(sceneID int, performerIDs []int) error
UpdateTags(sceneID int, tagIDs []int) error
2021-02-01 20:56:54 +00:00
UpdateGalleries(sceneID int, galleryIDs []int) error
UpdateMovies(sceneID int, movies []MoviesScenes) error
UpdateStashIDs(sceneID int, stashIDs []StashID) error
2020-09-15 07:28:53 +00:00
}
type SceneReaderWriter interface {
SceneReader
SceneWriter
}