2020-09-15 07:28:53 +00:00
|
|
|
package models
|
|
|
|
|
2022-04-25 05:55:05 +00:00
|
|
|
type StudioFilterType struct {
|
|
|
|
And *StudioFilterType `json:"AND"`
|
|
|
|
Or *StudioFilterType `json:"OR"`
|
|
|
|
Not *StudioFilterType `json:"NOT"`
|
|
|
|
Name *StringCriterionInput `json:"name"`
|
|
|
|
Details *StringCriterionInput `json:"details"`
|
|
|
|
// Filter to only include studios with this parent studio
|
|
|
|
Parents *MultiCriterionInput `json:"parents"`
|
|
|
|
// Filter by StashID
|
|
|
|
StashID *StringCriterionInput `json:"stash_id"`
|
|
|
|
// Filter to only include studios missing this property
|
|
|
|
IsMissing *string `json:"is_missing"`
|
|
|
|
// Filter by rating
|
|
|
|
Rating *IntCriterionInput `json:"rating"`
|
|
|
|
// Filter by scene count
|
|
|
|
SceneCount *IntCriterionInput `json:"scene_count"`
|
|
|
|
// Filter by image count
|
|
|
|
ImageCount *IntCriterionInput `json:"image_count"`
|
|
|
|
// Filter by gallery count
|
|
|
|
GalleryCount *IntCriterionInput `json:"gallery_count"`
|
|
|
|
// Filter by url
|
|
|
|
URL *StringCriterionInput `json:"url"`
|
|
|
|
// Filter by studio aliases
|
|
|
|
Aliases *StringCriterionInput `json:"aliases"`
|
|
|
|
// Filter by autotag ignore value
|
|
|
|
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
|
|
|
|
}
|
|
|
|
|
2020-09-15 07:28:53 +00:00
|
|
|
type StudioReader interface {
|
|
|
|
Find(id int) (*Studio, error)
|
|
|
|
FindMany(ids []int) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
FindChildren(id int) ([]*Studio, error)
|
2020-09-20 08:36:02 +00:00
|
|
|
FindByName(name string, nocase bool) (*Studio, error)
|
2021-11-14 20:51:52 +00:00
|
|
|
FindByStashID(stashID StashID) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Count() (int, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
All() ([]*Studio, error)
|
2021-04-26 02:51:31 +00:00
|
|
|
// TODO - this interface is temporary until the filter schema can fully
|
|
|
|
// support the query needed
|
|
|
|
QueryForAutoTag(words []string) ([]*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Query(studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int, error)
|
|
|
|
GetImage(studioID int) ([]byte, error)
|
|
|
|
HasImage(studioID int) (bool, error)
|
|
|
|
GetStashIDs(studioID int) ([]*StashID, error)
|
2021-09-09 08:13:42 +00:00
|
|
|
GetAliases(studioID int) ([]string, error)
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StudioWriter interface {
|
2020-09-20 08:36:02 +00:00
|
|
|
Create(newStudio Studio) (*Studio, error)
|
|
|
|
Update(updatedStudio StudioPartial) (*Studio, error)
|
|
|
|
UpdateFull(updatedStudio Studio) (*Studio, error)
|
2021-01-18 01:23:20 +00:00
|
|
|
Destroy(id int) error
|
|
|
|
UpdateImage(studioID int, image []byte) error
|
|
|
|
DestroyImage(studioID int) error
|
|
|
|
UpdateStashIDs(studioID int, stashIDs []StashID) error
|
2021-09-09 08:13:42 +00:00
|
|
|
UpdateAliases(studioID int, aliases []string) error
|
2020-09-15 07:28:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type StudioReaderWriter interface {
|
|
|
|
StudioReader
|
|
|
|
StudioWriter
|
|
|
|
}
|