Documentation
¶
Index ¶
- Constants
- Variables
- func GetMinResolution(f VisualFile) int
- func Rating100To5(rating100 int) int
- func Rating5To100(rating5 int) int
- type AliasLoader
- type BaseFile
- func (f *BaseFile) Base() *BaseFile
- func (f *BaseFile) Info(fs FS) (fs.FileInfo, error)
- func (f *BaseFile) Open(fs FS) (io.ReadCloser, error)
- func (f *BaseFile) Serve(fs FS, w http.ResponseWriter, r *http.Request) error
- func (f *BaseFile) SetFingerprint(fp Fingerprint)
- func (f *BaseFile) SetFingerprints(fp Fingerprints)
- type CircumcisionCriterionInput
- type CircumisedEnum
- type CriterionModifier
- type Date
- type DateCriterionInput
- type DirEntry
- type FS
- type File
- type FileCounter
- type FileCreator
- type FileDestroyer
- type FileFilterType
- type FileFinder
- type FileFinderCreator
- type FileFinderDestroyer
- type FileFinderUpdater
- type FileFingerprintWriter
- type FileGetter
- type FileID
- type FileIDLoader
- type FileLoader
- type FileOpener
- type FileQueryOptions
- type FileQueryResult
- type FileQueryer
- type FileReader
- type FileReaderWriter
- type FileUpdater
- type FileWriter
- type FilterMode
- type FindFilterType
- type Fingerprint
- type Fingerprints
- func (f Fingerprints) AppendUnique(o Fingerprint) Fingerprints
- func (f Fingerprints) ContentsChanged(other Fingerprints) bool
- func (f Fingerprints) Equals(other Fingerprints) bool
- func (f Fingerprints) For(type_ string) *Fingerprint
- func (f Fingerprints) Get(type_ string) interface{}
- func (f Fingerprints) GetInt64(type_ string) int64
- func (f Fingerprints) GetString(type_ string) string
- func (f *Fingerprints) Remove(type_ string)
- type FloatCriterionInput
- type Folder
- type FolderCounter
- type FolderCreator
- type FolderDestroyer
- type FolderFinder
- type FolderFinderCreator
- type FolderFinderDestroyer
- type FolderGetter
- type FolderID
- type FolderReader
- type FolderReaderWriter
- type FolderUpdater
- type FolderWriter
- type Gallery
- func (g Gallery) DisplayName() string
- func (g Gallery) GetTitle() string
- func (g *Gallery) IsUserCreated() bool
- func (g *Gallery) LoadFiles(ctx context.Context, l FileLoader) error
- func (g *Gallery) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
- func (g *Gallery) LoadPrimaryFile(ctx context.Context, l FileGetter) error
- func (g *Gallery) LoadSceneIDs(ctx context.Context, l SceneIDLoader) error
- func (g *Gallery) LoadTagIDs(ctx context.Context, l TagIDLoader) error
- func (g *Gallery) LoadURLs(ctx context.Context, l URLLoader) error
- func (g Gallery) PrimaryChecksum() string
- type GalleryChapter
- type GalleryChapterCreator
- type GalleryChapterCreatorUpdater
- type GalleryChapterDestroyer
- type GalleryChapterFinder
- type GalleryChapterGetter
- type GalleryChapterPartial
- type GalleryChapterReader
- type GalleryChapterReaderWriter
- type GalleryChapterUpdater
- type GalleryChapterWriter
- type GalleryCounter
- type GalleryCreator
- type GalleryCreatorUpdater
- type GalleryDestroyInput
- type GalleryDestroyer
- type GalleryFilterType
- type GalleryFinder
- type GalleryGetter
- type GalleryIDLoader
- type GalleryPartial
- type GalleryQueryer
- type GalleryReader
- type GalleryReaderWriter
- type GalleryUpdateInput
- type GalleryUpdater
- type GalleryWriter
- type GenderCriterionInput
- type GenderEnum
- type GenerateMetadataOptions
- type GeneratePreviewOptions
- type HashAlgorithm
- type HierarchicalMultiCriterionInput
- type Image
- func (i Image) DisplayName() string
- func (i Image) GetTitle() string
- func (i *Image) LoadFiles(ctx context.Context, l FileLoader) error
- func (i *Image) LoadGalleryIDs(ctx context.Context, l GalleryIDLoader) error
- func (i *Image) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
- func (i *Image) LoadPrimaryFile(ctx context.Context, l FileGetter) error
- func (i *Image) LoadTagIDs(ctx context.Context, l TagIDLoader) error
- func (i *Image) LoadURLs(ctx context.Context, l URLLoader) error
- type ImageCounter
- type ImageCreator
- type ImageCreatorUpdater
- type ImageDestroyInput
- type ImageDestroyer
- type ImageFile
- type ImageFilterType
- type ImageFinder
- type ImageGetter
- type ImageIDLoader
- type ImagePartial
- type ImageQueryOptions
- type ImageQueryResult
- type ImageQueryer
- type ImageReader
- type ImageReaderWriter
- type ImageUpdater
- type ImageWriter
- type ImagesDestroyInput
- type ImportMissingRefEnum
- type IntCriterionInput
- type MarkerStringsResultType
- type Movie
- type MovieCounter
- type MovieCreator
- type MovieCreatorUpdater
- type MovieDestroyer
- type MovieFilterType
- type MovieFinder
- type MovieFinderCreator
- type MovieGetter
- type MoviePartial
- type MovieQueryer
- type MovieReader
- type MovieReaderWriter
- type MovieUpdater
- type MovieWriter
- type MoviesScenes
- type MultiCriterionInput
- type OptionalBool
- type OptionalDate
- type OptionalFloat64
- type OptionalInt
- type OptionalInt64
- type OptionalString
- type OptionalTime
- type PHashDuplicationCriterionInput
- type PackageSource
- type PackageSpecInput
- type Performer
- func (s *Performer) LoadAliases(ctx context.Context, l AliasLoader) error
- func (s *Performer) LoadRelationships(ctx context.Context, l PerformerReader) error
- func (s *Performer) LoadStashIDs(ctx context.Context, l StashIDLoader) error
- func (s *Performer) LoadTagIDs(ctx context.Context, l TagIDLoader) error
- type PerformerAutoTagQueryer
- type PerformerCounter
- type PerformerCreateInput
- type PerformerCreator
- type PerformerCreatorUpdater
- type PerformerDestroyer
- type PerformerFilterType
- type PerformerFinder
- type PerformerFinderCreator
- type PerformerGetter
- type PerformerIDLoader
- type PerformerPartial
- type PerformerQueryer
- type PerformerReader
- type PerformerReaderWriter
- type PerformerUpdateInput
- type PerformerUpdater
- type PerformerWriter
- type PhashDistanceCriterionInput
- type PreviewPreset
- type QueryOptions
- type QueryResult
- type RatingSystem
- type RelatedFiles
- type RelatedIDs
- type RelatedMovies
- type RelatedStashIDs
- type RelatedStrings
- type RelatedVideoFiles
- type RelationshipUpdateMode
- type Repository
- type ResolutionCriterionInput
- type ResolutionEnum
- type ResolutionRange
- type SavedFilter
- type SavedFilterReader
- type SavedFilterReaderWriter
- type SavedFilterWriter
- type Scene
- func (s Scene) DisplayName() string
- func (s Scene) GetHash(hashAlgorithm HashAlgorithm) string
- func (s Scene) GetTitle() string
- func (s *Scene) LoadFiles(ctx context.Context, l VideoFileLoader) error
- func (s *Scene) LoadGalleryIDs(ctx context.Context, l GalleryIDLoader) error
- func (s *Scene) LoadMovies(ctx context.Context, l SceneMovieLoader) error
- func (s *Scene) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
- func (s *Scene) LoadPrimaryFile(ctx context.Context, l FileGetter) error
- func (s *Scene) LoadRelationships(ctx context.Context, l SceneReader) error
- func (s *Scene) LoadStashIDs(ctx context.Context, l StashIDLoader) error
- func (s *Scene) LoadTagIDs(ctx context.Context, l TagIDLoader) error
- func (s *Scene) LoadURLs(ctx context.Context, l URLLoader) error
- type SceneCounter
- type SceneCreateInput
- type SceneCreator
- type SceneCreatorUpdater
- type SceneDestroyInput
- type SceneDestroyer
- type SceneFileType
- type SceneFilterType
- type SceneFinder
- type SceneGetter
- type SceneIDLoader
- type SceneMarker
- type SceneMarkerCounter
- type SceneMarkerCreator
- type SceneMarkerCreatorUpdater
- type SceneMarkerDestroyer
- type SceneMarkerFilterType
- type SceneMarkerFinder
- type SceneMarkerGetter
- type SceneMarkerPartial
- type SceneMarkerQueryer
- type SceneMarkerReader
- type SceneMarkerReaderWriter
- type SceneMarkerUpdater
- type SceneMarkerWriter
- type SceneMovieID
- type SceneMovieInput
- type SceneMovieLoader
- type SceneParserInput
- type SceneParserResult
- type ScenePartial
- type SceneQueryOptions
- type SceneQueryResult
- type SceneQueryer
- type SceneReader
- type SceneReaderWriter
- type SceneUpdateInput
- type SceneUpdater
- type SceneWriter
- type ScenesDestroyInput
- type ScrapedMovie
- type ScrapedPerformer
- func (p *ScrapedPerformer) GetImage(ctx context.Context, excluded map[string]bool) ([]byte, error)
- func (ScrapedPerformer) IsScrapedContent()
- func (p *ScrapedPerformer) ToPartial(endpoint string, excluded map[string]bool, existingStashIDs []StashID) PerformerPartial
- func (p *ScrapedPerformer) ToPerformer(endpoint string, excluded map[string]bool) *Performer
- type ScrapedStudio
- func (s *ScrapedStudio) GetImage(ctx context.Context, excluded map[string]bool) ([]byte, error)
- func (ScrapedStudio) IsScrapedContent()
- func (s *ScrapedStudio) ToPartial(id *string, endpoint string, excluded map[string]bool, ...) *StudioPartial
- func (s *ScrapedStudio) ToStudio(endpoint string, excluded map[string]bool) *Studio
- type ScrapedTag
- type SearchSpecs
- type SortDirectionEnum
- type StashBox
- type StashBoxFingerprint
- type StashID
- type StashIDCriterionInput
- type StashIDLoader
- type StreamingResolutionEnum
- type StringCriterionInput
- type Studio
- type StudioAutoTagQueryer
- type StudioCounter
- type StudioCreateInput
- type StudioCreator
- type StudioCreatorUpdater
- type StudioDestroyer
- type StudioFilterType
- type StudioFinder
- type StudioFinderCreator
- type StudioGetter
- type StudioPartial
- type StudioQueryer
- type StudioReader
- type StudioReaderWriter
- type StudioUpdateInput
- type StudioUpdater
- type StudioWriter
- type Tag
- type TagAutoTagQueryer
- type TagCounter
- type TagCreator
- type TagCreatorUpdater
- type TagDestroyer
- type TagFilterType
- type TagFinder
- type TagFinderCreator
- type TagGetter
- type TagIDLoader
- type TagPartial
- type TagPath
- type TagQueryer
- type TagReader
- type TagReaderWriter
- type TagUpdater
- type TagWriter
- type TimestampCriterionInput
- type TxnManager
- type URLLoader
- type UpdateIDs
- type UpdateMovieIDs
- type UpdateStashIDs
- type UpdateStrings
- type VideoCaption
- type VideoFile
- type VideoFileLoader
- type VisualFile
- type ZipFS
Constants ¶
const (
FiveStar = "FiveStar"
FivePointFiveStar = "FivePointFiveStar"
FivePointTwoFiveStar = "FivePointTwoFiveStar"
// TenStar = "TenStar"
// TenPointFiveStar = "TenPointFiveStar"
// TenPointTwoFiveStar = "TenPointTwoFiveStar"
TenPointDecimal = "TenPointDecimal"
)
const DefaultGthumbWidth int = 640
const PerPageAll = -1
PerPageAll is the value used for perPage to indicate all results should be returned.
Variables ¶
var (
// ErrNotFound signifies entities which are not found
ErrNotFound = errors.New("not found")
// ErrConversion signifies conversion errors
ErrConversion = errors.New("conversion error")
ErrScraperSource = errors.New("invalid ScraperSource")
)
var (
FingerprintTypeOshash = "oshash"
FingerprintTypeMD5 = "md5"
FingerprintTypePhash = "phash"
)
var AllCircumcisionEnum = []CircumisedEnum{
CircumisedEnumCut,
CircumisedEnumUncut,
}
var AllCriterionModifier = []CriterionModifier{
CriterionModifierEquals,
CriterionModifierNotEquals,
CriterionModifierGreaterThan,
CriterionModifierLessThan,
CriterionModifierIsNull,
CriterionModifierNotNull,
CriterionModifierIncludesAll,
CriterionModifierIncludes,
CriterionModifierExcludes,
CriterionModifierMatchesRegex,
CriterionModifierNotMatchesRegex,
CriterionModifierBetween,
CriterionModifierNotBetween,
}
var AllFilterMode = []FilterMode{
FilterModeScenes,
FilterModePerformers,
FilterModeStudios,
FilterModeGalleries,
FilterModeSceneMarkers,
FilterModeMovies,
FilterModeTags,
FilterModeImages,
}
var AllGenderEnum = []GenderEnum{
GenderEnumMale,
GenderEnumFemale,
GenderEnumTransgenderMale,
GenderEnumTransgenderFemale,
GenderEnumIntersex,
GenderEnumNonBinary,
}
var AllHashAlgorithm = []HashAlgorithm{
HashAlgorithmMd5,
HashAlgorithmOshash,
}
var AllImportMissingRefEnum = []ImportMissingRefEnum{
ImportMissingRefEnumIgnore,
ImportMissingRefEnumFail,
ImportMissingRefEnumCreate,
}
var AllPreviewPreset = []PreviewPreset{
PreviewPresetUltrafast,
PreviewPresetVeryfast,
PreviewPresetFast,
PreviewPresetMedium,
PreviewPresetSlow,
PreviewPresetSlower,
PreviewPresetVeryslow,
}
var AllRelationshipUpdateMode = []RelationshipUpdateMode{
RelationshipUpdateModeSet,
RelationshipUpdateModeAdd,
RelationshipUpdateModeRemove,
}
var AllResolutionEnum = []ResolutionEnum{
ResolutionEnumVeryLow,
ResolutionEnumLow,
ResolutionEnumR360p,
ResolutionEnumStandard,
ResolutionEnumWebHd,
ResolutionEnumStandardHd,
ResolutionEnumFullHd,
ResolutionEnumQuadHd,
ResolutionEnumVrHd,
ResolutionEnumFourK,
ResolutionEnumFiveK,
ResolutionEnumSixK,
ResolutionEnumSevenK,
ResolutionEnumEightK,
ResolutionEnumHuge,
}
var AllSortDirectionEnum = []SortDirectionEnum{
SortDirectionEnumAsc,
SortDirectionEnumDesc,
}
var AllStreamingResolutionEnum = []StreamingResolutionEnum{
StreamingResolutionEnumLow,
StreamingResolutionEnumStandard,
StreamingResolutionEnumStandardHd,
StreamingResolutionEnumFullHd,
StreamingResolutionEnumFourK,
StreamingResolutionEnumOriginal,
}
Functions ¶
func GetMinResolution ¶ added in v0.23.0
func GetMinResolution(f VisualFile) int
func Rating100To5 ¶ added in v0.18.0
func Rating100To5(rating100 int) int
Rating100To5 converts a 1-100 rating to a 1-5 rating. Values <= 30 are converted to 1. Otherwise, rating is divided by 20 and rounded to the nearest integer.
func Rating5To100 ¶ added in v0.18.0
func Rating5To100(rating5 int) int
Rating5To100 converts a 1-5 rating to a 1-100 rating
Types ¶
type AliasLoader ¶ added in v0.19.0
type AliasLoader interface {
GetAliases(ctx context.Context, relatedID int) ([]string, error)
}
type BaseFile ¶ added in v0.23.0
type BaseFile struct {
ID FileID `json:"id"`
DirEntry
// resolved from parent folder and basename only - not stored in DB
Path string `json:"path"`
Basename string `json:"basename"`
ParentFolderID FolderID `json:"parent_folder_id"`
Fingerprints Fingerprints `json:"fingerprints"`
Size int64 `json:"size"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
BaseFile represents a file in the file system.
func (*BaseFile) Base ¶ added in v0.23.0
func (f *BaseFile) Base() *BaseFile
Base is used to fulfil the File interface.
func (*BaseFile) Serve ¶ added in v0.23.0
func (f *BaseFile) Serve(fs FS, w http.ResponseWriter, r *http.Request) error
func (*BaseFile) SetFingerprint ¶ added in v0.23.0
func (f *BaseFile) SetFingerprint(fp Fingerprint)
SetFingerprint sets the fingerprint of the file. If a fingerprint of the same type already exists, it is overwritten.
func (*BaseFile) SetFingerprints ¶ added in v0.23.0
func (f *BaseFile) SetFingerprints(fp Fingerprints)
SetFingerprints sets the fingerprints of the file. If a fingerprint of the same type already exists, it is overwritten.
type CircumcisionCriterionInput ¶ added in v0.21.0
type CircumcisionCriterionInput struct {
Value []CircumisedEnum `json:"value"`
Modifier CriterionModifier `json:"modifier"`
}
type CircumisedEnum ¶ added in v0.21.0
type CircumisedEnum string
const (
CircumisedEnumCut CircumisedEnum = "CUT"
CircumisedEnumUncut CircumisedEnum = "UNCUT"
)
func (CircumisedEnum) MarshalGQL ¶ added in v0.21.0
func (e CircumisedEnum) MarshalGQL(w io.Writer)
func (*CircumisedEnum) UnmarshalGQL ¶ added in v0.21.0
func (e *CircumisedEnum) UnmarshalGQL(v interface{}) error
type CriterionModifier ¶ added in v0.17.0
type CriterionModifier string
const (
// =
CriterionModifierEquals CriterionModifier = "EQUALS"
// !=
CriterionModifierNotEquals CriterionModifier = "NOT_EQUALS"
// >
CriterionModifierGreaterThan CriterionModifier = "GREATER_THAN"
// <
CriterionModifierLessThan CriterionModifier = "LESS_THAN"
// IS NULL
CriterionModifierIsNull CriterionModifier = "IS_NULL"
// IS NOT NULL
CriterionModifierNotNull CriterionModifier = "NOT_NULL"
// INCLUDES ALL
CriterionModifierIncludesAll CriterionModifier = "INCLUDES_ALL"
CriterionModifierIncludes CriterionModifier = "INCLUDES"
CriterionModifierExcludes CriterionModifier = "EXCLUDES"
// MATCHES REGEX
CriterionModifierMatchesRegex CriterionModifier = "MATCHES_REGEX"
// NOT MATCHES REGEX
CriterionModifierNotMatchesRegex CriterionModifier = "NOT_MATCHES_REGEX"
// >= AND <=
CriterionModifierBetween CriterionModifier = "BETWEEN"
// < OR >
CriterionModifierNotBetween CriterionModifier = "NOT_BETWEEN"
)
func (CriterionModifier) MarshalGQL ¶ added in v0.17.0
func (e CriterionModifier) MarshalGQL(w io.Writer)
func (*CriterionModifier) UnmarshalGQL ¶ added in v0.17.0
func (e *CriterionModifier) UnmarshalGQL(v interface{}) error
type Date ¶ added in v0.17.0
type Date struct {
time.Time
}
Date wraps a time.Time with a format of "YYYY-MM-DD"
type DateCriterionInput ¶ added in v0.18.0
type DateCriterionInput struct {
Value string `json:"value"`
Value2 *string `json:"value2"`
Modifier CriterionModifier `json:"modifier"`
}
type DirEntry ¶ added in v0.23.0
type DirEntry struct {
ZipFileID *FileID `json:"zip_file_id"`
// transient - not persisted
// only guaranteed to have id, path and basename set
ZipFile File
ModTime time.Time `json:"mod_time"`
}
DirEntry represents a file or directory in the file system.
type FS ¶ added in v0.23.0
type FS interface {
Stat(name string) (fs.FileInfo, error)
Lstat(name string) (fs.FileInfo, error)
Open(name string) (fs.ReadDirFile, error)
OpenZip(name string) (ZipFS, error)
IsPathCaseSensitive(path string) (bool, error)
}
FS represents a file system.
type File ¶ added in v0.11.0
type File interface {
Base() *BaseFile
SetFingerprints(fp Fingerprints)
Open(fs FS) (io.ReadCloser, error)
}
File represents a file in the file system.
type FileCounter ¶ added in v0.23.0
type FileCounter interface {
CountAllInPaths(ctx context.Context, p []string) (int, error)
CountByFolderID(ctx context.Context, folderID FolderID) (int, error)
}
FileCounter provides methods to count files.
type FileCreator ¶ added in v0.23.0
type FileCreator interface {
Create(ctx context.Context, f File) error
}
FileCreator provides methods to create files.
type FileDestroyer ¶ added in v0.23.0
type FileDestroyer interface {
Destroy(ctx context.Context, id FileID) error
}
FileDestroyer provides methods to destroy files.
type FileFilterType ¶ added in v0.17.0
type FileFilterType struct {
And *FileFilterType `json:"AND"`
Or *FileFilterType `json:"OR"`
Not *FileFilterType `json:"NOT"`
// Filter by path
Path *StringCriterionInput `json:"path"`
}
func PathsFileFilter ¶ added in v0.17.0
func PathsFileFilter(paths []string) *FileFilterType
type FileFinder ¶ added in v0.23.0
type FileFinder interface {
FileGetter
FindAllByPath(ctx context.Context, path string) ([]File, error)
FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]File, error)
FindByPath(ctx context.Context, path string) (File, error)
FindByFingerprint(ctx context.Context, fp Fingerprint) ([]File, error)
FindByZipFileID(ctx context.Context, zipFileID FileID) ([]File, error)
FindByFileInfo(ctx context.Context, info fs.FileInfo, size int64) ([]File, error)
}
FileFinder provides methods to find files.
type FileFinderCreator ¶ added in v0.23.0
type FileFinderCreator interface {
FileFinder
FileCreator
}
type FileFinderDestroyer ¶ added in v0.23.0
type FileFinderDestroyer interface {
FileFinder
FileDestroyer
}
type FileFinderUpdater ¶ added in v0.23.0
type FileFinderUpdater interface {
FileFinder
FileUpdater
}
type FileFingerprintWriter ¶ added in v0.24.0
type FileFingerprintWriter interface {
ModifyFingerprints(ctx context.Context, fileID FileID, fingerprints []Fingerprint) error
DestroyFingerprints(ctx context.Context, fileID FileID, types []string) error
}
type FileGetter ¶ added in v0.23.0
type FileGetter interface {
Find(ctx context.Context, id ...FileID) ([]File, error)
}
FileGetter provides methods to get files by ID.
type FileID ¶ added in v0.23.0
type FileID int32
ID represents an ID of a file.
func (FileID) MarshalGQL ¶ added in v0.23.0
func (i FileID) MarshalGQL(w io.Writer)
func (*FileID) UnmarshalGQL ¶ added in v0.23.0
func (i *FileID) UnmarshalGQL(v interface{}) (err error)
type FileIDLoader ¶ added in v0.23.0
type FileIDLoader interface {
GetManyFileIDs(ctx context.Context, ids []int) ([][]FileID, error)
}
type FileLoader ¶ added in v0.17.0
type FileLoader interface {
GetFiles(ctx context.Context, relatedID int) ([]File, error)
}
type FileOpener ¶ added in v0.23.0
type FileOpener interface {
Open() (io.ReadCloser, error)
}
FileOpener provides an interface to open a file.
type FileQueryOptions ¶ added in v0.17.0
type FileQueryOptions struct {
QueryOptions
FileFilter *FileFilterType
}
type FileQueryResult ¶ added in v0.17.0
type FileQueryResult struct {
IDs []FileID
Count int
// contains filtered or unexported fields
}
func NewFileQueryResult ¶ added in v0.17.0
func NewFileQueryResult(fileGetter FileGetter) *FileQueryResult
type FileQueryer ¶ added in v0.23.0
type FileQueryer interface {
Query(ctx context.Context, options FileQueryOptions) (*FileQueryResult, error)
}
FileQueryer provides methods to query files.
type FileReader ¶ added in v0.23.0
type FileReader interface {
FileFinder
FileQueryer
FileCounter
GetCaptions(ctx context.Context, fileID FileID) ([]*VideoCaption, error)
IsPrimary(ctx context.Context, fileID FileID) (bool, error)
}
FileReader provides all methods to read files.
type FileReaderWriter ¶ added in v0.23.0
type FileReaderWriter interface {
FileReader
FileWriter
}
FileReaderWriter provides all file methods.
type FileUpdater ¶ added in v0.23.0
type FileUpdater interface {
Update(ctx context.Context, f File) error
}
FileUpdater provides methods to update files.
type FileWriter ¶ added in v0.23.0
type FileWriter interface {
FileCreator
FileUpdater
FileDestroyer
FileFingerprintWriter
UpdateCaptions(ctx context.Context, fileID FileID, captions []*VideoCaption) error
}
FileWriter provides all methods to modify files.
type FilterMode ¶ added in v0.17.0
type FilterMode string
const (
FilterModeScenes FilterMode = "SCENES"
FilterModePerformers FilterMode = "PERFORMERS"
FilterModeStudios FilterMode = "STUDIOS"
FilterModeGalleries FilterMode = "GALLERIES"
FilterModeSceneMarkers FilterMode = "SCENE_MARKERS"
FilterModeMovies FilterMode = "MOVIES"
FilterModeTags FilterMode = "TAGS"
FilterModeImages FilterMode = "IMAGES"
)
func (FilterMode) MarshalGQL ¶ added in v0.17.0
func (e FilterMode) MarshalGQL(w io.Writer)
func (*FilterMode) UnmarshalGQL ¶ added in v0.17.0
func (e *FilterMode) UnmarshalGQL(v interface{}) error
type FindFilterType ¶ added in v0.17.0
type FindFilterType struct {
Q *string `json:"q"`
Page *int `json:"page"`
// use per_page = -1 to indicate all results. Defaults to 25.
PerPage *int `json:"per_page"`
Sort *string `json:"sort"`
Direction *SortDirectionEnum `json:"direction"`
}
func BatchFindFilter ¶ added in v0.17.0
func BatchFindFilter(batchSize int) *FindFilterType
BatchFindFilter returns a FindFilterType suitable for batch finding using the provided batch size.
func (FindFilterType) GetDirection ¶ added in v0.17.0
func (ff FindFilterType) GetDirection() string
func (FindFilterType) GetPageSize ¶ added in v0.17.0
func (ff FindFilterType) GetPageSize() int
type Fingerprint ¶ added in v0.23.0
type Fingerprint struct {
Type string
Fingerprint interface{}
}
Fingerprint represents a fingerprint of a file.
type Fingerprints ¶ added in v0.23.0
type Fingerprints []Fingerprint
func (Fingerprints) AppendUnique ¶ added in v0.23.0
func (f Fingerprints) AppendUnique(o Fingerprint) Fingerprints
AppendUnique appends a fingerprint to the list if a Fingerprint of the same type does not already exist in the list. If one does, then it is updated with o's Fingerprint value.
func (Fingerprints) ContentsChanged ¶ added in v0.23.0
func (f Fingerprints) ContentsChanged(other Fingerprints) bool
ContentsChanged returns true if this Fingerprints slice contains any Fingerprints that different Fingerprint values for the matching type in other, or if this slice contains any Fingerprint types that are not in other.
func (Fingerprints) Equals ¶ added in v0.23.0
func (f Fingerprints) Equals(other Fingerprints) bool
Equals returns true if the contents of this slice are equal to those in the other slice.
func (Fingerprints) For ¶ added in v0.23.0
func (f Fingerprints) For(type_ string) *Fingerprint
For returns a pointer to the first Fingerprint element matching the provided type.
type FloatCriterionInput ¶ added in v0.21.0
type FloatCriterionInput struct {
Value float64 `json:"value"`
Value2 *float64 `json:"value2"`
Modifier CriterionModifier `json:"modifier"`
}
func (FloatCriterionInput) ValidModifier ¶ added in v0.21.0
func (i FloatCriterionInput) ValidModifier() bool
type Folder ¶ added in v0.23.0
type Folder struct {
ID FolderID `json:"id"`
DirEntry
Path string `json:"path"`
ParentFolderID *FolderID `json:"parent_folder_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Folder represents a folder in the file system.
type FolderCounter ¶ added in v0.23.0
type FolderCounter interface {
CountAllInPaths(ctx context.Context, p []string) (int, error)
}
type FolderCreator ¶ added in v0.23.0
type FolderCreator interface {
Create(ctx context.Context, f *Folder) error
}
FolderCreator provides methods to create folders.
type FolderDestroyer ¶ added in v0.23.0
type FolderDestroyer interface {
Destroy(ctx context.Context, id FolderID) error
}
type FolderFinder ¶ added in v0.23.0
type FolderFinder interface {
FolderGetter
FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]*Folder, error)
FindByPath(ctx context.Context, path string) (*Folder, error)
FindByZipFileID(ctx context.Context, zipFileID FileID) ([]*Folder, error)
FindByParentFolderID(ctx context.Context, parentFolderID FolderID) ([]*Folder, error)
}
FolderFinder provides methods to find folders.
type FolderFinderCreator ¶ added in v0.23.0
type FolderFinderCreator interface {
FolderFinder
FolderCreator
}
type FolderFinderDestroyer ¶ added in v0.23.0
type FolderFinderDestroyer interface {
FolderFinder
FolderDestroyer
}
type FolderGetter ¶ added in v0.23.0
type FolderGetter interface {
Find(ctx context.Context, id FolderID) (*Folder, error)
}
FolderGetter provides methods to get folders by ID.
type FolderID ¶ added in v0.23.0
type FolderID int32
FolderID represents an ID of a folder.
func (FolderID) MarshalGQL ¶ added in v0.23.0
func (i FolderID) MarshalGQL(w io.Writer)
func (FolderID) String ¶ added in v0.23.0
func (i FolderID) String() string
String converts the ID to a string.
func (*FolderID) UnmarshalGQL ¶ added in v0.23.0
func (i *FolderID) UnmarshalGQL(v interface{}) (err error)
type FolderReader ¶ added in v0.23.0
type FolderReader interface {
FolderFinder
FolderCounter
}
FolderReader provides all methods to read folders.
type FolderReaderWriter ¶ added in v0.23.0
type FolderReaderWriter interface {
FolderReader
FolderWriter
}
FolderReaderWriter provides all folder methods.
type FolderUpdater ¶ added in v0.23.0
type FolderUpdater interface {
Update(ctx context.Context, f *Folder) error
}
FolderUpdater provides methods to update folders.
type FolderWriter ¶ added in v0.23.0
type FolderWriter interface {
FolderCreator
FolderUpdater
FolderDestroyer
}
FolderWriter provides all methods to modify folders.
type Gallery ¶
type Gallery struct {
ID int `json:"id"`
Title string `json:"title"`
Code string `json:"code"`
Date *Date `json:"date"`
Details string `json:"details"`
Photographer string `json:"photographer"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Organized bool `json:"organized"`
StudioID *int `json:"studio_id"`
// transient - not persisted
Files RelatedFiles
// transient - not persisted
PrimaryFileID *FileID
// transient - path of primary file or folder
Path string
FolderID *FolderID `json:"folder_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
URLs RelatedStrings `json:"urls"`
SceneIDs RelatedIDs `json:"scene_ids"`
TagIDs RelatedIDs `json:"tag_ids"`
PerformerIDs RelatedIDs `json:"performer_ids"`
}
func NewGallery ¶ added in v0.23.0
func NewGallery() Gallery
func (Gallery) DisplayName ¶ added in v0.17.0
func (g Gallery) DisplayName() string
DisplayName returns a display name for the scene for logging purposes. It returns the path or title, or otherwise it returns the ID if both of these are empty.
func (Gallery) GetTitle ¶ added in v0.7.0
func (g Gallery) GetTitle() string
GetTitle returns the title of the scene. If the Title field is empty, then the base filename is returned.
func (*Gallery) IsUserCreated ¶ added in v0.18.0
func (g *Gallery) IsUserCreated() bool
IsUserCreated returns true if the gallery was created by the user. This is determined by whether the gallery has a primary file or folder.
func (*Gallery) LoadFiles ¶ added in v0.17.0
func (g *Gallery) LoadFiles(ctx context.Context, l FileLoader) error
func (*Gallery) LoadPerformerIDs ¶ added in v0.17.0
func (g *Gallery) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
func (*Gallery) LoadPrimaryFile ¶ added in v0.17.0
func (g *Gallery) LoadPrimaryFile(ctx context.Context, l FileGetter) error
func (*Gallery) LoadSceneIDs ¶ added in v0.17.0
func (g *Gallery) LoadSceneIDs(ctx context.Context, l SceneIDLoader) error
func (*Gallery) LoadTagIDs ¶ added in v0.17.0
func (g *Gallery) LoadTagIDs(ctx context.Context, l TagIDLoader) error
func (*Gallery) LoadURLs ¶ added in v0.23.0
func (g *Gallery) LoadURLs(ctx context.Context, l URLLoader) error
func (Gallery) PrimaryChecksum ¶ added in v0.17.0
func (g Gallery) PrimaryChecksum() string
type GalleryChapter ¶ added in v0.20.0
type GalleryChapter struct {
ID int `json:"id"`
Title string `json:"title"`
ImageIndex int `json:"image_index"`
GalleryID int `json:"gallery_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func NewGalleryChapter ¶ added in v0.23.0
func NewGalleryChapter() GalleryChapter
type GalleryChapterCreator ¶ added in v0.23.0
type GalleryChapterCreator interface {
Create(ctx context.Context, newGalleryChapter *GalleryChapter) error
}
GalleryChapterCreator provides methods to create gallery chapters.
type GalleryChapterCreatorUpdater ¶ added in v0.23.0
type GalleryChapterCreatorUpdater interface {
GalleryChapterCreator
GalleryChapterUpdater
}
type GalleryChapterDestroyer ¶ added in v0.23.0
type GalleryChapterDestroyer interface {
Destroy(ctx context.Context, id int) error
}
GalleryChapterDestroyer provides methods to destroy gallery chapters.
type GalleryChapterFinder ¶ added in v0.23.0
type GalleryChapterFinder interface {
GalleryChapterGetter
FindByGalleryID(ctx context.Context, galleryID int) ([]*GalleryChapter, error)
}
GalleryChapterFinder provides methods to find gallery chapters.
type GalleryChapterGetter ¶ added in v0.23.0
type GalleryChapterGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*GalleryChapter, error)
Find(ctx context.Context, id int) (*GalleryChapter, error)
}
GalleryChapterGetter provides methods to get gallery chapters by ID.
type GalleryChapterPartial ¶ added in v0.22.0
type GalleryChapterPartial struct {
Title OptionalString
ImageIndex OptionalInt
GalleryID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
}
GalleryChapterPartial represents part of a GalleryChapter object. It is used to update the database entry.
func NewGalleryChapterPartial ¶ added in v0.22.0
func NewGalleryChapterPartial() GalleryChapterPartial
type GalleryChapterReader ¶ added in v0.20.0
type GalleryChapterReader interface {
GalleryChapterFinder
}
GalleryChapterReader provides all methods to read gallery chapters.
type GalleryChapterReaderWriter ¶ added in v0.20.0
type GalleryChapterReaderWriter interface {
GalleryChapterReader
GalleryChapterWriter
}
GalleryChapterReaderWriter provides all gallery chapter methods.
type GalleryChapterUpdater ¶ added in v0.23.0
type GalleryChapterUpdater interface {
Update(ctx context.Context, updatedGalleryChapter *GalleryChapter) error
UpdatePartial(ctx context.Context, id int, updatedGalleryChapter GalleryChapterPartial) (*GalleryChapter, error)
}
GalleryChapterUpdater provides methods to update gallery chapters.
type GalleryChapterWriter ¶ added in v0.20.0
type GalleryChapterWriter interface {
GalleryChapterCreator
GalleryChapterUpdater
GalleryChapterDestroyer
}
GalleryChapterWriter provides all methods to modify gallery chapters.
type GalleryCounter ¶ added in v0.23.0
type GalleryCounter interface {
Count(ctx context.Context) (int, error)
CountByFileID(ctx context.Context, fileID FileID) (int, error)
}
GalleryCounter provides methods to count galleries.
type GalleryCreator ¶ added in v0.23.0
type GalleryCreator interface {
Create(ctx context.Context, newGallery *Gallery, fileIDs []FileID) error
}
GalleryCreator provides methods to create galleries.
type GalleryCreatorUpdater ¶ added in v0.23.0
type GalleryCreatorUpdater interface {
GalleryCreator
GalleryUpdater
}
type GalleryDestroyInput ¶ added in v0.17.0
type GalleryDestroyInput struct {
Ids []string `json:"ids"`
// If true, then the zip file will be deleted if the gallery is zip-file-based.
// If gallery is folder-based, then any files not associated with other
// galleries will be deleted, along with the folder, if it is not empty.
DeleteFile *bool `json:"delete_file"`
DeleteGenerated *bool `json:"delete_generated"`
}
type GalleryDestroyer ¶ added in v0.23.0
type GalleryDestroyer interface {
Destroy(ctx context.Context, id int) error
}
GalleryDestroyer provides methods to destroy galleries.
type GalleryFilterType ¶ added in v0.17.0
type GalleryFilterType struct {
And *GalleryFilterType `json:"AND"`
Or *GalleryFilterType `json:"OR"`
Not *GalleryFilterType `json:"NOT"`
ID *IntCriterionInput `json:"id"`
Title *StringCriterionInput `json:"title"`
Code *StringCriterionInput `json:"code"`
Details *StringCriterionInput `json:"details"`
Photographer *StringCriterionInput `json:"photographer"`
// Filter by file checksum
Checksum *StringCriterionInput `json:"checksum"`
// Filter by path
Path *StringCriterionInput `json:"path"`
// Filter by zip file count
FileCount *IntCriterionInput `json:"file_count"`
// Filter to only include galleries missing this property
IsMissing *string `json:"is_missing"`
// Filter to include/exclude galleries that were created from zip
IsZip *bool `json:"is_zip"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// Filter by organized
Organized *bool `json:"organized"`
// Filter by average image resolution
AverageResolution *ResolutionCriterionInput `json:"average_resolution"`
// Filter to only include scenes which have chapters. `true` or `false`
HasChapters *string `json:"has_chapters"`
// Filter to only include galleries with this studio
Studios *HierarchicalMultiCriterionInput `json:"studios"`
// Filter to only include galleries with these tags
Tags *HierarchicalMultiCriterionInput `json:"tags"`
// Filter by tag count
TagCount *IntCriterionInput `json:"tag_count"`
// Filter to only include galleries with performers with these tags
PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
// Filter to only include galleries with these performers
Performers *MultiCriterionInput `json:"performers"`
// Filter by performer count
PerformerCount *IntCriterionInput `json:"performer_count"`
// Filter galleries that have performers that have been favorited
PerformerFavorite *bool `json:"performer_favorite"`
// Filter galleries by performer age at time of gallery
PerformerAge *IntCriterionInput `json:"performer_age"`
// Filter by number of images in this gallery
ImageCount *IntCriterionInput `json:"image_count"`
// Filter by url
URL *StringCriterionInput `json:"url"`
// Filter by date
Date *DateCriterionInput `json:"date"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type GalleryFinder ¶ added in v0.17.0
type GalleryFinder interface {
GalleryGetter
FindByFingerprints(ctx context.Context, fp []Fingerprint) ([]*Gallery, error)
FindByChecksum(ctx context.Context, checksum string) ([]*Gallery, error)
FindByChecksums(ctx context.Context, checksums []string) ([]*Gallery, error)
FindByPath(ctx context.Context, path string) ([]*Gallery, error)
FindByFileID(ctx context.Context, fileID FileID) ([]*Gallery, error)
FindByFolderID(ctx context.Context, folderID FolderID) ([]*Gallery, error)
FindBySceneID(ctx context.Context, sceneID int) ([]*Gallery, error)
FindByImageID(ctx context.Context, imageID int) ([]*Gallery, error)
FindUserGalleryByTitle(ctx context.Context, title string) ([]*Gallery, error)
}
GalleryFinder provides methods to find galleries.
type GalleryGetter ¶ added in v0.23.0
type GalleryGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Gallery, error)
Find(ctx context.Context, id int) (*Gallery, error)
}
GalleryGetter provides methods to get galleries by ID.
type GalleryIDLoader ¶ added in v0.17.0
type GalleryIDLoader interface {
GetGalleryIDs(ctx context.Context, relatedID int) ([]int, error)
}
type GalleryPartial ¶ added in v0.4.0
type GalleryPartial struct {
// Path OptionalString
// Checksum OptionalString
// Zip OptionalBool
Title OptionalString
Code OptionalString
URLs *UpdateStrings
Date OptionalDate
Details OptionalString
Photographer OptionalString
// Rating expressed in 1-100 scale
Rating OptionalInt
Organized OptionalBool
StudioID OptionalInt
// FileModTime OptionalTime
CreatedAt OptionalTime
UpdatedAt OptionalTime
SceneIDs *UpdateIDs
TagIDs *UpdateIDs
PerformerIDs *UpdateIDs
PrimaryFileID *FileID
}
GalleryPartial represents part of a Gallery object. It is used to update the database entry. Only non-nil fields will be updated.
func NewGalleryPartial ¶ added in v0.17.0
func NewGalleryPartial() GalleryPartial
type GalleryQueryer ¶ added in v0.23.0
type GalleryQueryer interface {
Query(ctx context.Context, galleryFilter *GalleryFilterType, findFilter *FindFilterType) ([]*Gallery, int, error)
QueryCount(ctx context.Context, galleryFilter *GalleryFilterType, findFilter *FindFilterType) (int, error)
}
GalleryQueryer provides methods to query galleries.
type GalleryReader ¶ added in v0.4.0
type GalleryReader interface {
GalleryFinder
GalleryQueryer
GalleryCounter
URLLoader
FileIDLoader
ImageIDLoader
SceneIDLoader
PerformerIDLoader
TagIDLoader
FileLoader
All(ctx context.Context) ([]*Gallery, error)
}
GalleryReader provides all methods to read galleries.
type GalleryReaderWriter ¶ added in v0.4.0
type GalleryReaderWriter interface {
GalleryReader
GalleryWriter
}
GalleryReaderWriter provides all gallery methods.
type GalleryUpdateInput ¶ added in v0.17.0
type GalleryUpdateInput struct {
ClientMutationID *string `json:"clientMutationId"`
ID string `json:"id"`
Title *string `json:"title"`
Code *string `json:"code"`
Urls []string `json:"urls"`
Date *string `json:"date"`
Details *string `json:"details"`
Photographer *string `json:"photographer"`
Rating100 *int `json:"rating100"`
Organized *bool `json:"organized"`
SceneIds []string `json:"scene_ids"`
StudioID *string `json:"studio_id"`
TagIds []string `json:"tag_ids"`
PerformerIds []string `json:"performer_ids"`
PrimaryFileID *string `json:"primary_file_id"`
// deprecated
URL *string `json:"url"`
}
type GalleryUpdater ¶ added in v0.23.0
type GalleryUpdater interface {
Update(ctx context.Context, updatedGallery *Gallery) error
UpdatePartial(ctx context.Context, id int, updatedGallery GalleryPartial) (*Gallery, error)
UpdateImages(ctx context.Context, galleryID int, imageIDs []int) error
}
GalleryUpdater provides methods to update galleries.
type GalleryWriter ¶ added in v0.4.0
type GalleryWriter interface {
GalleryCreator
GalleryUpdater
GalleryDestroyer
AddFileID(ctx context.Context, id int, fileID FileID) error
AddImages(ctx context.Context, galleryID int, imageIDs ...int) error
RemoveImages(ctx context.Context, galleryID int, imageIDs ...int) error
}
GalleryWriter provides all methods to modify galleries.
type GenderCriterionInput ¶ added in v0.17.0
type GenderCriterionInput struct {
Value *GenderEnum `json:"value"`
Modifier CriterionModifier `json:"modifier"`
}
type GenderEnum ¶ added in v0.17.0
type GenderEnum string
const (
GenderEnumMale GenderEnum = "MALE"
GenderEnumFemale GenderEnum = "FEMALE"
GenderEnumTransgenderMale GenderEnum = "TRANSGENDER_MALE"
GenderEnumTransgenderFemale GenderEnum = "TRANSGENDER_FEMALE"
GenderEnumIntersex GenderEnum = "INTERSEX"
GenderEnumNonBinary GenderEnum = "NON_BINARY"
)
func (GenderEnum) MarshalGQL ¶ added in v0.17.0
func (e GenderEnum) MarshalGQL(w io.Writer)
func (*GenderEnum) UnmarshalGQL ¶ added in v0.17.0
func (e *GenderEnum) UnmarshalGQL(v interface{}) error
type GenerateMetadataOptions ¶ added in v0.17.0
type GenerateMetadataOptions struct {
Covers bool `json:"covers"`
Sprites bool `json:"sprites"`
Previews bool `json:"previews"`
ImagePreviews bool `json:"imagePreviews"`
PreviewOptions *GeneratePreviewOptions `json:"previewOptions"`
Markers bool `json:"markers"`
MarkerImagePreviews bool `json:"markerImagePreviews"`
MarkerScreenshots bool `json:"markerScreenshots"`
Transcodes bool `json:"transcodes"`
Phashes bool `json:"phashes"`
InteractiveHeatmapsSpeeds bool `json:"interactiveHeatmapsSpeeds"`
ClipPreviews bool `json:"clipPreviews"`
}
type GeneratePreviewOptions ¶ added in v0.17.0
type GeneratePreviewOptions struct {
// Number of segments in a preview file
PreviewSegments *int `json:"previewSegments"`
// Preview segment duration, in seconds
PreviewSegmentDuration *float64 `json:"previewSegmentDuration"`
// Duration of start of video to exclude when generating previews
PreviewExcludeStart *string `json:"previewExcludeStart"`
// Duration of end of video to exclude when generating previews
PreviewExcludeEnd *string `json:"previewExcludeEnd"`
// Preset when generating preview
PreviewPreset *PreviewPreset `json:"previewPreset"`
}
type HashAlgorithm ¶ added in v0.17.0
type HashAlgorithm string
const (
HashAlgorithmMd5 HashAlgorithm = "MD5"
// oshash
HashAlgorithmOshash HashAlgorithm = "OSHASH"
)
func (HashAlgorithm) MarshalGQL ¶ added in v0.17.0
func (e HashAlgorithm) MarshalGQL(w io.Writer)
func (*HashAlgorithm) UnmarshalGQL ¶ added in v0.17.0
func (e *HashAlgorithm) UnmarshalGQL(v interface{}) error
type HierarchicalMultiCriterionInput ¶ added in v0.17.0
type HierarchicalMultiCriterionInput struct {
Value []string `json:"value"`
Modifier CriterionModifier `json:"modifier"`
Depth *int `json:"depth"`
Excludes []string `json:"excludes"`
}
func (HierarchicalMultiCriterionInput) CombineExcludes ¶ added in v0.21.0
func (i HierarchicalMultiCriterionInput) CombineExcludes() HierarchicalMultiCriterionInput
type Image ¶ added in v0.4.0
type Image struct {
ID int `json:"id"`
Title string `json:"title"`
Code string `json:"code"`
Details string `json:"details"`
Photographer string `json:"photographer"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Organized bool `json:"organized"`
OCounter int `json:"o_counter"`
StudioID *int `json:"studio_id"`
URLs RelatedStrings `json:"urls"`
Date *Date `json:"date"`
// transient - not persisted
Files RelatedFiles
PrimaryFileID *FileID
// transient - path of primary file - empty if no files
Path string
// transient - checksum of primary file - empty if no files
Checksum string
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
GalleryIDs RelatedIDs `json:"gallery_ids"`
TagIDs RelatedIDs `json:"tag_ids"`
PerformerIDs RelatedIDs `json:"performer_ids"`
}
Image stores the metadata for a single image.
func (Image) DisplayName ¶ added in v0.17.0
func (i Image) DisplayName() string
DisplayName returns a display name for the scene for logging purposes. It returns Path if not empty, otherwise it returns the ID.
func (Image) GetTitle ¶ added in v0.7.0
func (i Image) GetTitle() string
GetTitle returns the title of the image. If the Title field is empty, then the base filename is returned.
func (*Image) LoadFiles ¶ added in v0.17.0
func (i *Image) LoadFiles(ctx context.Context, l FileLoader) error
func (*Image) LoadGalleryIDs ¶ added in v0.17.0
func (i *Image) LoadGalleryIDs(ctx context.Context, l GalleryIDLoader) error
func (*Image) LoadPerformerIDs ¶ added in v0.17.0
func (i *Image) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
func (*Image) LoadPrimaryFile ¶ added in v0.17.0
func (i *Image) LoadPrimaryFile(ctx context.Context, l FileGetter) error
func (*Image) LoadTagIDs ¶ added in v0.17.0
func (i *Image) LoadTagIDs(ctx context.Context, l TagIDLoader) error
type ImageCounter ¶ added in v0.23.0
type ImageCounter interface {
Count(ctx context.Context) (int, error)
CountByFileID(ctx context.Context, fileID FileID) (int, error)
CountByGalleryID(ctx context.Context, galleryID int) (int, error)
OCount(ctx context.Context) (int, error)
OCountByPerformerID(ctx context.Context, performerID int) (int, error)
}
ImageCounter provides methods to count images.
type ImageCreator ¶ added in v0.23.0
type ImageCreator interface {
Create(ctx context.Context, newImage *Image, fileIDs []FileID) error
}
ImageCreator provides methods to create images.
type ImageCreatorUpdater ¶ added in v0.23.0
type ImageCreatorUpdater interface {
ImageCreator
ImageUpdater
}
type ImageDestroyInput ¶ added in v0.17.0
type ImageDestroyInput struct {
ID string `json:"id"`
DeleteFile *bool `json:"delete_file"`
DeleteGenerated *bool `json:"delete_generated"`
}
type ImageDestroyer ¶ added in v0.23.0
type ImageDestroyer interface {
Destroy(ctx context.Context, id int) error
}
ImageDestroyer provides methods to destroy images.
type ImageFile ¶ added in v0.23.0
type ImageFile struct {
*BaseFile
Format string `json:"format"`
Width int `json:"width"`
Height int `json:"height"`
}
ImageFile is an extension of BaseFile to represent image files.
type ImageFilterType ¶ added in v0.17.0
type ImageFilterType struct {
And *ImageFilterType `json:"AND"`
Or *ImageFilterType `json:"OR"`
Not *ImageFilterType `json:"NOT"`
ID *IntCriterionInput `json:"id"`
Title *StringCriterionInput `json:"title"`
Code *StringCriterionInput `json:"code"`
Details *StringCriterionInput `json:"details"`
Photographer *StringCriterionInput `json:"photographer"`
// Filter by file checksum
Checksum *StringCriterionInput `json:"checksum"`
// Filter by path
Path *StringCriterionInput `json:"path"`
// Filter by file count
FileCount *IntCriterionInput `json:"file_count"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// Filter by date
Date *DateCriterionInput `json:"date"`
// Filter by url
URL *StringCriterionInput `json:"url"`
// Filter by organized
Organized *bool `json:"organized"`
// Filter by o-counter
OCounter *IntCriterionInput `json:"o_counter"`
// Filter by resolution
Resolution *ResolutionCriterionInput `json:"resolution"`
// Filter to only include images missing this property
IsMissing *string `json:"is_missing"`
// Filter to only include images with this studio
Studios *HierarchicalMultiCriterionInput `json:"studios"`
// Filter to only include images with these tags
Tags *HierarchicalMultiCriterionInput `json:"tags"`
// Filter by tag count
TagCount *IntCriterionInput `json:"tag_count"`
// Filter to only include images with performers with these tags
PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
// Filter to only include images with these performers
Performers *MultiCriterionInput `json:"performers"`
// Filter by performer count
PerformerCount *IntCriterionInput `json:"performer_count"`
// Filter images that have performers that have been favorited
PerformerFavorite *bool `json:"performer_favorite"`
// Filter to only include images with these galleries
Galleries *MultiCriterionInput `json:"galleries"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type ImageFinder ¶ added in v0.11.0
type ImageFinder interface {
ImageGetter
FindByFingerprints(ctx context.Context, fp []Fingerprint) ([]*Image, error)
FindByChecksum(ctx context.Context, checksum string) ([]*Image, error)
FindByFileID(ctx context.Context, fileID FileID) ([]*Image, error)
FindByFolderID(ctx context.Context, fileID FolderID) ([]*Image, error)
FindByZipFileID(ctx context.Context, zipFileID FileID) ([]*Image, error)
FindByGalleryID(ctx context.Context, galleryID int) ([]*Image, error)
}
ImageFinder provides methods to find images.
type ImageGetter ¶ added in v0.23.0
type ImageGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Image, error)
Find(ctx context.Context, id int) (*Image, error)
}
ImageGetter provides methods to get images by ID.
type ImageIDLoader ¶ added in v0.23.0
type ImageIDLoader interface {
GetImageIDs(ctx context.Context, relatedID int) ([]int, error)
}
type ImagePartial ¶ added in v0.4.0
type ImagePartial struct {
Title OptionalString
Code OptionalString
// Rating expressed in 1-100 scale
Rating OptionalInt
URLs *UpdateStrings
Date OptionalDate
Details OptionalString
Photographer OptionalString
Organized OptionalBool
OCounter OptionalInt
StudioID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
GalleryIDs *UpdateIDs
TagIDs *UpdateIDs
PerformerIDs *UpdateIDs
PrimaryFileID *FileID
}
func NewImagePartial ¶ added in v0.17.0
func NewImagePartial() ImagePartial
type ImageQueryOptions ¶ added in v0.11.0
type ImageQueryOptions struct {
QueryOptions
ImageFilter *ImageFilterType
Megapixels bool
TotalSize bool
}
type ImageQueryResult ¶ added in v0.11.0
type ImageQueryResult struct {
QueryResult
Megapixels float64
TotalSize float64
// contains filtered or unexported fields
}
func NewImageQueryResult ¶ added in v0.11.0
func NewImageQueryResult(getter ImageGetter) *ImageQueryResult
type ImageQueryer ¶ added in v0.23.0
type ImageQueryer interface {
Query(ctx context.Context, options ImageQueryOptions) (*ImageQueryResult, error)
QueryCount(ctx context.Context, imageFilter *ImageFilterType, findFilter *FindFilterType) (int, error)
}
ImageQueryer provides methods to query images.
type ImageReader ¶ added in v0.4.0
type ImageReader interface {
ImageFinder
ImageQueryer
ImageCounter
URLLoader
FileIDLoader
GalleryIDLoader
PerformerIDLoader
TagIDLoader
FileLoader
All(ctx context.Context) ([]*Image, error)
Size(ctx context.Context) (float64, error)
}
ImageReader provides all methods to read images.
type ImageReaderWriter ¶ added in v0.4.0
type ImageReaderWriter interface {
ImageReader
ImageWriter
}
ImageReaderWriter provides all image methods.
type ImageUpdater ¶ added in v0.23.0
type ImageUpdater interface {
Update(ctx context.Context, updatedImage *Image) error
UpdatePartial(ctx context.Context, id int, partial ImagePartial) (*Image, error)
UpdatePerformers(ctx context.Context, imageID int, performerIDs []int) error
UpdateTags(ctx context.Context, imageID int, tagIDs []int) error
}
ImageUpdater provides methods to update images.
type ImageWriter ¶ added in v0.4.0
type ImageWriter interface {
ImageCreator
ImageUpdater
ImageDestroyer
AddFileID(ctx context.Context, id int, fileID FileID) error
IncrementOCounter(ctx context.Context, id int) (int, error)
DecrementOCounter(ctx context.Context, id int) (int, error)
ResetOCounter(ctx context.Context, id int) (int, error)
}
ImageWriter provides all methods to modify images.
type ImagesDestroyInput ¶ added in v0.17.0
type ImagesDestroyInput struct {
Ids []string `json:"ids"`
DeleteFile *bool `json:"delete_file"`
DeleteGenerated *bool `json:"delete_generated"`
}
type ImportMissingRefEnum ¶ added in v0.17.0
type ImportMissingRefEnum string
const (
ImportMissingRefEnumIgnore ImportMissingRefEnum = "IGNORE"
ImportMissingRefEnumFail ImportMissingRefEnum = "FAIL"
ImportMissingRefEnumCreate ImportMissingRefEnum = "CREATE"
)
func (ImportMissingRefEnum) MarshalGQL ¶ added in v0.17.0
func (e ImportMissingRefEnum) MarshalGQL(w io.Writer)
func (*ImportMissingRefEnum) UnmarshalGQL ¶ added in v0.17.0
func (e *ImportMissingRefEnum) UnmarshalGQL(v interface{}) error
type IntCriterionInput ¶ added in v0.17.0
type IntCriterionInput struct {
Value int `json:"value"`
Value2 *int `json:"value2"`
Modifier CriterionModifier `json:"modifier"`
}
func (IntCriterionInput) ValidModifier ¶ added in v0.18.0
func (i IntCriterionInput) ValidModifier() bool
type MarkerStringsResultType ¶ added in v0.17.0
type MarkerStringsResultType struct {
Count int `json:"count"`
ID string `json:"id"`
Title string `json:"title"`
}
type Movie ¶ added in v0.2.0
type Movie struct {
ID int `json:"id"`
Name string `json:"name"`
Aliases string `json:"aliases"`
Duration *int `json:"duration"`
Date *Date `json:"date"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
StudioID *int `json:"studio_id"`
Director string `json:"director"`
Synopsis string `json:"synopsis"`
URL string `json:"url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MovieCounter ¶ added in v0.23.0
type MovieCounter interface {
Count(ctx context.Context) (int, error)
CountByPerformerID(ctx context.Context, performerID int) (int, error)
CountByStudioID(ctx context.Context, studioID int) (int, error)
}
MovieCounter provides methods to count movies.
type MovieCreator ¶ added in v0.23.0
type MovieCreator interface {
Create(ctx context.Context, newMovie *Movie) error
}
MovieCreator provides methods to create movies.
type MovieCreatorUpdater ¶ added in v0.23.0
type MovieCreatorUpdater interface {
MovieCreator
MovieUpdater
}
type MovieDestroyer ¶ added in v0.23.0
type MovieDestroyer interface {
Destroy(ctx context.Context, id int) error
}
MovieDestroyer provides methods to destroy movies.
type MovieFilterType ¶ added in v0.17.0
type MovieFilterType struct {
Name *StringCriterionInput `json:"name"`
Director *StringCriterionInput `json:"director"`
Synopsis *StringCriterionInput `json:"synopsis"`
// Filter by duration (in seconds)
Duration *IntCriterionInput `json:"duration"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// Filter to only include movies with this studio
Studios *HierarchicalMultiCriterionInput `json:"studios"`
// Filter to only include movies missing this property
IsMissing *string `json:"is_missing"`
// Filter by url
URL *StringCriterionInput `json:"url"`
// Filter to only include movies where performer appears in a scene
Performers *MultiCriterionInput `json:"performers"`
// Filter by date
Date *DateCriterionInput `json:"date"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type MovieFinder ¶ added in v0.23.0
type MovieFinder interface {
MovieGetter
FindByPerformerID(ctx context.Context, performerID int) ([]*Movie, error)
FindByStudioID(ctx context.Context, studioID int) ([]*Movie, error)
FindByName(ctx context.Context, name string, nocase bool) (*Movie, error)
FindByNames(ctx context.Context, names []string, nocase bool) ([]*Movie, error)
}
MovieFinder provides methods to find movies.
type MovieFinderCreator ¶ added in v0.23.0
type MovieFinderCreator interface {
MovieFinder
MovieCreator
}
type MovieGetter ¶ added in v0.23.0
type MovieGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Movie, error)
Find(ctx context.Context, id int) (*Movie, error)
}
MovieGetter provides methods to get movies by ID.
type MoviePartial ¶ added in v0.2.0
type MoviePartial struct {
Name OptionalString
Aliases OptionalString
Duration OptionalInt
Date OptionalDate
// Rating expressed in 1-100 scale
Rating OptionalInt
StudioID OptionalInt
Director OptionalString
Synopsis OptionalString
URL OptionalString
CreatedAt OptionalTime
UpdatedAt OptionalTime
}
func NewMoviePartial ¶ added in v0.22.0
func NewMoviePartial() MoviePartial
type MovieQueryer ¶ added in v0.23.0
type MovieQueryer interface {
Query(ctx context.Context, movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int, error)
QueryCount(ctx context.Context, movieFilter *MovieFilterType, findFilter *FindFilterType) (int, error)
}
MovieQueryer provides methods to query movies.
type MovieReader ¶ added in v0.4.0
type MovieReader interface {
MovieFinder
MovieQueryer
MovieCounter
All(ctx context.Context) ([]*Movie, error)
GetFrontImage(ctx context.Context, movieID int) ([]byte, error)
HasFrontImage(ctx context.Context, movieID int) (bool, error)
GetBackImage(ctx context.Context, movieID int) ([]byte, error)
HasBackImage(ctx context.Context, movieID int) (bool, error)
}
MovieReader provides all methods to read movies.
type MovieReaderWriter ¶ added in v0.4.0
type MovieReaderWriter interface {
MovieReader
MovieWriter
}
MovieReaderWriter provides all movie methods.
type MovieUpdater ¶ added in v0.23.0
type MovieUpdater interface {
Update(ctx context.Context, updatedMovie *Movie) error
UpdatePartial(ctx context.Context, id int, updatedMovie MoviePartial) (*Movie, error)
UpdateFrontImage(ctx context.Context, movieID int, frontImage []byte) error
UpdateBackImage(ctx context.Context, movieID int, backImage []byte) error
}
MovieUpdater provides methods to update movies.
type MovieWriter ¶ added in v0.4.0
type MovieWriter interface {
MovieCreator
MovieUpdater
MovieDestroyer
}
MovieWriter provides all methods to modify movies.
type MoviesScenes ¶ added in v0.2.0
type MoviesScenes struct {
MovieID int `json:"movie_id"`
// SceneID int `json:"scene_id"`
SceneIndex *int `json:"scene_index"`
}
func MoviesScenesFromInput ¶ added in v0.18.0
func MoviesScenesFromInput(input []SceneMovieInput) ([]MoviesScenes, error)
func (MoviesScenes) SceneMovieInput ¶ added in v0.17.0
func (s MoviesScenes) SceneMovieInput() SceneMovieInput
type MultiCriterionInput ¶ added in v0.17.0
type MultiCriterionInput struct {
Value []string `json:"value"`
Modifier CriterionModifier `json:"modifier"`
Excludes []string `json:"excludes"`
}
type OptionalBool ¶ added in v0.17.0
type OptionalBool struct {
Value bool
Null bool
Set bool
}
OptionalBool represents an optional int64 argument that may be null. See OptionalString.
func NewOptionalBool ¶ added in v0.17.0
func NewOptionalBool(v bool) OptionalBool
NewOptionalBool returns a new OptionalBool with the given value.
func NewOptionalBoolPtr ¶ added in v0.17.0
func NewOptionalBoolPtr(v *bool) OptionalBool
NewOptionalBoolPtr returns a new OptionalBool with the given value. If the value is nil, the returned OptionalBool will be set and null.
type OptionalDate ¶ added in v0.17.0
type OptionalDate struct {
Value Date
Null bool
Set bool
}
OptionalDate represents an optional date argument that may be null. See OptionalString.
func NewOptionalDate ¶ added in v0.17.0
func NewOptionalDate(v Date) OptionalDate
NewOptionalDate returns a new OptionalDate with the given value.
func NewOptionalDatePtr ¶ added in v0.17.0
func NewOptionalDatePtr(v *Date) OptionalDate
NewOptionalBoolPtr returns a new OptionalDate with the given value. If the value is nil, the returned OptionalDate will be set and null.
type OptionalFloat64 ¶ added in v0.17.0
type OptionalFloat64 struct {
Value float64
Null bool
Set bool
}
OptionalBool represents an optional float64 argument that may be null. See OptionalString.
func NewOptionalFloat64 ¶ added in v0.17.0
func NewOptionalFloat64(v float64) OptionalFloat64
NewOptionalFloat64 returns a new OptionalFloat64 with the given value.
func NewOptionalFloat64Ptr ¶ added in v0.18.0
func NewOptionalFloat64Ptr(v *float64) OptionalFloat64
NewOptionalFloat64 returns a new OptionalFloat64 with the given value.
type OptionalInt ¶ added in v0.17.0
type OptionalInt struct {
Value int
Null bool
Set bool
}
OptionalInt represents an optional int argument that may be null. See OptionalString.
func NewOptionalInt ¶ added in v0.17.0
func NewOptionalInt(v int) OptionalInt
NewOptionalInt returns a new OptionalInt with the given value.
func NewOptionalIntPtr ¶ added in v0.17.0
func NewOptionalIntPtr(v *int) OptionalInt
NewOptionalIntPtr returns a new OptionalInt with the given value. If the value is nil, the returned OptionalInt will be set and null.
func (*OptionalInt) MergePtr ¶ added in v0.18.0
func (o *OptionalInt) MergePtr(destVal *int, srcVal *int)
MergePtr sets the OptionalInt if it is not already set, the destination value is nil and the source value is not nil.
type OptionalInt64 ¶ added in v0.17.0
type OptionalInt64 struct {
Value int64
Null bool
Set bool
}
OptionalInt64 represents an optional int64 argument that may be null. See OptionalString.
func NewOptionalInt64 ¶ added in v0.17.0
func NewOptionalInt64(v int64) OptionalInt64
NewOptionalInt64 returns a new OptionalInt64 with the given value.
func NewOptionalInt64Ptr ¶ added in v0.17.0
func NewOptionalInt64Ptr(v *int64) OptionalInt64
NewOptionalInt64Ptr returns a new OptionalInt64 with the given value. If the value is nil, the returned OptionalInt64 will be set and null.
type OptionalString ¶ added in v0.17.0
type OptionalString struct {
Value string
Null bool
Set bool
}
OptionalString represents an optional string argument that may be null. A value is only considered null if both Set and Null is true.
func NewOptionalString ¶ added in v0.17.0
func NewOptionalString(v string) OptionalString
NewOptionalString returns a new OptionalString with the given value.
func NewOptionalStringPtr ¶ added in v0.17.0
func NewOptionalStringPtr(v *string) OptionalString
NewOptionalStringPtr returns a new OptionalString with the given value. If the value is nil, the returned OptionalString will be set and null.
type OptionalTime ¶ added in v0.17.0
type OptionalTime struct {
Value time.Time
Null bool
Set bool
}
OptionalTime represents an optional time argument that may be null. See OptionalString.
func NewOptionalTime ¶ added in v0.17.0
func NewOptionalTime(v time.Time) OptionalTime
NewOptionalTime returns a new OptionalTime with the given value.
func NewOptionalTimePtr ¶ added in v0.17.0
func NewOptionalTimePtr(v *time.Time) OptionalTime
NewOptionalTimePtr returns a new OptionalTime with the given value. If the value is nil, the returned OptionalTime will be set and null.
type PHashDuplicationCriterionInput ¶ added in v0.17.0
type PHashDuplicationCriterionInput struct {
Duplicated *bool `json:"duplicated"`
// Currently unimplemented
Distance *int `json:"distance"`
}
type PackageSource ¶ added in v0.24.0
type PackageSource struct {
Name *string `json:"name"`
LocalPath string `json:"localPath"`
URL string `json:"url"`
}
type PackageSpecInput ¶ added in v0.24.0
type PackageSpecInput struct {
ID string `json:"id"`
SourceURL string `json:"sourceURL"`
}
type Performer ¶
type Performer struct {
ID int `json:"id"`
Name string `json:"name"`
Disambiguation string `json:"disambiguation"`
Gender *GenderEnum `json:"gender"`
URL string `json:"url"`
Twitter string `json:"twitter"`
Instagram string `json:"instagram"`
Birthdate *Date `json:"birthdate"`
Ethnicity string `json:"ethnicity"`
Country string `json:"country"`
EyeColor string `json:"eye_color"`
Height *int `json:"height"`
Measurements string `json:"measurements"`
FakeTits string `json:"fake_tits"`
PenisLength *float64 `json:"penis_length"`
Circumcised *CircumisedEnum `json:"circumcised"`
CareerLength string `json:"career_length"`
Tattoos string `json:"tattoos"`
Piercings string `json:"piercings"`
Favorite bool `json:"favorite"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Details string `json:"details"`
DeathDate *Date `json:"death_date"`
HairColor string `json:"hair_color"`
Weight *int `json:"weight"`
IgnoreAutoTag bool `json:"ignore_auto_tag"`
Aliases RelatedStrings `json:"aliases"`
TagIDs RelatedIDs `json:"tag_ids"`
StashIDs RelatedStashIDs `json:"stash_ids"`
}
func NewPerformer ¶ added in v0.4.0
func NewPerformer() Performer
func (*Performer) LoadAliases ¶ added in v0.19.0
func (s *Performer) LoadAliases(ctx context.Context, l AliasLoader) error
func (*Performer) LoadRelationships ¶ added in v0.19.0
func (s *Performer) LoadRelationships(ctx context.Context, l PerformerReader) error
func (*Performer) LoadStashIDs ¶ added in v0.19.0
func (s *Performer) LoadStashIDs(ctx context.Context, l StashIDLoader) error
func (*Performer) LoadTagIDs ¶ added in v0.19.0
func (s *Performer) LoadTagIDs(ctx context.Context, l TagIDLoader) error
type PerformerAutoTagQueryer ¶ added in v0.23.0
type PerformerAutoTagQueryer interface {
PerformerQueryer
AliasLoader
// TODO - this interface is temporary until the filter schema can fully
// support the query needed
QueryForAutoTag(ctx context.Context, words []string) ([]*Performer, error)
}
type PerformerCounter ¶ added in v0.23.0
type PerformerCounter interface {
Count(ctx context.Context) (int, error)
CountByTagID(ctx context.Context, tagID int) (int, error)
}
PerformerCounter provides methods to count performers.
type PerformerCreateInput ¶ added in v0.23.0
type PerformerCreateInput struct {
Name string `json:"name"`
Disambiguation *string `json:"disambiguation"`
URL *string `json:"url"`
Gender *GenderEnum `json:"gender"`
Birthdate *string `json:"birthdate"`
Ethnicity *string `json:"ethnicity"`
Country *string `json:"country"`
EyeColor *string `json:"eye_color"`
Height *string `json:"height"`
HeightCm *int `json:"height_cm"`
Measurements *string `json:"measurements"`
FakeTits *string `json:"fake_tits"`
PenisLength *float64 `json:"penis_length"`
Circumcised *CircumisedEnum `json:"circumcised"`
CareerLength *string `json:"career_length"`
Tattoos *string `json:"tattoos"`
Piercings *string `json:"piercings"`
Aliases *string `json:"aliases"`
AliasList []string `json:"alias_list"`
Twitter *string `json:"twitter"`
Instagram *string `json:"instagram"`
Favorite *bool `json:"favorite"`
TagIds []string `json:"tag_ids"`
// This should be a URL or a base64 encoded data URL
Image *string `json:"image"`
StashIds []StashID `json:"stash_ids"`
Rating100 *int `json:"rating100"`
Details *string `json:"details"`
DeathDate *string `json:"death_date"`
HairColor *string `json:"hair_color"`
Weight *int `json:"weight"`
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
}
type PerformerCreator ¶ added in v0.23.0
type PerformerCreator interface {
Create(ctx context.Context, newPerformer *Performer) error
}
PerformerCreator provides methods to create performers.
type PerformerCreatorUpdater ¶ added in v0.23.0
type PerformerCreatorUpdater interface {
PerformerCreator
PerformerUpdater
}
type PerformerDestroyer ¶ added in v0.23.0
type PerformerDestroyer interface {
Destroy(ctx context.Context, id int) error
}
PerformerDestroyer provides methods to destroy performers.
type PerformerFilterType ¶ added in v0.17.0
type PerformerFilterType struct {
And *PerformerFilterType `json:"AND"`
Or *PerformerFilterType `json:"OR"`
Not *PerformerFilterType `json:"NOT"`
Name *StringCriterionInput `json:"name"`
Disambiguation *StringCriterionInput `json:"disambiguation"`
Details *StringCriterionInput `json:"details"`
// Filter by favorite
FilterFavorites *bool `json:"filter_favorites"`
// Filter by birth year
BirthYear *IntCriterionInput `json:"birth_year"`
// Filter by age
Age *IntCriterionInput `json:"age"`
// Filter by ethnicity
Ethnicity *StringCriterionInput `json:"ethnicity"`
// Filter by country
Country *StringCriterionInput `json:"country"`
// Filter by eye color
EyeColor *StringCriterionInput `json:"eye_color"`
// Filter by height - deprecated: use height_cm instead
Height *StringCriterionInput `json:"height"`
// Filter by height in centimeters
HeightCm *IntCriterionInput `json:"height_cm"`
// Filter by measurements
Measurements *StringCriterionInput `json:"measurements"`
// Filter by fake tits value
FakeTits *StringCriterionInput `json:"fake_tits"`
// Filter by penis length value
PenisLength *FloatCriterionInput `json:"penis_length"`
// Filter by circumcision
Circumcised *CircumcisionCriterionInput `json:"circumcised"`
// Filter by career length
CareerLength *StringCriterionInput `json:"career_length"`
// Filter by tattoos
Tattoos *StringCriterionInput `json:"tattoos"`
// Filter by piercings
Piercings *StringCriterionInput `json:"piercings"`
// Filter by aliases
Aliases *StringCriterionInput `json:"aliases"`
// Filter by gender
Gender *GenderCriterionInput `json:"gender"`
// Filter to only include performers missing this property
IsMissing *string `json:"is_missing"`
// Filter to only include performers with these tags
Tags *HierarchicalMultiCriterionInput `json:"tags"`
// Filter by tag count
TagCount *IntCriterionInput `json:"tag_count"`
// 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 O count
OCounter *IntCriterionInput `json:"o_counter"`
// Filter by StashID
StashID *StringCriterionInput `json:"stash_id"`
// Filter by StashID Endpoint
StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// Filter by url
URL *StringCriterionInput `json:"url"`
// Filter by hair color
HairColor *StringCriterionInput `json:"hair_color"`
// Filter by weight
Weight *IntCriterionInput `json:"weight"`
// Filter by death year
DeathYear *IntCriterionInput `json:"death_year"`
// Filter by studios where performer appears in scene/image/gallery
Studios *HierarchicalMultiCriterionInput `json:"studios"`
// Filter by performers where performer appears with another performer in scene/image/gallery
Performers *MultiCriterionInput `json:"performers"`
// Filter by autotag ignore value
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
// Filter by birthdate
Birthdate *DateCriterionInput `json:"birth_date"`
// Filter by death date
DeathDate *DateCriterionInput `json:"death_date"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type PerformerFinder ¶ added in v0.17.0
type PerformerFinder interface {
PerformerGetter
FindBySceneID(ctx context.Context, sceneID int) ([]*Performer, error)
FindByImageID(ctx context.Context, imageID int) ([]*Performer, error)
FindByGalleryID(ctx context.Context, galleryID int) ([]*Performer, error)
FindByStashID(ctx context.Context, stashID StashID) ([]*Performer, error)
FindByStashIDStatus(ctx context.Context, hasStashID bool, stashboxEndpoint string) ([]*Performer, error)
FindByNames(ctx context.Context, names []string, nocase bool) ([]*Performer, error)
}
PerformerFinder provides methods to find performers.
type PerformerFinderCreator ¶ added in v0.23.0
type PerformerFinderCreator interface {
PerformerFinder
PerformerCreator
}
type PerformerGetter ¶ added in v0.23.0
type PerformerGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Performer, error)
Find(ctx context.Context, id int) (*Performer, error)
}
PerformerGetter provides methods to get performers by ID.
type PerformerIDLoader ¶ added in v0.17.0
type PerformerIDLoader interface {
GetPerformerIDs(ctx context.Context, relatedID int) ([]int, error)
}
type PerformerPartial ¶ added in v0.5.0
type PerformerPartial struct {
Name OptionalString
Disambiguation OptionalString
Gender OptionalString
URL OptionalString
Twitter OptionalString
Instagram OptionalString
Birthdate OptionalDate
Ethnicity OptionalString
Country OptionalString
EyeColor OptionalString
Height OptionalInt
Measurements OptionalString
FakeTits OptionalString
PenisLength OptionalFloat64
Circumcised OptionalString
CareerLength OptionalString
Tattoos OptionalString
Piercings OptionalString
Favorite OptionalBool
CreatedAt OptionalTime
UpdatedAt OptionalTime
// Rating expressed in 1-100 scale
Rating OptionalInt
Details OptionalString
DeathDate OptionalDate
HairColor OptionalString
Weight OptionalInt
IgnoreAutoTag OptionalBool
Aliases *UpdateStrings
TagIDs *UpdateIDs
StashIDs *UpdateStashIDs
}
PerformerPartial represents part of a Performer object. It is used to update the database entry.
func NewPerformerPartial ¶ added in v0.18.0
func NewPerformerPartial() PerformerPartial
type PerformerQueryer ¶ added in v0.23.0
type PerformerQueryer interface {
Query(ctx context.Context, performerFilter *PerformerFilterType, findFilter *FindFilterType) ([]*Performer, int, error)
QueryCount(ctx context.Context, performerFilter *PerformerFilterType, findFilter *FindFilterType) (int, error)
}
PerformerQueryer provides methods to query performers.
type PerformerReader ¶ added in v0.4.0
type PerformerReader interface {
PerformerFinder
PerformerQueryer
PerformerAutoTagQueryer
PerformerCounter
AliasLoader
StashIDLoader
TagIDLoader
All(ctx context.Context) ([]*Performer, error)
GetImage(ctx context.Context, performerID int) ([]byte, error)
HasImage(ctx context.Context, performerID int) (bool, error)
}
PerformerReader provides all methods to read performers.
type PerformerReaderWriter ¶ added in v0.4.0
type PerformerReaderWriter interface {
PerformerReader
PerformerWriter
}
PerformerReaderWriter provides all performer methods.
type PerformerUpdateInput ¶ added in v0.23.0
type PerformerUpdateInput struct {
ID string `json:"id"`
Name *string `json:"name"`
Disambiguation *string `json:"disambiguation"`
URL *string `json:"url"`
Gender *GenderEnum `json:"gender"`
Birthdate *string `json:"birthdate"`
Ethnicity *string `json:"ethnicity"`
Country *string `json:"country"`
EyeColor *string `json:"eye_color"`
Height *string `json:"height"`
HeightCm *int `json:"height_cm"`
Measurements *string `json:"measurements"`
FakeTits *string `json:"fake_tits"`
PenisLength *float64 `json:"penis_length"`
Circumcised *CircumisedEnum `json:"circumcised"`
CareerLength *string `json:"career_length"`
Tattoos *string `json:"tattoos"`
Piercings *string `json:"piercings"`
Aliases *string `json:"aliases"`
AliasList []string `json:"alias_list"`
Twitter *string `json:"twitter"`
Instagram *string `json:"instagram"`
Favorite *bool `json:"favorite"`
TagIds []string `json:"tag_ids"`
// This should be a URL or a base64 encoded data URL
Image *string `json:"image"`
StashIds []StashID `json:"stash_ids"`
Rating100 *int `json:"rating100"`
Details *string `json:"details"`
DeathDate *string `json:"death_date"`
HairColor *string `json:"hair_color"`
Weight *int `json:"weight"`
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
}
type PerformerUpdater ¶ added in v0.23.0
type PerformerUpdater interface {
Update(ctx context.Context, updatedPerformer *Performer) error
UpdatePartial(ctx context.Context, id int, updatedPerformer PerformerPartial) (*Performer, error)
UpdateImage(ctx context.Context, performerID int, image []byte) error
}
PerformerUpdater provides methods to update performers.
type PerformerWriter ¶ added in v0.4.0
type PerformerWriter interface {
PerformerCreator
PerformerUpdater
PerformerDestroyer
}
PerformerWriter provides all methods to modify performers.
type PhashDistanceCriterionInput ¶ added in v0.21.0
type PhashDistanceCriterionInput struct {
Value string `json:"value"`
Modifier CriterionModifier `json:"modifier"`
Distance *int `json:"distance"`
}
type PreviewPreset ¶ added in v0.17.0
type PreviewPreset string
const (
// X264_ULTRAFAST
PreviewPresetUltrafast PreviewPreset = "ultrafast"
// X264_VERYFAST
PreviewPresetVeryfast PreviewPreset = "veryfast"
// X264_FAST
PreviewPresetFast PreviewPreset = "fast"
// X264_MEDIUM
PreviewPresetMedium PreviewPreset = "medium"
// X264_SLOW
PreviewPresetSlow PreviewPreset = "slow"
// X264_SLOWER
PreviewPresetSlower PreviewPreset = "slower"
// X264_VERYSLOW
PreviewPresetVeryslow PreviewPreset = "veryslow"
)
func (PreviewPreset) MarshalGQL ¶ added in v0.17.0
func (e PreviewPreset) MarshalGQL(w io.Writer)
func (*PreviewPreset) UnmarshalGQL ¶ added in v0.17.0
func (e *PreviewPreset) UnmarshalGQL(v interface{}) error
type QueryOptions ¶ added in v0.11.0
type QueryOptions struct {
FindFilter *FindFilterType
Count bool
}
type QueryResult ¶ added in v0.11.0
type QueryResult struct {
IDs []int
Count int
}
type RatingSystem ¶ added in v0.18.0
type RatingSystem string
func (RatingSystem) MarshalGQL ¶ added in v0.18.0
func (e RatingSystem) MarshalGQL(w io.Writer)
func (*RatingSystem) UnmarshalGQL ¶ added in v0.18.0
func (e *RatingSystem) UnmarshalGQL(v interface{}) error
type RelatedFiles ¶ added in v0.17.0
type RelatedFiles struct {
// contains filtered or unexported fields
}
func NewRelatedFiles ¶ added in v0.17.0
func NewRelatedFiles(files []File) RelatedFiles
func (RelatedFiles) List ¶ added in v0.17.0
func (r RelatedFiles) List() []File
List returns the related files. Panics if the relationship has not been loaded.
func (RelatedFiles) Loaded ¶ added in v0.17.0
func (r RelatedFiles) Loaded() bool
Loaded returns true if the relationship has been loaded.
func (RelatedFiles) Primary ¶ added in v0.17.0
func (r RelatedFiles) Primary() File
Primary returns the primary file. Panics if the relationship has not been loaded.
func (RelatedFiles) PrimaryLoaded ¶ added in v0.17.0
func (r RelatedFiles) PrimaryLoaded() bool
Loaded returns true if the primary file relationship has been loaded.
type RelatedIDs ¶ added in v0.17.0
type RelatedIDs struct {
// contains filtered or unexported fields
}
RelatedIDs represents a list of related IDs. TODO - this can be made generic
func NewRelatedIDs ¶ added in v0.17.0
func NewRelatedIDs(ids []int) RelatedIDs
NewRelatedIDs returns a loaded RelatedIDs object with the provided IDs. Loaded will return true when called on the returned object if the provided slice is not nil.
func (*RelatedIDs) Add ¶ added in v0.17.0
func (r *RelatedIDs) Add(ids ...int)
Add adds the provided ids to the list. Panics if the relationship has not been loaded.
type RelatedMovies ¶ added in v0.17.0
type RelatedMovies struct {
// contains filtered or unexported fields
}
RelatedMovies represents a list of related Movies.
func NewRelatedMovies ¶ added in v0.17.0
func NewRelatedMovies(list []MoviesScenes) RelatedMovies
NewRelatedMovies returns a loaded RelatedMovies object with the provided movies. Loaded will return true when called on the returned object if the provided slice is not nil.
func (*RelatedMovies) Add ¶ added in v0.17.0
func (r *RelatedMovies) Add(movies ...MoviesScenes)
Add adds the provided ids to the list. Panics if the relationship has not been loaded.
func (*RelatedMovies) ForID ¶ added in v0.18.0
func (r *RelatedMovies) ForID(id int) *MoviesScenes
ForID returns the MoviesScenes object for the given movie ID. Returns nil if not found.
type RelatedStashIDs ¶ added in v0.17.0
type RelatedStashIDs struct {
// contains filtered or unexported fields
}
func NewRelatedStashIDs ¶ added in v0.17.0
func NewRelatedStashIDs(list []StashID) RelatedStashIDs
NewRelatedStashIDs returns a RelatedStashIDs object with the provided ids. Loaded will return true when called on the returned object if the provided slice is not nil.
func (*RelatedStashIDs) ForEndpoint ¶ added in v0.23.0
func (r *RelatedStashIDs) ForEndpoint(endpoint string) *StashID
ForID returns the StashID object for the given endpoint. Returns nil if not found.
type RelatedStrings ¶ added in v0.19.0
type RelatedStrings struct {
// contains filtered or unexported fields
}
RelatedStrings represents a list of related strings. TODO - this can be made generic
func NewRelatedStrings ¶ added in v0.19.0
func NewRelatedStrings(values []string) RelatedStrings
NewRelatedStrings returns a loaded RelatedStrings object with the provided values. Loaded will return true when called on the returned object if the provided slice is not nil.
func (*RelatedStrings) Add ¶ added in v0.19.0
func (r *RelatedStrings) Add(values ...string)
Add adds the provided values to the list. Panics if the relationship has not been loaded.
type RelatedVideoFiles ¶ added in v0.17.0
type RelatedVideoFiles struct {
// contains filtered or unexported fields
}
func NewRelatedVideoFiles ¶ added in v0.17.0
func NewRelatedVideoFiles(files []*VideoFile) RelatedVideoFiles
func (RelatedVideoFiles) List ¶ added in v0.17.0
func (r RelatedVideoFiles) List() []*VideoFile
List returns the related files. Panics if the relationship has not been loaded.
func (RelatedVideoFiles) Loaded ¶ added in v0.17.0
func (r RelatedVideoFiles) Loaded() bool
Loaded returns true if the relationship has been loaded.
func (RelatedVideoFiles) Primary ¶ added in v0.17.0
func (r RelatedVideoFiles) Primary() *VideoFile
Primary returns the primary file. Panics if the relationship has not been loaded.
func (RelatedVideoFiles) PrimaryLoaded ¶ added in v0.17.0
func (r RelatedVideoFiles) PrimaryLoaded() bool
Loaded returns true if the primary file relationship has been loaded.
func (*RelatedVideoFiles) SetPrimary ¶ added in v0.17.0
func (r *RelatedVideoFiles) SetPrimary(f *VideoFile)
type RelationshipUpdateMode ¶ added in v0.17.0
type RelationshipUpdateMode string
const (
RelationshipUpdateModeSet RelationshipUpdateMode = "SET"
RelationshipUpdateModeAdd RelationshipUpdateMode = "ADD"
RelationshipUpdateModeRemove RelationshipUpdateMode = "REMOVE"
)
func (RelationshipUpdateMode) IsValid ¶ added in v0.17.0
func (e RelationshipUpdateMode) IsValid() bool
func (RelationshipUpdateMode) MarshalGQL ¶ added in v0.17.0
func (e RelationshipUpdateMode) MarshalGQL(w io.Writer)
func (RelationshipUpdateMode) String ¶ added in v0.17.0
func (e RelationshipUpdateMode) String() string
func (*RelationshipUpdateMode) UnmarshalGQL ¶ added in v0.17.0
func (e *RelationshipUpdateMode) UnmarshalGQL(v interface{}) error
type Repository ¶ added in v0.5.0
type Repository struct {
TxnManager TxnManager
File FileReaderWriter
Folder FolderReaderWriter
Gallery GalleryReaderWriter
GalleryChapter GalleryChapterReaderWriter
Image ImageReaderWriter
Movie MovieReaderWriter
Performer PerformerReaderWriter
Scene SceneReaderWriter
SceneMarker SceneMarkerReaderWriter
Studio StudioReaderWriter
Tag TagReaderWriter
SavedFilter SavedFilterReaderWriter
}
func (*Repository) WithDB ¶ added in v0.24.0
func (r *Repository) WithDB(ctx context.Context, fn txn.TxnFunc) error
func (*Repository) WithReadTxn ¶ added in v0.24.0
func (r *Repository) WithReadTxn(ctx context.Context, fn txn.TxnFunc) error
type ResolutionCriterionInput ¶ added in v0.17.0
type ResolutionCriterionInput struct {
Value ResolutionEnum `json:"value"`
Modifier CriterionModifier `json:"modifier"`
}
type ResolutionEnum ¶ added in v0.17.0
type ResolutionEnum string
const (
// 144p
ResolutionEnumVeryLow ResolutionEnum = "VERY_LOW"
// 240p
ResolutionEnumLow ResolutionEnum = "LOW"
// 360p
ResolutionEnumR360p ResolutionEnum = "R360P"
// 480p
ResolutionEnumStandard ResolutionEnum = "STANDARD"
// 540p
ResolutionEnumWebHd ResolutionEnum = "WEB_HD"
// 720p
ResolutionEnumStandardHd ResolutionEnum = "STANDARD_HD"
// 1080p
ResolutionEnumFullHd ResolutionEnum = "FULL_HD"
// 1440p
ResolutionEnumQuadHd ResolutionEnum = "QUAD_HD"
// 1920p - deprecated
ResolutionEnumVrHd ResolutionEnum = "VR_HD"
// 4k
ResolutionEnumFourK ResolutionEnum = "FOUR_K"
// 5k
ResolutionEnumFiveK ResolutionEnum = "FIVE_K"
// 6k
ResolutionEnumSixK ResolutionEnum = "SIX_K"
// 7k
ResolutionEnumSevenK ResolutionEnum = "SEVEN_K"
// 8k
ResolutionEnumEightK ResolutionEnum = "EIGHT_K"
// 8K+
ResolutionEnumHuge ResolutionEnum = "HUGE"
)
func (*ResolutionEnum) GetMaxResolution ¶ added in v0.17.0
func (e *ResolutionEnum) GetMaxResolution() int
GetMaxResolution returns the maximum width or height that media must be to qualify as this resolution.
func (*ResolutionEnum) GetMinResolution ¶ added in v0.17.0
func (e *ResolutionEnum) GetMinResolution() int
GetMinResolution returns the minimum width or height that media must be to qualify as this resolution.
func (ResolutionEnum) MarshalGQL ¶ added in v0.17.0
func (e ResolutionEnum) MarshalGQL(w io.Writer)
func (*ResolutionEnum) UnmarshalGQL ¶ added in v0.17.0
func (e *ResolutionEnum) UnmarshalGQL(v interface{}) error
type ResolutionRange ¶ added in v0.9.0
type ResolutionRange struct {
// contains filtered or unexported fields
}
type SavedFilter ¶ added in v0.8.0
type SavedFilter struct {
ID int `db:"id" json:"id"`
Mode FilterMode `db:"mode" json:"mode"`
Name string `db:"name" json:"name"`
FindFilter *FindFilterType `json:"find_filter"`
ObjectFilter map[string]interface{} `json:"object_filter"`
UIOptions map[string]interface{} `json:"ui_options"`
}
type SavedFilterReader ¶ added in v0.8.0
type SavedFilterReader interface {
All(ctx context.Context) ([]*SavedFilter, error)
Find(ctx context.Context, id int) (*SavedFilter, error)
FindMany(ctx context.Context, ids []int, ignoreNotFound bool) ([]*SavedFilter, error)
FindByMode(ctx context.Context, mode FilterMode) ([]*SavedFilter, error)
FindDefault(ctx context.Context, mode FilterMode) (*SavedFilter, error)
}
type SavedFilterReaderWriter ¶ added in v0.8.0
type SavedFilterReaderWriter interface {
SavedFilterReader
SavedFilterWriter
}
type SavedFilterWriter ¶ added in v0.8.0
type SavedFilterWriter interface {
Create(ctx context.Context, obj *SavedFilter) error
Update(ctx context.Context, obj *SavedFilter) error
SetDefault(ctx context.Context, obj *SavedFilter) error
Destroy(ctx context.Context, id int) error
}
type Scene ¶
type Scene struct {
ID int `json:"id"`
Title string `json:"title"`
Code string `json:"code"`
Details string `json:"details"`
Director string `json:"director"`
Date *Date `json:"date"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Organized bool `json:"organized"`
OCounter int `json:"o_counter"`
StudioID *int `json:"studio_id"`
// transient - not persisted
Files RelatedVideoFiles
PrimaryFileID *FileID
// transient - path of primary file - empty if no files
Path string
// transient - oshash of primary file - empty if no files
OSHash string
// transient - checksum of primary file - empty if no files
Checksum string
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastPlayedAt *time.Time `json:"last_played_at"`
ResumeTime float64 `json:"resume_time"`
PlayDuration float64 `json:"play_duration"`
PlayCount int `json:"play_count"`
URLs RelatedStrings `json:"urls"`
GalleryIDs RelatedIDs `json:"gallery_ids"`
TagIDs RelatedIDs `json:"tag_ids"`
PerformerIDs RelatedIDs `json:"performer_ids"`
Movies RelatedMovies `json:"movies"`
StashIDs RelatedStashIDs `json:"stash_ids"`
}
Scene stores the metadata for a single video scene.
func (Scene) DisplayName ¶ added in v0.17.0
func (s Scene) DisplayName() string
DisplayName returns a display name for the scene for logging purposes. It returns Path if not empty, otherwise it returns the ID.
func (Scene) GetHash ¶ added in v0.3.0
func (s Scene) GetHash(hashAlgorithm HashAlgorithm) string
GetHash returns the hash of the scene, based on the hash algorithm provided. If hash algorithm is MD5, then Checksum is returned. Otherwise, OSHash is returned.
func (Scene) GetTitle ¶
func (s Scene) GetTitle() string
GetTitle returns the title of the scene. If the Title field is empty, then the base filename is returned.
func (*Scene) LoadFiles ¶ added in v0.17.0
func (s *Scene) LoadFiles(ctx context.Context, l VideoFileLoader) error
func (*Scene) LoadGalleryIDs ¶ added in v0.17.0
func (s *Scene) LoadGalleryIDs(ctx context.Context, l GalleryIDLoader) error
func (*Scene) LoadMovies ¶ added in v0.17.0
func (s *Scene) LoadMovies(ctx context.Context, l SceneMovieLoader) error
func (*Scene) LoadPerformerIDs ¶ added in v0.17.0
func (s *Scene) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error
func (*Scene) LoadPrimaryFile ¶ added in v0.17.0
func (s *Scene) LoadPrimaryFile(ctx context.Context, l FileGetter) error
func (*Scene) LoadRelationships ¶ added in v0.17.0
func (s *Scene) LoadRelationships(ctx context.Context, l SceneReader) error
func (*Scene) LoadStashIDs ¶ added in v0.17.0
func (s *Scene) LoadStashIDs(ctx context.Context, l StashIDLoader) error
func (*Scene) LoadTagIDs ¶ added in v0.17.0
func (s *Scene) LoadTagIDs(ctx context.Context, l TagIDLoader) error
type SceneCounter ¶ added in v0.23.0
type SceneCounter interface {
Count(ctx context.Context) (int, error)
CountByPerformerID(ctx context.Context, performerID int) (int, error)
CountByMovieID(ctx context.Context, movieID int) (int, error)
CountByFileID(ctx context.Context, fileID FileID) (int, error)
CountByStudioID(ctx context.Context, studioID int) (int, error)
CountByTagID(ctx context.Context, tagID int) (int, error)
CountMissingChecksum(ctx context.Context) (int, error)
CountMissingOSHash(ctx context.Context) (int, error)
OCount(ctx context.Context) (int, error)
OCountByPerformerID(ctx context.Context, performerID int) (int, error)
PlayCount(ctx context.Context) (int, error)
UniqueScenePlayCount(ctx context.Context) (int, error)
}
SceneCounter provides methods to count scenes.
type SceneCreateInput ¶ added in v0.23.0
type SceneCreateInput struct {
Title *string `json:"title"`
Code *string `json:"code"`
Details *string `json:"details"`
Director *string `json:"director"`
URL *string `json:"url"`
Urls []string `json:"urls"`
Date *string `json:"date"`
Rating100 *int `json:"rating100"`
Organized *bool `json:"organized"`
StudioID *string `json:"studio_id"`
GalleryIds []string `json:"gallery_ids"`
PerformerIds []string `json:"performer_ids"`
Movies []SceneMovieInput `json:"movies"`
TagIds []string `json:"tag_ids"`
// This should be a URL or a base64 encoded data URL
CoverImage *string `json:"cover_image"`
StashIds []StashID `json:"stash_ids"`
// The first id will be assigned as primary.
// Files will be reassigned from existing scenes if applicable.
// Files must not already be primary for another scene.
FileIds []string `json:"file_ids"`
}
type SceneCreator ¶ added in v0.23.0
type SceneCreator interface {
Create(ctx context.Context, newScene *Scene, fileIDs []FileID) error
}
SceneCreator provides methods to create scenes.
type SceneCreatorUpdater ¶ added in v0.23.0
type SceneCreatorUpdater interface {
SceneCreator
SceneUpdater
}
type SceneDestroyInput ¶ added in v0.17.0
type SceneDestroyInput struct {
ID string `json:"id"`
DeleteFile *bool `json:"delete_file"`
DeleteGenerated *bool `json:"delete_generated"`
}
type SceneDestroyer ¶ added in v0.23.0
type SceneDestroyer interface {
Destroy(ctx context.Context, id int) error
}
SceneDestroyer provides methods to destroy scenes.
type SceneFileType ¶
type SceneFileType struct {
Size *string `graphql:"size" json:"size"`
Duration *float64 `graphql:"duration" json:"duration"`
VideoCodec *string `graphql:"video_codec" json:"video_codec"`
AudioCodec *string `graphql:"audio_codec" json:"audio_codec"`
Width *int `graphql:"width" json:"width"`
Height *int `graphql:"height" json:"height"`
Framerate *float64 `graphql:"framerate" json:"framerate"`
Bitrate *int `graphql:"bitrate" json:"bitrate"`
}
SceneFileType represents the file metadata for a scene.
type SceneFilterType ¶ added in v0.17.0
type SceneFilterType struct {
And *SceneFilterType `json:"AND"`
Or *SceneFilterType `json:"OR"`
Not *SceneFilterType `json:"NOT"`
ID *IntCriterionInput `json:"id"`
Title *StringCriterionInput `json:"title"`
Code *StringCriterionInput `json:"code"`
Details *StringCriterionInput `json:"details"`
Director *StringCriterionInput `json:"director"`
// Filter by file oshash
Oshash *StringCriterionInput `json:"oshash"`
// Filter by file checksum
Checksum *StringCriterionInput `json:"checksum"`
// Filter by file phash
Phash *StringCriterionInput `json:"phash"`
// Filter by phash distance
PhashDistance *PhashDistanceCriterionInput `json:"phash_distance"`
// Filter by path
Path *StringCriterionInput `json:"path"`
// Filter by file count
FileCount *IntCriterionInput `json:"file_count"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// Filter by organized
Organized *bool `json:"organized"`
// Filter by o-counter
OCounter *IntCriterionInput `json:"o_counter"`
// Filter Scenes that have an exact phash match available
Duplicated *PHashDuplicationCriterionInput `json:"duplicated"`
// Filter by resolution
Resolution *ResolutionCriterionInput `json:"resolution"`
// Filter by framerate
Framerate *IntCriterionInput `json:"framerate"`
// Filter by video codec
VideoCodec *StringCriterionInput `json:"video_codec"`
// Filter by audio codec
AudioCodec *StringCriterionInput `json:"audio_codec"`
// Filter by duration (in seconds)
Duration *IntCriterionInput `json:"duration"`
// Filter to only include scenes which have markers. `true` or `false`
HasMarkers *string `json:"has_markers"`
// Filter to only include scenes missing this property
IsMissing *string `json:"is_missing"`
// Filter to only include scenes with this studio
Studios *HierarchicalMultiCriterionInput `json:"studios"`
// Filter to only include scenes with this movie
Movies *MultiCriterionInput `json:"movies"`
// Filter to only include scenes with these tags
Tags *HierarchicalMultiCriterionInput `json:"tags"`
// Filter by tag count
TagCount *IntCriterionInput `json:"tag_count"`
// Filter to only include scenes with performers with these tags
PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
// Filter scenes that have performers that have been favorited
PerformerFavorite *bool `json:"performer_favorite"`
// Filter scenes by performer age at time of scene
PerformerAge *IntCriterionInput `json:"performer_age"`
// Filter to only include scenes with these performers
Performers *MultiCriterionInput `json:"performers"`
// Filter by performer count
PerformerCount *IntCriterionInput `json:"performer_count"`
// Filter by StashID
StashID *StringCriterionInput `json:"stash_id"`
// Filter by StashID Endpoint
StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
// Filter by url
URL *StringCriterionInput `json:"url"`
// Filter by interactive
Interactive *bool `json:"interactive"`
// Filter by InteractiveSpeed
InteractiveSpeed *IntCriterionInput `json:"interactive_speed"`
// Filter by captions
Captions *StringCriterionInput `json:"captions"`
// Filter by resume time
ResumeTime *IntCriterionInput `json:"resume_time"`
// Filter by play count
PlayCount *IntCriterionInput `json:"play_count"`
// Filter by play duration (in seconds)
PlayDuration *IntCriterionInput `json:"play_duration"`
// Filter by date
Date *DateCriterionInput `json:"date"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type SceneFinder ¶ added in v0.11.0
type SceneFinder interface {
SceneGetter
FindByFingerprints(ctx context.Context, fp []Fingerprint) ([]*Scene, error)
FindByChecksum(ctx context.Context, checksum string) ([]*Scene, error)
FindByOSHash(ctx context.Context, oshash string) ([]*Scene, error)
FindByPath(ctx context.Context, path string) ([]*Scene, error)
FindByFileID(ctx context.Context, fileID FileID) ([]*Scene, error)
FindByPrimaryFileID(ctx context.Context, fileID FileID) ([]*Scene, error)
FindByPerformerID(ctx context.Context, performerID int) ([]*Scene, error)
FindByGalleryID(ctx context.Context, performerID int) ([]*Scene, error)
FindByMovieID(ctx context.Context, movieID int) ([]*Scene, error)
FindDuplicates(ctx context.Context, distance int, durationDiff float64) ([][]*Scene, error)
}
SceneFinder provides methods to find scenes.
type SceneGetter ¶ added in v0.23.0
type SceneGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Scene, error)
Find(ctx context.Context, id int) (*Scene, error)
}
SceneGetter provides methods to get scenes by ID.
type SceneIDLoader ¶ added in v0.17.0
type SceneIDLoader interface {
GetSceneIDs(ctx context.Context, relatedID int) ([]int, error)
}
type SceneMarker ¶
type SceneMarker struct {
ID int `json:"id"`
Title string `json:"title"`
Seconds float64 `json:"seconds"`
PrimaryTagID int `json:"primary_tag_id"`
SceneID int `json:"scene_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func NewSceneMarker ¶ added in v0.23.0
func NewSceneMarker() SceneMarker
type SceneMarkerCounter ¶ added in v0.23.0
type SceneMarkerCounter interface {
Count(ctx context.Context) (int, error)
CountByTagID(ctx context.Context, tagID int) (int, error)
}
SceneMarkerCounter provides methods to count scene markers.
type SceneMarkerCreator ¶ added in v0.23.0
type SceneMarkerCreator interface {
Create(ctx context.Context, newSceneMarker *SceneMarker) error
}
SceneMarkerCreator provides methods to create scene markers.
type SceneMarkerCreatorUpdater ¶ added in v0.23.0
type SceneMarkerCreatorUpdater interface {
SceneMarkerCreator
SceneMarkerUpdater
}
type SceneMarkerDestroyer ¶ added in v0.23.0
type SceneMarkerDestroyer interface {
Destroy(ctx context.Context, id int) error
}
SceneMarkerDestroyer provides methods to destroy scene markers.
type SceneMarkerFilterType ¶ added in v0.17.0
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 SceneMarkerFinder ¶ added in v0.23.0
type SceneMarkerFinder interface {
SceneMarkerGetter
FindBySceneID(ctx context.Context, sceneID int) ([]*SceneMarker, error)
}
SceneMarkerFinder provides methods to find scene markers.
type SceneMarkerGetter ¶ added in v0.23.0
type SceneMarkerGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*SceneMarker, error)
Find(ctx context.Context, id int) (*SceneMarker, error)
}
SceneMarkerGetter provides methods to get scene markers by ID.
type SceneMarkerPartial ¶ added in v0.22.0
type SceneMarkerPartial struct {
Title OptionalString
Seconds OptionalFloat64
PrimaryTagID OptionalInt
SceneID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
}
SceneMarkerPartial represents part of a SceneMarker object. It is used to update the database entry.
func NewSceneMarkerPartial ¶ added in v0.22.0
func NewSceneMarkerPartial() SceneMarkerPartial
type SceneMarkerQueryer ¶ added in v0.23.0
type SceneMarkerQueryer interface {
Query(ctx context.Context, sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) ([]*SceneMarker, int, error)
QueryCount(ctx context.Context, sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) (int, error)
}
SceneMarkerQueryer provides methods to query scene markers.
type SceneMarkerReader ¶ added in v0.4.0
type SceneMarkerReader interface {
SceneMarkerFinder
SceneMarkerQueryer
SceneMarkerCounter
TagIDLoader
All(ctx context.Context) ([]*SceneMarker, error)
Wall(ctx context.Context, q *string) ([]*SceneMarker, error)
GetMarkerStrings(ctx context.Context, q *string, sort *string) ([]*MarkerStringsResultType, error)
}
SceneMarkerReader provides all methods to read scene markers.
type SceneMarkerReaderWriter ¶ added in v0.4.0
type SceneMarkerReaderWriter interface {
SceneMarkerReader
SceneMarkerWriter
}
SceneMarkerReaderWriter provides all scene marker methods.
type SceneMarkerUpdater ¶ added in v0.23.0
type SceneMarkerUpdater interface {
Update(ctx context.Context, updatedSceneMarker *SceneMarker) error
UpdatePartial(ctx context.Context, id int, updatedSceneMarker SceneMarkerPartial) (*SceneMarker, error)
UpdateTags(ctx context.Context, markerID int, tagIDs []int) error
}
SceneMarkerUpdater provides methods to update scene markers.
type SceneMarkerWriter ¶ added in v0.4.0
type SceneMarkerWriter interface {
SceneMarkerCreator
SceneMarkerUpdater
SceneMarkerDestroyer
}
SceneMarkerWriter provides all methods to modify scene markers.
type SceneMovieID ¶ added in v0.22.0
type SceneMovieID struct {
MovieID string `json:"movie_id"`
SceneIndex *string `json:"scene_index"`
}
type SceneMovieInput ¶ added in v0.17.0
type SceneMovieInput struct {
MovieID string `json:"movie_id"`
SceneIndex *int `json:"scene_index"`
}
type SceneMovieLoader ¶ added in v0.17.0
type SceneMovieLoader interface {
GetMovies(ctx context.Context, id int) ([]MoviesScenes, error)
}
type SceneParserInput ¶ added in v0.22.0
type SceneParserInput struct {
IgnoreWords []string `json:"ignoreWords"`
WhitespaceCharacters *string `json:"whitespaceCharacters"`
CapitalizeTitle *bool `json:"capitalizeTitle"`
IgnoreOrganized *bool `json:"ignoreOrganized"`
}
type SceneParserResult ¶ added in v0.22.0
type SceneParserResult struct {
Scene *Scene `json:"scene"`
Title *string `json:"title"`
Code *string `json:"code"`
Details *string `json:"details"`
Director *string `json:"director"`
URL *string `json:"url"`
Date *string `json:"date"`
Rating *int `json:"rating"`
Rating100 *int `json:"rating100"`
StudioID *string `json:"studio_id"`
GalleryIds []string `json:"gallery_ids"`
PerformerIds []string `json:"performer_ids"`
Movies []*SceneMovieID `json:"movies"`
TagIds []string `json:"tag_ids"`
}
type ScenePartial ¶
type ScenePartial struct {
Title OptionalString
Code OptionalString
Details OptionalString
Director OptionalString
Date OptionalDate
// Rating expressed in 1-100 scale
Rating OptionalInt
Organized OptionalBool
OCounter OptionalInt
StudioID OptionalInt
CreatedAt OptionalTime
UpdatedAt OptionalTime
ResumeTime OptionalFloat64
PlayDuration OptionalFloat64
PlayCount OptionalInt
LastPlayedAt OptionalTime
URLs *UpdateStrings
GalleryIDs *UpdateIDs
TagIDs *UpdateIDs
PerformerIDs *UpdateIDs
MovieIDs *UpdateMovieIDs
StashIDs *UpdateStashIDs
PrimaryFileID *FileID
}
ScenePartial represents part of a Scene object. It is used to update the database entry.
func NewScenePartial ¶ added in v0.17.0
func NewScenePartial() ScenePartial
func (ScenePartial) UpdateInput ¶ added in v0.11.0
func (s ScenePartial) UpdateInput(id int) SceneUpdateInput
UpdateInput constructs a SceneUpdateInput using the populated fields in the ScenePartial object.
type SceneQueryOptions ¶ added in v0.11.0
type SceneQueryOptions struct {
QueryOptions
SceneFilter *SceneFilterType
TotalDuration bool
TotalSize bool
}
type SceneQueryResult ¶ added in v0.11.0
type SceneQueryResult struct {
QueryResult
TotalDuration float64
TotalSize float64
// contains filtered or unexported fields
}
func NewSceneQueryResult ¶ added in v0.11.0
func NewSceneQueryResult(getter SceneGetter) *SceneQueryResult
type SceneQueryer ¶ added in v0.23.0
type SceneQueryer interface {
Query(ctx context.Context, options SceneQueryOptions) (*SceneQueryResult, error)
QueryCount(ctx context.Context, sceneFilter *SceneFilterType, findFilter *FindFilterType) (int, error)
}
SceneQueryer provides methods to query scenes.
type SceneReader ¶ added in v0.4.0
type SceneReader interface {
SceneFinder
SceneQueryer
SceneCounter
URLLoader
FileIDLoader
GalleryIDLoader
PerformerIDLoader
TagIDLoader
SceneMovieLoader
StashIDLoader
VideoFileLoader
All(ctx context.Context) ([]*Scene, error)
Wall(ctx context.Context, q *string) ([]*Scene, error)
Size(ctx context.Context) (float64, error)
Duration(ctx context.Context) (float64, error)
PlayDuration(ctx context.Context) (float64, error)
GetCover(ctx context.Context, sceneID int) ([]byte, error)
HasCover(ctx context.Context, sceneID int) (bool, error)
}
SceneReader provides all methods to read scenes.
type SceneReaderWriter ¶ added in v0.4.0
type SceneReaderWriter interface {
SceneReader
SceneWriter
}
SceneReaderWriter provides all scene methods.
type SceneUpdateInput ¶ added in v0.17.0
type SceneUpdateInput struct {
ClientMutationID *string `json:"clientMutationId"`
ID string `json:"id"`
Title *string `json:"title"`
Code *string `json:"code"`
Details *string `json:"details"`
Director *string `json:"director"`
URL *string `json:"url"`
Urls []string `json:"urls"`
Date *string `json:"date"`
Rating100 *int `json:"rating100"`
OCounter *int `json:"o_counter"`
Organized *bool `json:"organized"`
StudioID *string `json:"studio_id"`
GalleryIds []string `json:"gallery_ids"`
PerformerIds []string `json:"performer_ids"`
Movies []SceneMovieInput `json:"movies"`
TagIds []string `json:"tag_ids"`
// This should be a URL or a base64 encoded data URL
CoverImage *string `json:"cover_image"`
StashIds []StashID `json:"stash_ids"`
ResumeTime *float64 `json:"resume_time"`
PlayDuration *float64 `json:"play_duration"`
PlayCount *int `json:"play_count"`
PrimaryFileID *string `json:"primary_file_id"`
}
type SceneUpdater ¶ added in v0.23.0
type SceneUpdater interface {
Update(ctx context.Context, updatedScene *Scene) error
UpdatePartial(ctx context.Context, id int, updatedScene ScenePartial) (*Scene, error)
UpdateCover(ctx context.Context, sceneID int, cover []byte) error
}
SceneUpdater provides methods to update scenes.
type SceneWriter ¶ added in v0.4.0
type SceneWriter interface {
SceneCreator
SceneUpdater
SceneDestroyer
AddFileID(ctx context.Context, id int, fileID FileID) error
AddGalleryIDs(ctx context.Context, sceneID int, galleryIDs []int) error
AssignFiles(ctx context.Context, sceneID int, fileID []FileID) error
IncrementOCounter(ctx context.Context, id int) (int, error)
DecrementOCounter(ctx context.Context, id int) (int, error)
ResetOCounter(ctx context.Context, id int) (int, error)
SaveActivity(ctx context.Context, sceneID int, resumeTime *float64, playDuration *float64) (bool, error)
IncrementWatchCount(ctx context.Context, sceneID int) (int, error)
}
SceneWriter provides all methods to modify scenes.
type ScenesDestroyInput ¶ added in v0.17.0
type ScenesDestroyInput struct {
Ids []string `json:"ids"`
DeleteFile *bool `json:"delete_file"`
DeleteGenerated *bool `json:"delete_generated"`
}
type ScrapedMovie ¶ added in v0.3.0
type ScrapedMovie struct {
StoredID *string `json:"stored_id"`
Name *string `json:"name"`
Aliases *string `json:"aliases"`
Duration *string `json:"duration"`
Date *string `json:"date"`
Rating *string `json:"rating"`
Director *string `json:"director"`
URL *string `json:"url"`
Synopsis *string `json:"synopsis"`
Studio *ScrapedStudio `json:"studio"`
// This should be a base64 encoded data URL
FrontImage *string `json:"front_image"`
// This should be a base64 encoded data URL
BackImage *string `json:"back_image"`
}
A movie from a scraping operation...
func (ScrapedMovie) IsScrapedContent ¶ added in v0.17.0
func (ScrapedMovie) IsScrapedContent()
type ScrapedPerformer ¶
type ScrapedPerformer struct {
// Set if performer matched
StoredID *string `json:"stored_id"`
Name *string `json:"name"`
Disambiguation *string `json:"disambiguation"`
Gender *string `json:"gender"`
URL *string `json:"url"`
Twitter *string `json:"twitter"`
Instagram *string `json:"instagram"`
Birthdate *string `json:"birthdate"`
Ethnicity *string `json:"ethnicity"`
Country *string `json:"country"`
EyeColor *string `json:"eye_color"`
Height *string `json:"height"`
Measurements *string `json:"measurements"`
FakeTits *string `json:"fake_tits"`
PenisLength *string `json:"penis_length"`
Circumcised *string `json:"circumcised"`
CareerLength *string `json:"career_length"`
Tattoos *string `json:"tattoos"`
Piercings *string `json:"piercings"`
Aliases *string `json:"aliases"`
Tags []*ScrapedTag `json:"tags"`
// This should be a base64 encoded data URL
Image *string `json:"image"`
Images []string `json:"images"`
Details *string `json:"details"`
DeathDate *string `json:"death_date"`
HairColor *string `json:"hair_color"`
Weight *string `json:"weight"`
RemoteSiteID *string `json:"remote_site_id"`
}
A performer from a scraping operation...
func (*ScrapedPerformer) GetImage ¶ added in v0.22.1
func (p *ScrapedPerformer) GetImage(ctx context.Context, excluded map[string]bool) ([]byte, error)
func (ScrapedPerformer) IsScrapedContent ¶ added in v0.17.0
func (ScrapedPerformer) IsScrapedContent()
func (*ScrapedPerformer) ToPartial ¶ added in v0.22.1
func (p *ScrapedPerformer) ToPartial(endpoint string, excluded map[string]bool, existingStashIDs []StashID) PerformerPartial
func (*ScrapedPerformer) ToPerformer ¶ added in v0.22.1
func (p *ScrapedPerformer) ToPerformer(endpoint string, excluded map[string]bool) *Performer
type ScrapedStudio ¶ added in v0.17.0
type ScrapedStudio struct {
// Set if studio matched
StoredID *string `json:"stored_id"`
Name string `json:"name"`
URL *string `json:"url"`
Parent *ScrapedStudio `json:"parent"`
Image *string `json:"image"`
Images []string `json:"images"`
RemoteSiteID *string `json:"remote_site_id"`
}
func (*ScrapedStudio) GetImage ¶ added in v0.22.0
func (s *ScrapedStudio) GetImage(ctx context.Context, excluded map[string]bool) ([]byte, error)
func (ScrapedStudio) IsScrapedContent ¶ added in v0.17.0
func (ScrapedStudio) IsScrapedContent()
type ScrapedTag ¶ added in v0.17.0
type ScrapedTag struct {
// Set if tag matched
StoredID *string `json:"stored_id"`
Name string `json:"name"`
}
func (ScrapedTag) IsScrapedContent ¶ added in v0.17.0
func (ScrapedTag) IsScrapedContent()
type SearchSpecs ¶ added in v0.12.0
type SearchSpecs struct {
// MustHave specifies all of the terms that must appear in the results.
MustHave []string
// AnySets specifies sets of terms where one of each set must appear in the results.
AnySets [][]string
// MustNot specifies all terms that must not appear in the results.
MustNot []string
}
SearchSpecs provides the specifications for text-based searches.
func ParseSearchString ¶ added in v0.12.0
func ParseSearchString(s string) SearchSpecs
ParseSearchString parses the Q value and returns a SearchSpecs object.
By default, any words in the search value must appear in the results. Words encompassed by quotes (") as treated as a single term. Where keyword "OR" (case-insensitive) appears (and is not part of a quoted phrase), one of the OR'd terms must appear in the results. Where a keyword is prefixed with "-", that keyword must not appear in the results. Where OR appears as the first or last term, or where one of the OR operands has a not prefix, then the OR is treated literally.
type SortDirectionEnum ¶ added in v0.17.0
type SortDirectionEnum string
const (
SortDirectionEnumAsc SortDirectionEnum = "ASC"
SortDirectionEnumDesc SortDirectionEnum = "DESC"
)
func (SortDirectionEnum) MarshalGQL ¶ added in v0.17.0
func (e SortDirectionEnum) MarshalGQL(w io.Writer)
func (*SortDirectionEnum) UnmarshalGQL ¶ added in v0.17.0
func (e *SortDirectionEnum) UnmarshalGQL(v interface{}) error
type StashBox ¶ added in v0.17.0
type StashBox struct {
Endpoint string `json:"endpoint"`
APIKey string `json:"api_key"`
Name string `json:"name"`
}
type StashBoxFingerprint ¶ added in v0.17.0
type StashBoxFingerprint struct {
Algorithm string `json:"algorithm"`
Hash string `json:"hash"`
Duration int `json:"duration"`
}
type StashID ¶ added in v0.4.0
type StashID struct {
StashID string `db:"stash_id" json:"stash_id"`
Endpoint string `db:"endpoint" json:"endpoint"`
}
type StashIDCriterionInput ¶ added in v0.18.0
type StashIDCriterionInput struct {
// If present, this value is treated as a predicate.
// That is, it will filter based on stash_ids with the matching endpoint
Endpoint *string `json:"endpoint"`
StashID *string `json:"stash_id"`
Modifier CriterionModifier `json:"modifier"`
}
type StashIDLoader ¶ added in v0.17.0
type StashIDLoader interface {
GetStashIDs(ctx context.Context, relatedID int) ([]StashID, error)
}
type StreamingResolutionEnum ¶ added in v0.17.0
type StreamingResolutionEnum string
const (
// 240p
StreamingResolutionEnumLow StreamingResolutionEnum = "LOW"
// 480p
StreamingResolutionEnumStandard StreamingResolutionEnum = "STANDARD"
// 720p
StreamingResolutionEnumStandardHd StreamingResolutionEnum = "STANDARD_HD"
// 1080p
StreamingResolutionEnumFullHd StreamingResolutionEnum = "FULL_HD"
// 4k
StreamingResolutionEnumFourK StreamingResolutionEnum = "FOUR_K"
// Original
StreamingResolutionEnumOriginal StreamingResolutionEnum = "ORIGINAL"
)
func (StreamingResolutionEnum) GetMaxResolution ¶ added in v0.17.0
func (e StreamingResolutionEnum) GetMaxResolution() int
func (StreamingResolutionEnum) IsValid ¶ added in v0.17.0
func (e StreamingResolutionEnum) IsValid() bool
func (StreamingResolutionEnum) MarshalGQL ¶ added in v0.17.0
func (e StreamingResolutionEnum) MarshalGQL(w io.Writer)
func (StreamingResolutionEnum) String ¶ added in v0.17.0
func (e StreamingResolutionEnum) String() string
func (*StreamingResolutionEnum) UnmarshalGQL ¶ added in v0.17.0
func (e *StreamingResolutionEnum) UnmarshalGQL(v interface{}) error
type StringCriterionInput ¶ added in v0.17.0
type StringCriterionInput struct {
Value string `json:"value"`
Modifier CriterionModifier `json:"modifier"`
}
func (StringCriterionInput) ValidModifier ¶ added in v0.18.0
func (i StringCriterionInput) ValidModifier() bool
type Studio ¶
type Studio struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
ParentID *int `json:"parent_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Rating expressed in 1-100 scale
Rating *int `json:"rating"`
Details string `json:"details"`
IgnoreAutoTag bool `json:"ignore_auto_tag"`
Aliases RelatedStrings `json:"aliases"`
StashIDs RelatedStashIDs `json:"stash_ids"`
}
func (*Studio) LoadAliases ¶ added in v0.22.0
func (s *Studio) LoadAliases(ctx context.Context, l AliasLoader) error
func (*Studio) LoadRelationships ¶ added in v0.22.0
func (s *Studio) LoadRelationships(ctx context.Context, l PerformerReader) error
func (*Studio) LoadStashIDs ¶ added in v0.22.0
func (s *Studio) LoadStashIDs(ctx context.Context, l StashIDLoader) error
type StudioAutoTagQueryer ¶ added in v0.23.0
type StudioAutoTagQueryer interface {
StudioQueryer
AliasLoader
// TODO - this interface is temporary until the filter schema can fully
// support the query needed
QueryForAutoTag(ctx context.Context, words []string) ([]*Studio, error)
}
type StudioCounter ¶ added in v0.23.0
type StudioCounter interface {
Count(ctx context.Context) (int, error)
}
StudioCounter provides methods to count studios.
type StudioCreateInput ¶ added in v0.23.0
type StudioCreateInput struct {
Name string `json:"name"`
URL *string `json:"url"`
ParentID *string `json:"parent_id"`
// This should be a URL or a base64 encoded data URL
Image *string `json:"image"`
StashIds []StashID `json:"stash_ids"`
Rating100 *int `json:"rating100"`
Details *string `json:"details"`
Aliases []string `json:"aliases"`
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
}
type StudioCreator ¶ added in v0.23.0
type StudioCreator interface {
Create(ctx context.Context, newStudio *Studio) error
}
StudioCreator provides methods to create studios.
type StudioCreatorUpdater ¶ added in v0.23.0
type StudioCreatorUpdater interface {
StudioCreator
StudioUpdater
}
type StudioDestroyer ¶ added in v0.23.0
type StudioDestroyer interface {
Destroy(ctx context.Context, id int) error
}
StudioDestroyer provides methods to destroy studios.
type StudioFilterType ¶ added in v0.17.0
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 by StashID Endpoint
StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
// Filter to only include studios missing this property
IsMissing *string `json:"is_missing"`
// Filter by rating expressed as 1-100
Rating100 *IntCriterionInput `json:"rating100"`
// 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"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type StudioFinder ¶ added in v0.17.0
type StudioFinder interface {
StudioGetter
FindChildren(ctx context.Context, id int) ([]*Studio, error)
FindBySceneID(ctx context.Context, sceneID int) (*Studio, error)
FindByStashID(ctx context.Context, stashID StashID) ([]*Studio, error)
FindByStashIDStatus(ctx context.Context, hasStashID bool, stashboxEndpoint string) ([]*Studio, error)
FindByName(ctx context.Context, name string, nocase bool) (*Studio, error)
}
StudioFinder provides methods to find studios.
type StudioFinderCreator ¶ added in v0.23.0
type StudioFinderCreator interface {
StudioFinder
StudioCreator
}
type StudioGetter ¶ added in v0.23.0
type StudioGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Studio, error)
Find(ctx context.Context, id int) (*Studio, error)
}
StudioGetter provides methods to get studios by ID.
type StudioPartial ¶ added in v0.3.0
type StudioPartial struct {
ID int
Name OptionalString
URL OptionalString
ParentID OptionalInt
// Rating expressed in 1-100 scale
Rating OptionalInt
Details OptionalString
CreatedAt OptionalTime
UpdatedAt OptionalTime
IgnoreAutoTag OptionalBool
Aliases *UpdateStrings
StashIDs *UpdateStashIDs
}
StudioPartial represents part of a Studio object. It is used to update the database entry.
func NewStudioPartial ¶ added in v0.23.0
func NewStudioPartial() StudioPartial
type StudioQueryer ¶ added in v0.23.0
type StudioQueryer interface {
Query(ctx context.Context, studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int, error)
}
StudioQueryer provides methods to query studios.
type StudioReader ¶ added in v0.4.0
type StudioReader interface {
StudioFinder
StudioQueryer
StudioAutoTagQueryer
StudioCounter
AliasLoader
StashIDLoader
All(ctx context.Context) ([]*Studio, error)
GetImage(ctx context.Context, studioID int) ([]byte, error)
HasImage(ctx context.Context, studioID int) (bool, error)
}
StudioReader provides all methods to read studios.
type StudioReaderWriter ¶ added in v0.4.0
type StudioReaderWriter interface {
StudioReader
StudioWriter
}
StudioReaderWriter provides all studio methods.
type StudioUpdateInput ¶ added in v0.23.0
type StudioUpdateInput struct {
ID string `json:"id"`
Name *string `json:"name"`
URL *string `json:"url"`
ParentID *string `json:"parent_id"`
// This should be a URL or a base64 encoded data URL
Image *string `json:"image"`
StashIds []StashID `json:"stash_ids"`
Rating100 *int `json:"rating100"`
Details *string `json:"details"`
Aliases []string `json:"aliases"`
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
}
type StudioUpdater ¶ added in v0.23.0
type StudioUpdater interface {
Update(ctx context.Context, updatedStudio *Studio) error
UpdatePartial(ctx context.Context, updatedStudio StudioPartial) (*Studio, error)
UpdateImage(ctx context.Context, studioID int, image []byte) error
}
StudioUpdater provides methods to update studios.
type StudioWriter ¶ added in v0.4.0
type StudioWriter interface {
StudioCreator
StudioUpdater
StudioDestroyer
}
StudioWriter provides all methods to modify studios.
type Tag ¶
type Tag struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
IgnoreAutoTag bool `json:"ignore_auto_tag"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type TagAutoTagQueryer ¶ added in v0.23.0
type TagAutoTagQueryer interface {
TagQueryer
AliasLoader
// TODO - this interface is temporary until the filter schema can fully
// support the query needed
QueryForAutoTag(ctx context.Context, words []string) ([]*Tag, error)
}
type TagCounter ¶ added in v0.23.0
type TagCounter interface {
Count(ctx context.Context) (int, error)
CountByParentTagID(ctx context.Context, parentID int) (int, error)
CountByChildTagID(ctx context.Context, childID int) (int, error)
}
TagCounter provides methods to count tags.
type TagCreator ¶ added in v0.23.0
type TagCreator interface {
Create(ctx context.Context, newTag *Tag) error
}
TagCreator provides methods to create tags.
type TagCreatorUpdater ¶ added in v0.23.0
type TagCreatorUpdater interface {
TagCreator
TagUpdater
}
type TagDestroyer ¶ added in v0.23.0
type TagDestroyer interface {
Destroy(ctx context.Context, id int) error
}
TagDestroyer provides methods to destroy tags.
type TagFilterType ¶ added in v0.17.0
type TagFilterType struct {
And *TagFilterType `json:"AND"`
Or *TagFilterType `json:"OR"`
Not *TagFilterType `json:"NOT"`
// Filter by tag name
Name *StringCriterionInput `json:"name"`
// Filter by tag aliases
Aliases *StringCriterionInput `json:"aliases"`
// Filter by tag description
Description *StringCriterionInput `json:"description"`
// Filter to only include tags missing this property
IsMissing *string `json:"is_missing"`
// Filter by number of scenes with this tag
SceneCount *IntCriterionInput `json:"scene_count"`
// Filter by number of images with this tag
ImageCount *IntCriterionInput `json:"image_count"`
// Filter by number of galleries with this tag
GalleryCount *IntCriterionInput `json:"gallery_count"`
// Filter by number of performers with this tag
PerformerCount *IntCriterionInput `json:"performer_count"`
// Filter by number of markers with this tag
MarkerCount *IntCriterionInput `json:"marker_count"`
// Filter by parent tags
Parents *HierarchicalMultiCriterionInput `json:"parents"`
// Filter by child tags
Children *HierarchicalMultiCriterionInput `json:"children"`
// Filter by number of parent tags the tag has
ParentCount *IntCriterionInput `json:"parent_count"`
// Filter by number f child tags the tag has
ChildCount *IntCriterionInput `json:"child_count"`
// Filter by autotag ignore value
IgnoreAutoTag *bool `json:"ignore_auto_tag"`
// Filter by created at
CreatedAt *TimestampCriterionInput `json:"created_at"`
// Filter by updated at
UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}
type TagFinder ¶ added in v0.17.0
type TagFinder interface {
TagGetter
FindAllAncestors(ctx context.Context, tagID int, excludeIDs []int) ([]*TagPath, error)
FindAllDescendants(ctx context.Context, tagID int, excludeIDs []int) ([]*TagPath, error)
FindByParentTagID(ctx context.Context, parentID int) ([]*Tag, error)
FindByChildTagID(ctx context.Context, childID int) ([]*Tag, error)
FindBySceneID(ctx context.Context, sceneID int) ([]*Tag, error)
FindByImageID(ctx context.Context, imageID int) ([]*Tag, error)
FindByGalleryID(ctx context.Context, galleryID int) ([]*Tag, error)
FindByPerformerID(ctx context.Context, performerID int) ([]*Tag, error)
FindBySceneMarkerID(ctx context.Context, sceneMarkerID int) ([]*Tag, error)
FindByName(ctx context.Context, name string, nocase bool) (*Tag, error)
FindByNames(ctx context.Context, names []string, nocase bool) ([]*Tag, error)
}
TagFinder provides methods to find tags.
type TagFinderCreator ¶ added in v0.23.0
type TagFinderCreator interface {
TagFinder
TagCreator
}
type TagGetter ¶ added in v0.23.0
type TagGetter interface {
// TODO - rename this to Find and remove existing method
FindMany(ctx context.Context, ids []int) ([]*Tag, error)
Find(ctx context.Context, id int) (*Tag, error)
}
TagGetter provides methods to get tags by ID.
type TagIDLoader ¶ added in v0.17.0
type TagIDLoader interface {
GetTagIDs(ctx context.Context, relatedID int) ([]int, error)
}
type TagPartial ¶ added in v0.8.0
type TagPartial struct {
Name OptionalString
Description OptionalString
IgnoreAutoTag OptionalBool
CreatedAt OptionalTime
UpdatedAt OptionalTime
}
func NewTagPartial ¶ added in v0.22.0
func NewTagPartial() TagPartial
type TagQueryer ¶ added in v0.23.0
type TagQueryer interface {
Query(ctx context.Context, tagFilter *TagFilterType, findFilter *FindFilterType) ([]*Tag, int, error)
}
TagQueryer provides methods to query tags.
type TagReader ¶ added in v0.4.0
type TagReader interface {
TagFinder
TagQueryer
TagAutoTagQueryer
TagCounter
AliasLoader
All(ctx context.Context) ([]*Tag, error)
GetImage(ctx context.Context, tagID int) ([]byte, error)
HasImage(ctx context.Context, tagID int) (bool, error)
}
TagReader provides all methods to read tags.
type TagReaderWriter ¶ added in v0.4.0
type TagReaderWriter interface {
TagReader
TagWriter
}
TagReaderWriter provides all tags methods.
type TagUpdater ¶ added in v0.23.0
type TagUpdater interface {
Update(ctx context.Context, updatedTag *Tag) error
UpdatePartial(ctx context.Context, id int, updateTag TagPartial) (*Tag, error)
UpdateAliases(ctx context.Context, tagID int, aliases []string) error
UpdateImage(ctx context.Context, tagID int, image []byte) error
UpdateParentTags(ctx context.Context, tagID int, parentIDs []int) error
UpdateChildTags(ctx context.Context, tagID int, parentIDs []int) error
}
TagUpdater provides methods to update tags.
type TagWriter ¶ added in v0.4.0
type TagWriter interface {
TagCreator
TagUpdater
TagDestroyer
Merge(ctx context.Context, source []int, destination int) error
}
TagWriter provides all methods to modify tags.
type TimestampCriterionInput ¶ added in v0.18.0
type TimestampCriterionInput struct {
Value string `json:"value"`
Value2 *string `json:"value2"`
Modifier CriterionModifier `json:"modifier"`
}
type TxnManager ¶ added in v0.17.0
type TxnManager interface {
txn.Manager
txn.DatabaseProvider
}
type URLLoader ¶ added in v0.22.0
type URLLoader interface {
GetURLs(ctx context.Context, relatedID int) ([]string, error)
}
type UpdateIDs ¶ added in v0.17.0
type UpdateIDs struct {
IDs []int `json:"ids"`
Mode RelationshipUpdateMode `json:"mode"`
}
func (*UpdateIDs) Apply ¶ added in v0.24.0
func (u *UpdateIDs) Apply(existing []int) []int
Apply applies the update to a list of existing ids, returning the result.
func (*UpdateIDs) ImpactedIDs ¶ added in v0.21.0
func (u *UpdateIDs) ImpactedIDs(existing []int) []int
GetImpactedIDs returns the IDs that will be impacted by the update. If the update is to add IDs, then the impacted IDs are the IDs being added. If the update is to remove IDs, then the impacted IDs are the IDs being removed. If the update is to set IDs, then the impacted IDs are the IDs being removed and the IDs being added. Any IDs that are already present and are being added are not returned. Likewise, any IDs that are not present that are being removed are not returned.
type UpdateMovieIDs ¶ added in v0.17.0
type UpdateMovieIDs struct {
Movies []MoviesScenes `json:"movies"`
Mode RelationshipUpdateMode `json:"mode"`
}
func (*UpdateMovieIDs) AddUnique ¶ added in v0.18.0
func (u *UpdateMovieIDs) AddUnique(v MoviesScenes)
func (*UpdateMovieIDs) SceneMovieInputs ¶ added in v0.17.0
func (u *UpdateMovieIDs) SceneMovieInputs() []SceneMovieInput
type UpdateStashIDs ¶ added in v0.17.0
type UpdateStashIDs struct {
StashIDs []StashID `json:"stash_ids"`
Mode RelationshipUpdateMode `json:"mode"`
}
type UpdateStrings ¶ added in v0.19.0
type UpdateStrings struct {
Values []string `json:"values"`
Mode RelationshipUpdateMode `json:"mode"`
}
type VideoCaption ¶ added in v0.17.0
type VideoCaption struct {
LanguageCode string `json:"language_code"`
Filename string `json:"filename"`
CaptionType string `json:"caption_type"`
}
type VideoFile ¶ added in v0.23.0
type VideoFile struct {
*BaseFile
Format string `json:"format"`
Width int `json:"width"`
Height int `json:"height"`
Duration float64 `json:"duration"`
VideoCodec string `json:"video_codec"`
AudioCodec string `json:"audio_codec"`
FrameRate float64 `json:"frame_rate"`
BitRate int64 `json:"bitrate"`
Interactive bool `json:"interactive"`
InteractiveSpeed *int `json:"interactive_speed"`
}
VideoFile is an extension of BaseFile to represent video files.
func (VideoFile) DurationFinite ¶ added in v0.23.0
func (f VideoFile) DurationFinite() float64
func (VideoFile) FrameRateFinite ¶ added in v0.23.0
func (f VideoFile) FrameRateFinite() float64
type VideoFileLoader ¶ added in v0.17.0
type VideoFileLoader interface {
GetFiles(ctx context.Context, relatedID int) ([]*VideoFile, error)
}
type VisualFile ¶ added in v0.23.0
type VisualFile interface {
File
GetWidth() int
GetHeight() int
GetFormat() string
}
VisualFile is an interface for files that have a width and height.
Source Files
¶
- date.go
- errors.go
- file.go
- filename_parser.go
- filter.go
- find_filter.go
- fingerprint.go
- fs.go
- gallery.go
- generate.go
- image.go
- import.go
- model_file.go
- model_folder.go
- model_gallery.go
- model_gallery_chapter.go
- model_image.go
- model_joins.go
- model_movie.go
- model_performer.go
- model_saved_filter.go
- model_scene.go
- model_scene_marker.go
- model_scraped_item.go
- model_studio.go
- model_tag.go
- movie.go
- package.go
- performer.go
- query.go
- rating.go
- relationships.go
- repository.go
- repository_file.go
- repository_folder.go
- repository_gallery.go
- repository_gallery_chapter.go
- repository_image.go
- repository_movie.go
- repository_performer.go
- repository_scene.go
- repository_scene_marker.go
- repository_studio.go
- repository_tag.go
- resolution.go
- saved_filter.go
- scene.go
- scene_marker.go
- search.go
- stash_box.go
- stash_ids.go
- studio.go
- tag.go
- update.go
- value.go