models

package
v0.27.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package models provides application models that are used throughout the application.

Index

Constants

View Source
const (
	FiveStar             = "FiveStar"
	FivePointFiveStar    = "FivePointFiveStar"
	FivePointTwoFiveStar = "FivePointTwoFiveStar"
	// TenStar              = "TenStar"
	// TenPointFiveStar     = "TenPointFiveStar"
	// TenPointTwoFiveStar  = "TenPointTwoFiveStar"
	TenPointDecimal = "TenPointDecimal"
)
View Source
const DefaultGthumbWidth int = 640
View Source
const PerPageAll = -1

PerPageAll is the value used for perPage to indicate all results should be returned.

Variables

View Source
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")
)
View Source
var (
	FingerprintTypeOshash = "oshash"
	FingerprintTypeMD5    = "md5"
	FingerprintTypePhash  = "phash"
)

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) Clone added in v0.26.0

func (f *BaseFile) Clone() (ret File)

func (*BaseFile) Info added in v0.23.0

func (f *BaseFile) Info(fs FS) (fs.FileInfo, error)

func (*BaseFile) Open added in v0.23.0

func (f *BaseFile) Open(fs FS) (io.ReadCloser, error)

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 BlobReader added in v0.25.0

type BlobReader interface {
	EntryExists(ctx context.Context, checksum string) (bool, error)
}

BlobReader provides methods to get files by ID.

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) IsValid added in v0.21.0

func (e CircumisedEnum) IsValid() bool

func (CircumisedEnum) MarshalGQL added in v0.21.0

func (e CircumisedEnum) MarshalGQL(w io.Writer)

func (CircumisedEnum) String added in v0.21.0

func (e CircumisedEnum) String() string

func (*CircumisedEnum) UnmarshalGQL added in v0.21.0

func (e *CircumisedEnum) UnmarshalGQL(v interface{}) error

type ContainingGroupLoader added in v0.27.0

type ContainingGroupLoader interface {
	GetContainingGroupDescriptions(ctx context.Context, id int) ([]GroupIDDescription, 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) IsValid added in v0.17.0

func (e CriterionModifier) IsValid() bool

func (CriterionModifier) MarshalGQL added in v0.17.0

func (e CriterionModifier) MarshalGQL(w io.Writer)

func (CriterionModifier) String added in v0.17.0

func (e CriterionModifier) String() string

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"

func ParseDate added in v0.22.0

func ParseDate(s string) (Date, error)

ParseDate uses utils.ParseDateStringAsTime to parse a string into a date.

func (Date) After added in v0.24.0

func (d Date) After(o Date) bool

func (Date) String added in v0.17.0

func (d Date) String() string

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, size int64) (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)
	Clone() File
}

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) String added in v0.23.0

func (i FileID) String() string

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

func (*FileQueryResult) Resolve added in v0.17.0

func (r *FileQueryResult) Resolve(ctx context.Context) ([]File, error)

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"
	FilterModeGroups       FilterMode = "GROUPS"
	FilterModeTags         FilterMode = "TAGS"
	FilterModeImages       FilterMode = "IMAGES"
)

func (FilterMode) IsValid added in v0.17.0

func (e FilterMode) IsValid() bool

func (FilterMode) MarshalGQL added in v0.17.0

func (e FilterMode) MarshalGQL(w io.Writer)

func (FilterMode) String added in v0.17.0

func (e FilterMode) String() string

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) GetPage added in v0.17.0

func (ff FindFilterType) GetPage() int

func (FindFilterType) GetPageSize added in v0.17.0

func (ff FindFilterType) GetPageSize() int

func (FindFilterType) GetSort added in v0.17.0

func (ff FindFilterType) GetSort(defaultSort string) string

func (FindFilterType) IsGetAll added in v0.17.0

func (ff FindFilterType) IsGetAll() bool

type Fingerprint added in v0.23.0

type Fingerprint struct {
	Type        string
	Fingerprint interface{}
}

Fingerprint represents a fingerprint of a file.

func (*Fingerprint) Value added in v0.23.0

func (f *Fingerprint) Value() string

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.

func (Fingerprints) Get added in v0.23.0

func (f Fingerprints) Get(type_ string) interface{}

func (Fingerprints) GetInt64 added in v0.23.0

func (f Fingerprints) GetInt64(type_ string) int64

func (Fingerprints) GetString added in v0.23.0

func (f Fingerprints) GetString(type_ string) string

func (*Fingerprints) Remove added in v0.23.0

func (f *Fingerprints) Remove(type_ string)

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.

func (*Folder) Info added in v0.23.0

func (f *Folder) Info(fs FS) (fs.FileInfo, error)

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 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 GalleryCoverFinder added in v0.27.0

type GalleryCoverFinder interface {
	CoverByGalleryID(ctx context.Context, galleryId int) (*Image, error)
}

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 {
	OperatorFilter[GalleryFilterType]
	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 these scenes
	Scenes *MultiCriterionInput `json:"scenes"`
	// 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 related scenes that meet this criteria
	ScenesFilter *SceneFilterType `json:"scenes_filter"`
	// Filter by related images that meet this criteria
	ImagesFilter *ImageFilterType `json:"images_filter"`
	// Filter by related performers that meet this criteria
	PerformersFilter *PerformerFilterType `json:"performers_filter"`
	// Filter by related studios that meet this criteria
	StudiosFilter *StudioFilterType `json:"studios_filter"`
	// Filter by related tags that meet this criteria
	TagsFilter *TagFilterType `json:"tags_filter"`
	// 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

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
	SetCover(ctx context.Context, galleryID int, coverImageID int) error
	ResetCover(ctx context.Context, galleryID int) error
}

GalleryWriter provides all methods to modify galleries.

type GenderCriterionInput added in v0.17.0

type GenderCriterionInput struct {
	Value     GenderEnum        `json:"value"`
	ValueList []GenderEnum      `json:"value_list"`
	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) IsValid added in v0.17.0

func (e GenderEnum) IsValid() bool

func (GenderEnum) MarshalGQL added in v0.17.0

func (e GenderEnum) MarshalGQL(w io.Writer)

func (GenderEnum) String added in v0.17.0

func (e GenderEnum) String() string

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"`
	ImageThumbnails           bool                    `json:"imageThumbnails"`
	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 Group added in v0.27.0

type Group 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"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	URLs   RelatedStrings `json:"urls"`
	TagIDs RelatedIDs     `json:"tag_ids"`

	ContainingGroups RelatedGroupDescriptions `json:"containing_groups"`
	SubGroups        RelatedGroupDescriptions `json:"sub_groups"`
}

func NewGroup added in v0.27.0

func NewGroup() Group

func (*Group) LoadContainingGroupIDs added in v0.27.0

func (m *Group) LoadContainingGroupIDs(ctx context.Context, l ContainingGroupLoader) error

func (*Group) LoadSubGroupIDs added in v0.27.0

func (m *Group) LoadSubGroupIDs(ctx context.Context, l SubGroupLoader) error

func (*Group) LoadTagIDs added in v0.27.0

func (m *Group) LoadTagIDs(ctx context.Context, l TagIDLoader) error

func (*Group) LoadURLs added in v0.27.0

func (m *Group) LoadURLs(ctx context.Context, l URLLoader) error

type GroupCounter added in v0.27.0

type GroupCounter interface {
	Count(ctx context.Context) (int, error)
	CountByPerformerID(ctx context.Context, performerID int) (int, error)
	CountByStudioID(ctx context.Context, studioID int) (int, error)
}

GroupCounter provides methods to count groups.

type GroupCreator added in v0.27.0

type GroupCreator interface {
	Create(ctx context.Context, newGroup *Group) error
}

GroupCreator provides methods to create groups.

type GroupCreatorUpdater added in v0.27.0

type GroupCreatorUpdater interface {
	GroupCreator
	GroupUpdater
}

type GroupDestroyer added in v0.27.0

type GroupDestroyer interface {
	Destroy(ctx context.Context, id int) error
}

GroupDestroyer provides methods to destroy groups.

type GroupFilterType added in v0.27.0

type GroupFilterType struct {
	OperatorFilter[GroupFilterType]
	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 to only include performers with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter by tag count
	TagCount *IntCriterionInput `json:"tag_count"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by containing groups
	ContainingGroups *HierarchicalMultiCriterionInput `json:"containing_groups"`
	// Filter by sub groups
	SubGroups *HierarchicalMultiCriterionInput `json:"sub_groups"`
	// Filter by number of containing groups the group has
	ContainingGroupCount *IntCriterionInput `json:"containing_group_count"`
	// Filter by number of sub-groups the group has
	SubGroupCount *IntCriterionInput `json:"sub_group_count"`
	// Filter by related scenes that meet this criteria
	ScenesFilter *SceneFilterType `json:"scenes_filter"`
	// Filter by related studios that meet this criteria
	StudiosFilter *StudioFilterType `json:"studios_filter"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type GroupFinder added in v0.27.0

type GroupFinder interface {
	GroupGetter
	FindByPerformerID(ctx context.Context, performerID int) ([]*Group, error)
	FindByStudioID(ctx context.Context, studioID int) ([]*Group, error)
	FindByName(ctx context.Context, name string, nocase bool) (*Group, error)
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*Group, error)
}

GroupFinder provides methods to find groups.

type GroupFinderCreator added in v0.27.0

type GroupFinderCreator interface {
	GroupFinder
	GroupCreator
}

type GroupGetter added in v0.27.0

type GroupGetter interface {
	// TODO - rename this to Find and remove existing method
	FindMany(ctx context.Context, ids []int) ([]*Group, error)
	Find(ctx context.Context, id int) (*Group, error)
}

GroupGetter provides methods to get groups by ID.

type GroupIDDescription added in v0.27.0

type GroupIDDescription struct {
	GroupID     int    `json:"group_id"`
	Description string `json:"description"`
}

type GroupPartial added in v0.27.0

type GroupPartial struct {
	Name     OptionalString
	Aliases  OptionalString
	Duration OptionalInt
	Date     OptionalDate
	// Rating expressed in 1-100 scale
	Rating           OptionalInt
	StudioID         OptionalInt
	Director         OptionalString
	Synopsis         OptionalString
	URLs             *UpdateStrings
	TagIDs           *UpdateIDs
	ContainingGroups *UpdateGroupDescriptions
	SubGroups        *UpdateGroupDescriptions
	CreatedAt        OptionalTime
	UpdatedAt        OptionalTime
}

func NewGroupPartial added in v0.27.0

func NewGroupPartial() GroupPartial

type GroupQueryer added in v0.27.0

type GroupQueryer interface {
	Query(ctx context.Context, groupFilter *GroupFilterType, findFilter *FindFilterType) ([]*Group, int, error)
	QueryCount(ctx context.Context, groupFilter *GroupFilterType, findFilter *FindFilterType) (int, error)
}

GroupQueryer provides methods to query groups.

type GroupReader added in v0.27.0

type GroupReader interface {
	GroupFinder
	GroupQueryer
	GroupCounter
	URLLoader
	TagIDLoader
	ContainingGroupLoader
	SubGroupLoader

	All(ctx context.Context) ([]*Group, error)
	GetFrontImage(ctx context.Context, groupID int) ([]byte, error)
	HasFrontImage(ctx context.Context, groupID int) (bool, error)
	GetBackImage(ctx context.Context, groupID int) ([]byte, error)
	HasBackImage(ctx context.Context, groupID int) (bool, error)
}

GroupReader provides all methods to read groups.

type GroupReaderWriter added in v0.27.0

type GroupReaderWriter interface {
	GroupReader
	GroupWriter
}

GroupReaderWriter provides all group methods.

type GroupUpdater added in v0.27.0

type GroupUpdater interface {
	Update(ctx context.Context, updatedGroup *Group) error
	UpdatePartial(ctx context.Context, id int, updatedGroup GroupPartial) (*Group, error)
	UpdateFrontImage(ctx context.Context, groupID int, frontImage []byte) error
	UpdateBackImage(ctx context.Context, groupID int, backImage []byte) error
}

GroupUpdater provides methods to update groups.

type GroupWriter added in v0.27.0

type GroupWriter interface {
	GroupCreator
	GroupUpdater
	GroupDestroyer
}

GroupWriter provides all methods to modify groups.

type GroupsScenes added in v0.27.0

type GroupsScenes struct {
	GroupID int `json:"movie_id"`
	// SceneID    int  `json:"scene_id"`
	SceneIndex *int `json:"scene_index"`
}

func GroupsScenesFromInput added in v0.27.0

func GroupsScenesFromInput(input []SceneMovieInput) ([]GroupsScenes, error)

func (GroupsScenes) Equal added in v0.27.0

func (s GroupsScenes) Equal(o GroupsScenes) bool

func (GroupsScenes) SceneMovieInput added in v0.27.0

func (s GroupsScenes) SceneMovieInput() SceneMovieInput

type HashAlgorithm added in v0.17.0

type HashAlgorithm string
const (
	HashAlgorithmMd5 HashAlgorithm = "MD5"
	// oshash
	HashAlgorithmOshash HashAlgorithm = "OSHASH"
)

func (HashAlgorithm) IsValid added in v0.17.0

func (e HashAlgorithm) IsValid() bool

func (HashAlgorithm) MarshalGQL added in v0.17.0

func (e HashAlgorithm) MarshalGQL(w io.Writer)

func (HashAlgorithm) String added in v0.17.0

func (e HashAlgorithm) String() string

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

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 NewImage added in v0.23.0

func NewImage() 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

func (*Image) LoadURLs added in v0.23.0

func (i *Image) LoadURLs(ctx context.Context, l URLLoader) 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.

func (ImageFile) Clone added in v0.26.0

func (f ImageFile) Clone() (ret File)

func (ImageFile) GetFormat added in v0.23.0

func (f ImageFile) GetFormat() string

func (ImageFile) GetHeight added in v0.23.0

func (f ImageFile) GetHeight() int

func (ImageFile) GetWidth added in v0.23.0

func (f ImageFile) GetWidth() int

type ImageFilterType added in v0.17.0

type ImageFilterType struct {
	OperatorFilter[ImageFilterType]
	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 by landscape/portrait
	Orientation *OrientationCriterionInput `json:"orientation"`
	// 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 images by performer age at time of image
	PerformerAge *IntCriterionInput `json:"performer_age"`
	// Filter to only include images with these galleries
	Galleries *MultiCriterionInput `json:"galleries"`
	// Filter by related galleries that meet this criteria
	GalleriesFilter *GalleryFilterType `json:"galleries_filter"`
	// Filter by related performers that meet this criteria
	PerformersFilter *PerformerFilterType `json:"performers_filter"`
	// Filter by related studios that meet this criteria
	StudiosFilter *StudioFilterType `json:"studios_filter"`
	// Filter by related tags that meet this criteria
	TagsFilter *TagFilterType `json:"tags_filter"`
	// 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)
	FindByGalleryIDIndex(ctx context.Context, galleryID int, index uint) (*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

func (*ImageQueryResult) Resolve added in v0.11.0

func (r *ImageQueryResult) Resolve(ctx context.Context) ([]*Image, error)

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

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
	RemoveFileID(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) IsValid added in v0.17.0

func (e ImportMissingRefEnum) IsValid() bool

func (ImportMissingRefEnum) MarshalGQL added in v0.17.0

func (e ImportMissingRefEnum) MarshalGQL(w io.Writer)

func (ImportMissingRefEnum) String added in v0.17.0

func (e ImportMissingRefEnum) String() string

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 MultiCriterionInput added in v0.17.0

type MultiCriterionInput struct {
	Value    []string          `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
	Excludes []string          `json:"excludes"`
}

type ODateReader added in v0.25.0

type ODateReader interface {
	GetOCount(ctx context.Context, id int) (int, error)
	GetManyOCount(ctx context.Context, ids []int) ([]int, error)
	GetAllOCount(ctx context.Context) (int, error)
	GetODates(ctx context.Context, relatedID int) ([]time.Time, error)
	GetManyODates(ctx context.Context, ids []int) ([][]time.Time, error)
}

type OHistoryWriter added in v0.25.0

type OHistoryWriter interface {
	AddO(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
	DeleteO(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
	ResetO(ctx context.Context, id int) (int, error)
}

type OperatorFilter added in v0.27.0

type OperatorFilter[T any] struct {
	And *T `json:"AND"`
	Or  *T `json:"OR"`
	Not *T `json:"NOT"`
}

func (*OperatorFilter[T]) SubFilter added in v0.27.0

func (f *OperatorFilter[T]) SubFilter() *T

SubFilter returns the subfilter of the operator filter. Only one of And, Or, or Not should be set, so it returns the first of these that are not nil.

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.

func (*OptionalBool) Merge added in v0.18.0

func (o *OptionalBool) Merge(destVal bool, srcVal bool)

Merge sets the OptionalBool to true if it is not already set, the destination value is false and the source value is true.

func (*OptionalBool) Ptr added in v0.17.0

func (o *OptionalBool) Ptr() *bool

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.

func (*OptionalDate) MergePtr added in v0.18.0

func (o *OptionalDate) MergePtr(destVal *Date, srcVal *Date)

Merge sets the OptionalDate if it is not already set, the destination value is nil and the source value is nil.

func (*OptionalDate) Ptr added in v0.17.0

func (o *OptionalDate) Ptr() *Date

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

type OptionalFloat64 added in v0.17.0

type OptionalFloat64 struct {
	Value float64
	Null  bool
	Set   bool
}

OptionalFloat64 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.

func (*OptionalFloat64) Ptr added in v0.17.0

func (o *OptionalFloat64) Ptr() *float64

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

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.

func (*OptionalInt) Ptr added in v0.17.0

func (o *OptionalInt) Ptr() *int

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

func (*OptionalInt) StringPtr added in v0.17.0

func (o *OptionalInt) StringPtr() *string

StringPtr returns a pointer to a string representation of the value. Returns nil if Set is false or null is true.

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.

func (*OptionalInt64) Ptr added in v0.17.0

func (o *OptionalInt64) Ptr() *int64

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

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.

func (*OptionalString) Merge added in v0.18.0

func (o *OptionalString) Merge(destVal string, srcVal string)

Merge sets the OptionalString if it is not already set, the destination value is empty and the source value is not empty.

func (*OptionalString) Ptr added in v0.17.0

func (o *OptionalString) Ptr() *string

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

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.

func (*OptionalTime) Ptr added in v0.17.0

func (o *OptionalTime) Ptr() *time.Time

Ptr returns a pointer to the underlying value. Returns nil if Set is false or Null is true.

type OrientationCriterionInput added in v0.25.0

type OrientationCriterionInput struct {
	Value []OrientationEnum `json:"value"`
}

type OrientationEnum added in v0.25.0

type OrientationEnum string
const (
	OrientationLandscape OrientationEnum = "LANDSCAPE"
	OrientationPortrait  OrientationEnum = "PORTRAIT"
	OrientationSquare    OrientationEnum = "SQUARE"
)

func (OrientationEnum) IsValid added in v0.25.0

func (e OrientationEnum) IsValid() bool

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"`
	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"`
	URLs     RelatedStrings  `json:"urls"`
	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

func (*Performer) LoadURLs added in v0.27.0

func (s *Performer) LoadURLs(ctx context.Context, l URLLoader) 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"` // deprecated
	Urls           []string        `json:"urls"`
	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"`   // deprecated
	Instagram      *string         `json:"instagram"` // deprecated
	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 {
	OperatorFilter[PerformerFilterType]
	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 play count
	PlayCount *IntCriterionInput `json:"play_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 related scenes that meet this criteria
	ScenesFilter *SceneFilterType `json:"scenes_filter"`
	// Filter by related images that meet this criteria
	ImagesFilter *ImageFilterType `json:"images_filter"`
	// Filter by related galleries that meet this criteria
	GalleriesFilter *GalleryFilterType `json:"galleries_filter"`
	// Filter by related tags that meet this criteria
	TagsFilter *TagFilterType `json:"tags_filter"`
	// 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
	URLs           *UpdateStrings
	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
	URLLoader

	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"` // deprecated
	Urls           []string        `json:"urls"`
	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"`   // deprecated
	Instagram      *string         `json:"instagram"` // deprecated
	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) IsValid added in v0.17.0

func (e PreviewPreset) IsValid() bool

func (PreviewPreset) MarshalGQL added in v0.17.0

func (e PreviewPreset) MarshalGQL(w io.Writer)

func (PreviewPreset) String added in v0.17.0

func (e PreviewPreset) String() string

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) IsValid added in v0.18.0

func (e RatingSystem) IsValid() bool

func (RatingSystem) MarshalGQL added in v0.18.0

func (e RatingSystem) MarshalGQL(w io.Writer)

func (RatingSystem) String added in v0.18.0

func (e RatingSystem) String() string

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 RelatedGroupDescriptions added in v0.27.0

type RelatedGroupDescriptions struct {
	// contains filtered or unexported fields
}

func NewRelatedGroupDescriptions added in v0.27.0

func NewRelatedGroupDescriptions(list []GroupIDDescription) RelatedGroupDescriptions

NewRelatedGroups returns a loaded RelateGroups object with the provided groups. Loaded will return true when called on the returned object if the provided slice is not nil.

func (*RelatedGroupDescriptions) Add added in v0.27.0

func (r *RelatedGroupDescriptions) Add(groups ...GroupIDDescription)

Add adds the provided ids to the list. Panics if the relationship has not been loaded.

func (*RelatedGroupDescriptions) ForID added in v0.27.0

ForID returns the GroupsScenes object for the given group ID. Returns nil if not found.

func (RelatedGroupDescriptions) IDs added in v0.27.0

func (r RelatedGroupDescriptions) IDs() []int

List returns the related Groups. Panics if the relationship has not been loaded.

func (RelatedGroupDescriptions) List added in v0.27.0

List returns the related Groups. Panics if the relationship has not been loaded.

func (RelatedGroupDescriptions) Loaded added in v0.27.0

func (r RelatedGroupDescriptions) Loaded() bool

Loaded returns true if the relationship has been loaded.

type RelatedGroups added in v0.27.0

type RelatedGroups struct {
	// contains filtered or unexported fields
}

RelatedGroups represents a list of related Groups.

func NewRelatedGroups added in v0.27.0

func NewRelatedGroups(list []GroupsScenes) RelatedGroups

NewRelatedGroups returns a loaded RelateGroups object with the provided groups. Loaded will return true when called on the returned object if the provided slice is not nil.

func (*RelatedGroups) Add added in v0.27.0

func (r *RelatedGroups) Add(groups ...GroupsScenes)

Add adds the provided ids to the list. Panics if the relationship has not been loaded.

func (*RelatedGroups) ForID added in v0.27.0

func (r *RelatedGroups) ForID(id int) *GroupsScenes

ForID returns the GroupsScenes object for the given group ID. Returns nil if not found.

func (RelatedGroups) List added in v0.27.0

func (r RelatedGroups) List() []GroupsScenes

List returns the related Groups. Panics if the relationship has not been loaded.

func (RelatedGroups) Loaded added in v0.27.0

func (r RelatedGroups) Loaded() bool

Loaded returns true if the 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.

func (RelatedIDs) List added in v0.17.0

func (r RelatedIDs) List() []int

List returns the related IDs. Panics if the relationship has not been loaded.

func (RelatedIDs) Loaded added in v0.17.0

func (r RelatedIDs) Loaded() bool

Loaded returns true if the related IDs have been loaded.

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.

func (RelatedStashIDs) List added in v0.17.0

func (r RelatedStashIDs) List() []StashID

List returns the related Stash IDs. Panics if the relationship has not been loaded.

func (RelatedStashIDs) Loaded added in v0.17.0

func (r RelatedStashIDs) Loaded() bool

Loaded returns true if the relationship has been loaded.

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.

func (RelatedStrings) List added in v0.19.0

func (r RelatedStrings) List() []string

List returns the related values. Panics if the relationship has not been loaded.

func (RelatedStrings) Loaded added in v0.19.0

func (r RelatedStrings) Loaded() bool

Loaded returns true if the related IDs have 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) Set added in v0.17.0

func (r *RelatedVideoFiles) Set(f []*VideoFile)

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

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

func (*Repository) WithTxn added in v0.17.0

func (r *Repository) WithTxn(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) IsValid added in v0.17.0

func (e ResolutionEnum) IsValid() bool

func (ResolutionEnum) MarshalGQL added in v0.17.0

func (e ResolutionEnum) MarshalGQL(w io.Writer)

func (ResolutionEnum) String added in v0.17.0

func (e ResolutionEnum) String() string

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)
}

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
	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"`
	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"`

	ResumeTime   float64 `json:"resume_time"`
	PlayDuration float64 `json:"play_duration"`

	URLs         RelatedStrings  `json:"urls"`
	GalleryIDs   RelatedIDs      `json:"gallery_ids"`
	TagIDs       RelatedIDs      `json:"tag_ids"`
	PerformerIDs RelatedIDs      `json:"performer_ids"`
	Groups       RelatedGroups   `json:"groups"`
	StashIDs     RelatedStashIDs `json:"stash_ids"`
}

Scene stores the metadata for a single video scene.

func NewScene added in v0.23.0

func NewScene() 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) LoadGroups added in v0.27.0

func (s *Scene) LoadGroups(ctx context.Context, l SceneGroupLoader) 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

func (*Scene) LoadURLs added in v0.22.0

func (s *Scene) LoadURLs(ctx context.Context, l URLLoader) 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)
	CountByFileID(ctx context.Context, fileID FileID) (int, error)
	CountMissingChecksum(ctx context.Context) (int, error)
	CountMissingOSHash(ctx context.Context) (int, error)
	OCountByPerformerID(ctx context.Context, performerID int) (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"`
	Groups       []SceneGroupInput `json:"groups"`
	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 {
	OperatorFilter[SceneFilterType]
	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 orientation
	Orientation *OrientationCriterionInput `json:"orientation"`
	// Filter by framerate
	Framerate *IntCriterionInput `json:"framerate"`
	// Filter by bitrate
	Bitrate *IntCriterionInput `json:"bitrate"`
	// 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 group
	Groups *HierarchicalMultiCriterionInput `json:"groups"`
	// Filter to only include scenes with this movie
	Movies *MultiCriterionInput `json:"movies"`
	// Filter to only include scenes with this gallery
	Galleries *MultiCriterionInput `json:"galleries"`
	// 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 last played at
	LastPlayedAt *TimestampCriterionInput `json:"last_played_at"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by related galleries that meet this criteria
	GalleriesFilter *GalleryFilterType `json:"galleries_filter"`
	// Filter by related performers that meet this criteria
	PerformersFilter *PerformerFilterType `json:"performers_filter"`
	// Filter by related studios that meet this criteria
	StudiosFilter *StudioFilterType `json:"studios_filter"`
	// Filter by related tags that meet this criteria
	TagsFilter *TagFilterType `json:"tags_filter"`
	// Filter by related groups that meet this criteria
	GroupsFilter *GroupFilterType `json:"groups_filter"`
	// Filter by related movies that meet this criteria
	MoviesFilter *GroupFilterType `json:"movies_filter"`
	// Filter by related markers that meet this criteria
	MarkersFilter *SceneMarkerFilterType `json:"markers_filter"`
	// 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)
	FindByGroupID(ctx context.Context, groupID 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 SceneGroupInput added in v0.27.0

type SceneGroupInput struct {
	GroupID    string `json:"group_id"`
	SceneIndex *int   `json:"scene_index"`
}

type SceneGroupLoader added in v0.27.0

type SceneGroupLoader interface {
	GetGroups(ctx context.Context, id int) ([]GroupsScenes, error)
}

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 to only include scene markers from these scenes
	Scenes *MultiCriterionInput `json:"scenes"`
	// 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"`
	// Filter by related scenes that meet this criteria
	SceneFilter *SceneFilterType `json:"scene_filter"`
}

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"`
}

SceneMovieInput is used for groups and movies

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
	StudioID     OptionalInt
	CreatedAt    OptionalTime
	UpdatedAt    OptionalTime
	ResumeTime   OptionalFloat64
	PlayDuration OptionalFloat64

	URLs          *UpdateStrings
	GalleryIDs    *UpdateIDs
	TagIDs        *UpdateIDs
	PerformerIDs  *UpdateIDs
	GroupIDs      *UpdateGroupIDs
	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

func (*SceneQueryResult) Resolve added in v0.11.0

func (r *SceneQueryResult) Resolve(ctx context.Context) ([]*Scene, error)

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

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"`
	Groups           []SceneGroupInput `json:"groups"`
	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

	OHistoryWriter
	ViewHistoryWriter
	SaveActivity(ctx context.Context, sceneID int, resumeTime *float64, playDuration *float64) (bool, error)
	ResetActivity(ctx context.Context, sceneID int, resetResume bool, resetDuration bool) (bool, 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 ScrapedGroup added in v0.27.0

type ScrapedGroup 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"`
	URLs     []string       `json:"urls"`
	Synopsis *string        `json:"synopsis"`
	Studio   *ScrapedStudio `json:"studio"`
	Tags     []*ScrapedTag  `json:"tags"`
	// 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"`
}

ScrapedGroup is a group from a scraping operation

func (ScrapedGroup) IsScrapedContent added in v0.27.0

func (ScrapedGroup) IsScrapedContent()

func (ScrapedGroup) ScrapedMovie added in v0.27.0

func (g ScrapedGroup) ScrapedMovie() ScrapedMovie

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"`
	URLs     []string       `json:"urls"`
	Synopsis *string        `json:"synopsis"`
	Studio   *ScrapedStudio `json:"studio"`
	Tags     []*ScrapedTag  `json:"tags"`
	// 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"`

	// deprecated
	URL *string `json:"url"`
}

A movie from a scraping operation...

func (ScrapedMovie) IsScrapedContent added in v0.17.0

func (ScrapedMovie) IsScrapedContent()

func (ScrapedMovie) ScrapedGroup added in v0.27.0

func (m ScrapedMovie) ScrapedGroup() ScrapedGroup

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"`
	URLs           []string      `json:"urls"`
	URL            *string       `json:"url"`       // deprecated
	Twitter        *string       `json:"twitter"`   // deprecated
	Instagram      *string       `json:"instagram"` // deprecated
	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"` // deprecated: use Images
	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()

func (*ScrapedStudio) ToPartial added in v0.22.0

func (s *ScrapedStudio) ToPartial(id string, endpoint string, excluded map[string]bool, existingStashIDs []StashID) StudioPartial

func (*ScrapedStudio) ToStudio added in v0.22.0

func (s *ScrapedStudio) ToStudio(endpoint string, excluded map[string]bool) *Studio

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) IsValid added in v0.17.0

func (e SortDirectionEnum) IsValid() bool

func (SortDirectionEnum) MarshalGQL added in v0.17.0

func (e SortDirectionEnum) MarshalGQL(w io.Writer)

func (SortDirectionEnum) String added in v0.17.0

func (e SortDirectionEnum) String() string

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"`
	Favorite      bool   `json:"favorite"`
	Details       string `json:"details"`
	IgnoreAutoTag bool   `json:"ignore_auto_tag"`

	Aliases  RelatedStrings  `json:"aliases"`
	TagIDs   RelatedIDs      `json:"tag_ids"`
	StashIDs RelatedStashIDs `json:"stash_ids"`
}

func NewStudio added in v0.4.0

func NewStudio() Studio

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

func (*Studio) LoadTagIDs added in v0.27.0

func (s *Studio) LoadTagIDs(ctx context.Context, l TagIDLoader) 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)
	CountByTagID(ctx context.Context, tagID int) (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"`
	Favorite      *bool     `json:"favorite"`
	Details       *string   `json:"details"`
	Aliases       []string  `json:"aliases"`
	TagIds        []string  `json:"tag_ids"`
	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 {
	OperatorFilter[StudioFilterType]
	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 to only include studios with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter by tag count
	TagCount *IntCriterionInput `json:"tag_count"`
	// Filter by favorite
	Favorite *bool `json:"favorite"`
	// 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 subsidiary studio count
	ChildCount *IntCriterionInput `json:"child_count"`
	// Filter by autotag ignore value
	IgnoreAutoTag *bool `json:"ignore_auto_tag"`
	// Filter by related scenes that meet this criteria
	ScenesFilter *SceneFilterType `json:"scenes_filter"`
	// Filter by related images that meet this criteria
	ImagesFilter *ImageFilterType `json:"images_filter"`
	// Filter by related galleries that meet this criteria
	GalleriesFilter *GalleryFilterType `json:"galleries_filter"`
	// 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
	Favorite      OptionalBool
	Details       OptionalString
	CreatedAt     OptionalTime
	UpdatedAt     OptionalTime
	IgnoreAutoTag OptionalBool

	Aliases  *UpdateStrings
	TagIDs   *UpdateIDs
	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)
	QueryCount(ctx context.Context, studioFilter *StudioFilterType, findFilter *FindFilterType) (int, error)
}

StudioQueryer provides methods to query studios.

type StudioReader added in v0.4.0

type StudioReader interface {
	StudioFinder
	StudioQueryer
	StudioAutoTagQueryer
	StudioCounter

	AliasLoader
	StashIDLoader
	TagIDLoader

	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"`
	Favorite      *bool     `json:"favorite"`
	Details       *string   `json:"details"`
	Aliases       []string  `json:"aliases"`
	TagIds        []string  `json:"tag_ids"`
	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 SubGroupLoader added in v0.27.0

type SubGroupLoader interface {
	GetSubGroupDescriptions(ctx context.Context, id int) ([]GroupIDDescription, error)
}

type Tag

type Tag struct {
	ID            int       `json:"id"`
	Name          string    `json:"name"`
	Favorite      bool      `json:"favorite"`
	Description   string    `json:"description"`
	IgnoreAutoTag bool      `json:"ignore_auto_tag"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`

	Aliases   RelatedStrings `json:"aliases"`
	ParentIDs RelatedIDs     `json:"parent_ids"`
	ChildIDs  RelatedIDs     `json:"tag_ids"`
}

func NewTag added in v0.4.0

func NewTag() Tag

func (*Tag) LoadAliases added in v0.27.0

func (s *Tag) LoadAliases(ctx context.Context, l AliasLoader) error

func (*Tag) LoadChildIDs added in v0.27.0

func (s *Tag) LoadChildIDs(ctx context.Context, l TagRelationLoader) error

func (*Tag) LoadParentIDs added in v0.27.0

func (s *Tag) LoadParentIDs(ctx context.Context, l TagRelationLoader) error

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 {
	OperatorFilter[TagFilterType]
	// Filter by tag name
	Name *StringCriterionInput `json:"name"`
	// Filter by tag aliases
	Aliases *StringCriterionInput `json:"aliases"`
	// Filter by tag favorites
	Favorite *bool `json:"favorite"`
	// 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 studios with this tag
	StudioCount *IntCriterionInput `json:"studio_count"`
	// Filter by number of groups with this tag
	GroupCount *IntCriterionInput `json:"group_count"`
	// Filter by number of movies with this tag
	MovieCount *IntCriterionInput `json:"movie_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 related scenes that meet this criteria
	ScenesFilter *SceneFilterType `json:"scenes_filter"`
	// Filter by related images that meet this criteria
	ImagesFilter *ImageFilterType `json:"images_filter"`
	// Filter by related galleries that meet this criteria
	GalleriesFilter *GalleryFilterType `json:"galleries_filter"`
	// 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)
	FindByGroupID(ctx context.Context, groupID int) ([]*Tag, error)
	FindBySceneMarkerID(ctx context.Context, sceneMarkerID int) ([]*Tag, error)
	FindByStudioID(ctx context.Context, studioID 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
	Favorite      OptionalBool
	IgnoreAutoTag OptionalBool
	CreatedAt     OptionalTime
	UpdatedAt     OptionalTime

	Aliases   *UpdateStrings
	ParentIDs *UpdateIDs
	ChildIDs  *UpdateIDs
}

func NewTagPartial added in v0.22.0

func NewTagPartial() TagPartial

type TagPath added in v0.11.0

type TagPath struct {
	Tag
	Path string `json:"path"`
}

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
	TagRelationLoader

	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 TagRelationLoader added in v0.27.0

type TagRelationLoader interface {
	GetParentIDs(ctx context.Context, relatedID int) ([]int, error)
	GetChildIDs(ctx context.Context, relatedID int) ([]int, error)
}

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 UpdateGroupDescriptions added in v0.27.0

type UpdateGroupDescriptions struct {
	Groups []GroupIDDescription   `json:"groups"`
	Mode   RelationshipUpdateMode `json:"mode"`
}

func (*UpdateGroupDescriptions) Apply added in v0.27.0

Apply applies the update to a list of existing ids, returning the result.

type UpdateGroupIDs added in v0.27.0

type UpdateGroupIDs struct {
	Groups []GroupsScenes         `json:"movies"`
	Mode   RelationshipUpdateMode `json:"mode"`
}

func (*UpdateGroupIDs) AddUnique added in v0.27.0

func (u *UpdateGroupIDs) AddUnique(v GroupsScenes)

func (*UpdateGroupIDs) SceneMovieInputs added in v0.27.0

func (u *UpdateGroupIDs) SceneMovieInputs() []SceneMovieInput

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) IDStrings added in v0.17.0

func (u *UpdateIDs) IDStrings() []string

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 UpdateStashIDs added in v0.17.0

type UpdateStashIDs struct {
	StashIDs []StashID              `json:"stash_ids"`
	Mode     RelationshipUpdateMode `json:"mode"`
}

func (*UpdateStashIDs) AddUnique added in v0.18.0

func (u *UpdateStashIDs) AddUnique(v StashID)

AddUnique adds the stash id to the list, only if the endpoint/stashid pair does not already exist in the list.

func (*UpdateStashIDs) Set added in v0.20.0

func (u *UpdateStashIDs) Set(v StashID)

Set sets or replaces the stash id for the endpoint in the provided value.

type UpdateStrings added in v0.19.0

type UpdateStrings struct {
	Values []string               `json:"values"`
	Mode   RelationshipUpdateMode `json:"mode"`
}

func (*UpdateStrings) Apply added in v0.24.0

func (u *UpdateStrings) Apply(existing []string) []string

Apply applies the update to a list of existing strings, returning the result.

func (*UpdateStrings) Strings added in v0.22.0

func (u *UpdateStrings) Strings() []string

type VideoCaption added in v0.17.0

type VideoCaption struct {
	LanguageCode string `json:"language_code"`
	Filename     string `json:"filename"`
	CaptionType  string `json:"caption_type"`
}

func (VideoCaption) Path added in v0.17.0

func (c VideoCaption) Path(filePath string) string

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) Clone added in v0.26.0

func (f VideoFile) Clone() (ret File)

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

func (VideoFile) GetFormat added in v0.23.0

func (f VideoFile) GetFormat() string

func (VideoFile) GetHeight added in v0.23.0

func (f VideoFile) GetHeight() int

func (VideoFile) GetWidth added in v0.23.0

func (f VideoFile) GetWidth() int

type VideoFileLoader added in v0.17.0

type VideoFileLoader interface {
	GetFiles(ctx context.Context, relatedID int) ([]*VideoFile, error)
}

type ViewDateReader added in v0.25.0

type ViewDateReader interface {
	CountViews(ctx context.Context, id int) (int, error)
	CountAllViews(ctx context.Context) (int, error)
	CountUniqueViews(ctx context.Context) (int, error)
	GetManyViewCount(ctx context.Context, ids []int) ([]int, error)
	GetViewDates(ctx context.Context, relatedID int) ([]time.Time, error)
	GetManyViewDates(ctx context.Context, ids []int) ([][]time.Time, error)
	GetManyLastViewed(ctx context.Context, ids []int) ([]*time.Time, error)
}

type ViewHistoryWriter added in v0.25.0

type ViewHistoryWriter interface {
	AddViews(ctx context.Context, sceneID int, dates []time.Time) ([]time.Time, error)
	DeleteViews(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
	DeleteAllViews(ctx context.Context, id int) (int, 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.

type ZipFS added in v0.23.0

type ZipFS interface {
	FS
	io.Closer
	OpenOnly(name string) (io.ReadCloser, error)
}

ZipFS represents a zip file system.

Directories

Path Synopsis
Package json provides generic JSON types.
Package json provides generic JSON types.
Package jsonschema provides the JSON schema models used for importing and exporting data.
Package jsonschema provides the JSON schema models used for importing and exporting data.
Package mocks provides mocks for various interfaces in models.
Package mocks provides mocks for various interfaces in models.
Package paths provides functions to return paths to various resources.
Package paths provides functions to return paths to various resources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL