models

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

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")
)
View Source
var DefaultMovieImage = "" /* 562-byte string literal not displayed */
View Source
var DefaultStudioImage = "" /* 562-byte string literal not displayed */
View Source
var DefaultTagImage = []byte(`<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="200"
   height="200"
   id="svg2"
   version="1.1"
   inkscape:version="0.48.4 r9939"
   sodipodi:docname="tag.svg">
  <defs
     id="defs4" />
  <sodipodi:namedview
     id="base"
     pagecolor="#000000"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="1"
     inkscape:pageshadow="2"
     inkscape:zoom="1"
     inkscape:cx="181.77771"
     inkscape:cy="279.72376"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     inkscape:window-width="1920"
     inkscape:window-height="1017"
     inkscape:window-x="-8"
     inkscape:window-y="-8"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(-157.84358,-524.69522)">
    <path
       id="path2987"
       d="m 229.94314,669.26549 -36.08466,-36.08466 c -4.68653,-4.68653 -4.68653,-12.28468 0,-16.97121 l 36.08466,-36.08467 a 12.000453,12.000453 0 0 1 8.4856,-3.5148 l 74.91443,0 c 6.62761,0 12.00041,5.3728 12.00041,12.00041 l 0,72.16933 c 0,6.62761 -5.3728,12.00041 -12.00041,12.00041 l -74.91443,0 a 12.000453,12.000453 0 0 1 -8.4856,-3.51481 z m -13.45639,-53.05587 c -4.68653,4.68653 -4.68653,12.28468 0,16.97121 4.68652,4.68652 12.28467,4.68652 16.9712,0 4.68653,-4.68653 4.68653,-12.28468 0,-16.97121 -4.68653,-4.68652 -12.28468,-4.68652 -16.9712,0 z"
       inkscape:connector-curvature="0"
       style="fill:#ffffff;fill-opacity:1" />
  </g>
</svg>`)

Original Tag image from: https://fontawesome.com/icons/tag?style=solid Modified to change color and rotate Licensed under CC Attribution 4.0: https://fontawesome.com/license

View Source
var ErrInt64 = errors.New("cannot parse Int64")
View Source
var ErrScraperSource = errors.New("invalid ScraperSource")
View Source
var ErrTimestamp = errors.New("cannot parse Timestamp")

Functions

func MarshalInt64 added in v0.17.0

func MarshalInt64(v int64) graphql.Marshaler

func MarshalTimestamp added in v0.12.0

func MarshalTimestamp(t time.Time) graphql.Marshaler

func NullInt64 added in v0.5.0

func NullInt64(v int64) sql.NullInt64

func NullString added in v0.5.0

func NullString(v string) sql.NullString

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

func UnmarshalInt64 added in v0.17.0

func UnmarshalInt64(v interface{}) (int64, error)

func UnmarshalTimestamp added in v0.12.0

func UnmarshalTimestamp(v interface{}) (time.Time, error)

Types

type AliasLoader added in v0.19.0

type AliasLoader interface {
	GetAliases(ctx context.Context, relatedID int) ([]string, 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 NewDate added in v0.17.0

func NewDate(s string) Date

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

type FileLoader interface {
	GetFiles(ctx context.Context, relatedID int) ([]file.File, error)
}

type FileQueryOptions added in v0.17.0

type FileQueryOptions struct {
	QueryOptions
	FileFilter *FileFilterType
}

type FileQueryResult added in v0.17.0

type FileQueryResult struct {
	IDs   []file.ID
	Count int
	// contains filtered or unexported fields
}

func NewFileQueryResult added in v0.17.0

func NewFileQueryResult(finder file.Finder) *FileQueryResult

func (*FileQueryResult) Resolve added in v0.17.0

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

type FilterMode added in v0.17.0

type FilterMode string
const (
	FilterModeScenes       FilterMode = "SCENES"
	FilterModePerformers   FilterMode = "PERFORMERS"
	FilterModeStudios      FilterMode = "STUDIOS"
	FilterModeGalleries    FilterMode = "GALLERIES"
	FilterModeSceneMarkers FilterMode = "SCENE_MARKERS"
	FilterModeMovies       FilterMode = "MOVIES"
	FilterModeTags         FilterMode = "TAGS"
	FilterModeImages       FilterMode = "IMAGES"
)

func (FilterMode) 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 Galleries added in v0.5.0

type Galleries []*Gallery

func (*Galleries) Append added in v0.5.0

func (g *Galleries) Append(o interface{})

func (*Galleries) New added in v0.5.0

func (g *Galleries) New() interface{}
type Gallery struct {
	ID int `json:"id"`

	Title   string `json:"title"`
	URL     string `json:"url"`
	Date    *Date  `json:"date"`
	Details string `json:"details"`
	// 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 *file.ID
	// transient - path of primary file or folder
	Path string

	FolderID *file.FolderID `json:"folder_id"`

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	SceneIDs     RelatedIDs `json:"scene_ids"`
	TagIDs       RelatedIDs `json:"tag_ids"`
	PerformerIDs RelatedIDs `json:"performer_ids"`
}

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 file.Finder) 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) PrimaryChecksum added in v0.17.0

func (g Gallery) PrimaryChecksum() string

type GalleryChapter added in v0.20.0

type GalleryChapter struct {
	ID         int             `db:"id" json:"id"`
	Title      string          `db:"title" json:"title"`
	ImageIndex int             `db:"image_index" json:"image_index"`
	GalleryID  sql.NullInt64   `db:"gallery_id,omitempty" json:"gallery_id"`
	CreatedAt  SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt  SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

type GalleryChapterReader added in v0.20.0

type GalleryChapterReader interface {
	Find(ctx context.Context, id int) (*GalleryChapter, error)
	FindMany(ctx context.Context, ids []int) ([]*GalleryChapter, error)
	FindByGalleryID(ctx context.Context, galleryID int) ([]*GalleryChapter, error)
}

type GalleryChapterReaderWriter added in v0.20.0

type GalleryChapterReaderWriter interface {
	GalleryChapterReader
	GalleryChapterWriter
}

type GalleryChapterWriter added in v0.20.0

type GalleryChapterWriter interface {
	Create(ctx context.Context, newGalleryChapter GalleryChapter) (*GalleryChapter, error)
	Update(ctx context.Context, updatedGalleryChapter GalleryChapter) (*GalleryChapter, error)
	Destroy(ctx context.Context, id int) error
}

type GalleryChapters added in v0.20.0

type GalleryChapters []*GalleryChapter

func (*GalleryChapters) Append added in v0.20.0

func (m *GalleryChapters) Append(o interface{})

func (*GalleryChapters) New added in v0.20.0

func (m *GalleryChapters) New() interface{}

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

type GalleryFilterType struct {
	And     *GalleryFilterType    `json:"AND"`
	Or      *GalleryFilterType    `json:"OR"`
	Not     *GalleryFilterType    `json:"NOT"`
	ID      *IntCriterionInput    `json:"id"`
	Title   *StringCriterionInput `json:"title"`
	Details *StringCriterionInput `json:"details"`
	// 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-5
	Rating *IntCriterionInput `json:"rating"`
	// Filter by rating expressed as 1-100
	Rating100 *IntCriterionInput `json:"rating100"`
	// Filter by organized
	Organized *bool `json:"organized"`
	// Filter by average image resolution
	AverageResolution *ResolutionCriterionInput `json:"average_resolution"`
	// Filter to only include scenes which have chapters. `true` or `false`
	HasChapters *string `json:"has_chapters"`
	// Filter to only include galleries with this studio
	Studios *HierarchicalMultiCriterionInput `json:"studios"`
	// Filter to only include galleries with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter by tag count
	TagCount *IntCriterionInput `json:"tag_count"`
	// Filter to only include galleries with performers with these tags
	PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
	// Filter to only include galleries with these performers
	Performers *MultiCriterionInput `json:"performers"`
	// Filter by performer count
	PerformerCount *IntCriterionInput `json:"performer_count"`
	// Filter galleries that have performers that have been favorited
	PerformerFavorite *bool `json:"performer_favorite"`
	// Filter galleries by performer age at time of gallery
	PerformerAge *IntCriterionInput `json:"performer_age"`
	// Filter by number of images in this gallery
	ImageCount *IntCriterionInput `json:"image_count"`
	// Filter by url
	URL *StringCriterionInput `json:"url"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type GalleryFinder added in v0.17.0

type GalleryFinder interface {
	FindMany(ctx context.Context, ids []int) ([]*Gallery, error)
}

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
	URL     OptionalString
	Date    OptionalDate
	Details 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 *file.ID
}

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 GalleryReader added in v0.4.0

type GalleryReader interface {
	Find(ctx context.Context, id int) (*Gallery, error)
	GalleryFinder
	FindByChecksum(ctx context.Context, checksum string) ([]*Gallery, error)
	FindByChecksums(ctx context.Context, checksums []string) ([]*Gallery, error)
	FindByPath(ctx context.Context, path string) ([]*Gallery, error)
	FindBySceneID(ctx context.Context, sceneID int) ([]*Gallery, error)
	FindByImageID(ctx context.Context, imageID int) ([]*Gallery, error)

	SceneIDLoader
	PerformerIDLoader
	TagIDLoader

	Count(ctx context.Context) (int, error)
	All(ctx context.Context) ([]*Gallery, error)
	Query(ctx context.Context, galleryFilter *GalleryFilterType, findFilter *FindFilterType) ([]*Gallery, int, error)
	QueryCount(ctx context.Context, galleryFilter *GalleryFilterType, findFilter *FindFilterType) (int, error)
	GetImageIDs(ctx context.Context, galleryID int) ([]int, error)
}

type GalleryReaderWriter added in v0.4.0

type GalleryReaderWriter interface {
	GalleryReader
	GalleryWriter
}

type GalleryUpdateInput added in v0.17.0

type GalleryUpdateInput struct {
	ClientMutationID *string  `json:"clientMutationId"`
	ID               string   `json:"id"`
	Title            *string  `json:"title"`
	URL              *string  `json:"url"`
	Date             *string  `json:"date"`
	Details          *string  `json:"details"`
	Rating           *int     `json:"rating"`
	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"`
}

type GalleryWriter added in v0.4.0

type GalleryWriter interface {
	Create(ctx context.Context, newGallery *Gallery, fileIDs []file.ID) error
	Update(ctx context.Context, updatedGallery *Gallery) error
	UpdatePartial(ctx context.Context, id int, updatedGallery GalleryPartial) (*Gallery, error)
	Destroy(ctx context.Context, id int) error
	UpdateImages(ctx context.Context, galleryID int, imageIDs []int) error
}

type GenderCriterionInput added in v0.17.0

type GenderCriterionInput struct {
	Value    *GenderEnum       `json:"value"`
	Modifier CriterionModifier `json:"modifier"`
}

type GenderEnum added in v0.17.0

type GenderEnum string
const (
	GenderEnumMale              GenderEnum = "MALE"
	GenderEnumFemale            GenderEnum = "FEMALE"
	GenderEnumTransgenderMale   GenderEnum = "TRANSGENDER_MALE"
	GenderEnumTransgenderFemale GenderEnum = "TRANSGENDER_FEMALE"
	GenderEnumIntersex          GenderEnum = "INTERSEX"
	GenderEnumNonBinary         GenderEnum = "NON_BINARY"
)

func (GenderEnum) 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"`
}

type GeneratePreviewOptions added in v0.17.0

type GeneratePreviewOptions struct {
	// Number of segments in a preview file
	PreviewSegments *int `json:"previewSegments"`
	// Preview segment duration, in seconds
	PreviewSegmentDuration *float64 `json:"previewSegmentDuration"`
	// Duration of start of video to exclude when generating previews
	PreviewExcludeStart *string `json:"previewExcludeStart"`
	// Duration of end of video to exclude when generating previews
	PreviewExcludeEnd *string `json:"previewExcludeEnd"`
	// Preset when generating preview
	PreviewPreset *PreviewPreset `json:"previewPreset"`
}

type HashAlgorithm added in v0.17.0

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

func (HashAlgorithm) 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"`
}

type Image added in v0.4.0

type Image struct {
	ID int `json:"id"`

	Title string `json:"title"`
	// Rating expressed in 1-100 scale
	Rating    *int   `json:"rating"`
	Organized bool   `json:"organized"`
	OCounter  int    `json:"o_counter"`
	StudioID  *int   `json:"studio_id"`
	URL       string `json:"url"`
	Date      *Date  `json:"date"`

	// transient - not persisted
	Files         RelatedImageFiles
	PrimaryFileID *file.ID
	// transient - path of primary file - empty if no files
	Path string
	// transient - checksum of primary file - empty if no files
	Checksum string

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	GalleryIDs   RelatedIDs `json:"gallery_ids"`
	TagIDs       RelatedIDs `json:"tag_ids"`
	PerformerIDs RelatedIDs `json:"performer_ids"`
}

Image stores the metadata for a single image.

func (Image) DisplayName added in v0.17.0

func (i Image) DisplayName() string

DisplayName returns a display name for the scene for logging purposes. It returns Path if not empty, otherwise it returns the ID.

func (Image) GetTitle added in v0.7.0

func (i Image) GetTitle() string

GetTitle returns the title of the image. If the Title field is empty, then the base filename is returned.

func (*Image) LoadFiles added in v0.17.0

func (i *Image) LoadFiles(ctx context.Context, l ImageFileLoader) 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 file.Finder) error

func (*Image) LoadTagIDs added in v0.17.0

func (i *Image) LoadTagIDs(ctx context.Context, l TagIDLoader) error

type ImageCreateInput added in v0.17.0

type ImageCreateInput struct {
	*Image
	FileIDs []file.ID
}

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

type ImageFileLoader interface {
	GetFiles(ctx context.Context, relatedID int) ([]*file.ImageFile, error)
}

type ImageFilterType added in v0.17.0

type ImageFilterType struct {
	And   *ImageFilterType      `json:"AND"`
	Or    *ImageFilterType      `json:"OR"`
	Not   *ImageFilterType      `json:"NOT"`
	ID    *IntCriterionInput    `json:"id"`
	Title *StringCriterionInput `json:"title"`
	// 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-5
	Rating *IntCriterionInput `json:"rating"`
	// Filter by rating expressed as 1-100
	Rating100 *IntCriterionInput `json:"rating100"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by url
	URL *StringCriterionInput `json:"url"`
	// Filter by organized
	Organized *bool `json:"organized"`
	// Filter by o-counter
	OCounter *IntCriterionInput `json:"o_counter"`
	// Filter by resolution
	Resolution *ResolutionCriterionInput `json:"resolution"`
	// Filter to only include images missing this property
	IsMissing *string `json:"is_missing"`
	// Filter to only include images with this studio
	Studios *HierarchicalMultiCriterionInput `json:"studios"`
	// Filter to only include images with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter by tag count
	TagCount *IntCriterionInput `json:"tag_count"`
	// Filter to only include images with performers with these tags
	PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
	// Filter to only include images with these performers
	Performers *MultiCriterionInput `json:"performers"`
	// Filter by performer count
	PerformerCount *IntCriterionInput `json:"performer_count"`
	// Filter images that have performers that have been favorited
	PerformerFavorite *bool `json:"performer_favorite"`
	// Filter to only include images with these galleries
	Galleries *MultiCriterionInput `json:"galleries"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type ImageFinder added in v0.11.0

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

type ImagePartial added in v0.4.0

type ImagePartial struct {
	Title OptionalString
	// Rating expressed in 1-100 scale
	Rating    OptionalInt
	URL       OptionalString
	Date      OptionalDate
	Organized OptionalBool
	OCounter  OptionalInt
	StudioID  OptionalInt
	CreatedAt OptionalTime
	UpdatedAt OptionalTime

	GalleryIDs    *UpdateIDs
	TagIDs        *UpdateIDs
	PerformerIDs  *UpdateIDs
	PrimaryFileID *file.ID
}

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(finder ImageFinder) *ImageQueryResult

func (*ImageQueryResult) Resolve added in v0.11.0

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

type ImageReader added in v0.4.0

type ImageReader interface {
	ImageFinder
	// TODO - remove this in another PR
	Find(ctx context.Context, id int) (*Image, error)
	FindByChecksum(ctx context.Context, checksum string) ([]*Image, error)
	FindByGalleryID(ctx context.Context, galleryID int) ([]*Image, error)
	CountByGalleryID(ctx context.Context, galleryID int) (int, error)
	Count(ctx context.Context) (int, error)
	Size(ctx context.Context) (float64, error)
	All(ctx context.Context) ([]*Image, error)
	Query(ctx context.Context, options ImageQueryOptions) (*ImageQueryResult, error)
	QueryCount(ctx context.Context, imageFilter *ImageFilterType, findFilter *FindFilterType) (int, error)

	GalleryIDLoader
	PerformerIDLoader
	TagIDLoader
}

type ImageReaderWriter added in v0.4.0

type ImageReaderWriter interface {
	ImageReader
	ImageWriter
}

type ImageWriter added in v0.4.0

type ImageWriter interface {
	Create(ctx context.Context, newImage *ImageCreateInput) error
	Update(ctx context.Context, updatedImage *Image) error
	UpdatePartial(ctx context.Context, id int, partial ImagePartial) (*Image, 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)
	Destroy(ctx context.Context, id int) error
}

type Images added in v0.5.0

type Images []*Image

func (*Images) Append added in v0.5.0

func (i *Images) Append(o interface{})

func (*Images) New added in v0.5.0

func (i *Images) New() interface{}

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 Movie added in v0.2.0

type Movie struct {
	ID       int            `db:"id" json:"id"`
	Checksum string         `db:"checksum" json:"checksum"`
	Name     sql.NullString `db:"name" json:"name"`
	Aliases  sql.NullString `db:"aliases" json:"aliases"`
	Duration sql.NullInt64  `db:"duration" json:"duration"`
	Date     SQLiteDate     `db:"date" json:"date"`
	// Rating expressed in 1-100 scale
	Rating    sql.NullInt64   `db:"rating" json:"rating"`
	StudioID  sql.NullInt64   `db:"studio_id,omitempty" json:"studio_id"`
	Director  sql.NullString  `db:"director" json:"director"`
	Synopsis  sql.NullString  `db:"synopsis" json:"synopsis"`
	URL       sql.NullString  `db:"url" json:"url"`
	CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`

	// TODO - this is only here because of database code in the models package
	FrontImageBlob sql.NullString `db:"front_image_blob" json:"-"`
	BackImageBlob  sql.NullString `db:"back_image_blob" json:"-"`
}

func NewMovie added in v0.4.0

func NewMovie(name string) *Movie

type MovieFilterType added in v0.17.0

type MovieFilterType struct {
	Name     *StringCriterionInput `json:"name"`
	Director *StringCriterionInput `json:"director"`
	Synopsis *StringCriterionInput `json:"synopsis"`
	// Filter by duration (in seconds)
	Duration *IntCriterionInput `json:"duration"`
	// Filter by rating expressed as 1-5
	Rating *IntCriterionInput `json:"rating"`
	// Filter by rating expressed as 1-100
	Rating100 *IntCriterionInput `json:"rating100"`
	// Filter to only include movies with this studio
	Studios *HierarchicalMultiCriterionInput `json:"studios"`
	// Filter to only include movies missing this property
	IsMissing *string `json:"is_missing"`
	// Filter by url
	URL *StringCriterionInput `json:"url"`
	// Filter to only include movies where performer appears in a scene
	Performers *MultiCriterionInput `json:"performers"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type MoviePartial added in v0.2.0

type MoviePartial struct {
	ID       int             `db:"id" json:"id"`
	Checksum *string         `db:"checksum" json:"checksum"`
	Name     *sql.NullString `db:"name" json:"name"`
	Aliases  *sql.NullString `db:"aliases" json:"aliases"`
	Duration *sql.NullInt64  `db:"duration" json:"duration"`
	Date     *SQLiteDate     `db:"date" json:"date"`
	// Rating expressed in 1-100 scale
	Rating    *sql.NullInt64   `db:"rating" json:"rating"`
	StudioID  *sql.NullInt64   `db:"studio_id,omitempty" json:"studio_id"`
	Director  *sql.NullString  `db:"director" json:"director"`
	Synopsis  *sql.NullString  `db:"synopsis" json:"synopsis"`
	URL       *sql.NullString  `db:"url" json:"url"`
	CreatedAt *SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt *SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

type MovieReader added in v0.4.0

type MovieReader interface {
	Find(ctx context.Context, id int) (*Movie, error)
	FindMany(ctx context.Context, ids []int) ([]*Movie, error)
	// FindBySceneID(sceneID int) ([]*Movie, error)
	FindByName(ctx context.Context, name string, nocase bool) (*Movie, error)
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*Movie, error)
	All(ctx context.Context) ([]*Movie, error)
	Count(ctx context.Context) (int, error)
	Query(ctx context.Context, movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int, error)
	GetFrontImage(ctx context.Context, movieID int) ([]byte, error)
	GetBackImage(ctx context.Context, movieID int) ([]byte, error)
	HasBackImage(ctx context.Context, movieID int) (bool, error)
	FindByPerformerID(ctx context.Context, performerID int) ([]*Movie, error)
	CountByPerformerID(ctx context.Context, performerID int) (int, error)
	FindByStudioID(ctx context.Context, studioID int) ([]*Movie, error)
	CountByStudioID(ctx context.Context, studioID int) (int, error)
}

type MovieReaderWriter added in v0.4.0

type MovieReaderWriter interface {
	MovieReader
	MovieWriter
}

type MovieWriter added in v0.4.0

type MovieWriter interface {
	Create(ctx context.Context, newMovie Movie) (*Movie, error)
	Update(ctx context.Context, updatedMovie MoviePartial) (*Movie, error)
	UpdateFull(ctx context.Context, updatedMovie Movie) (*Movie, error)
	Destroy(ctx context.Context, id int) error
	UpdateFrontImage(ctx context.Context, movieID int, frontImage []byte) error
	UpdateBackImage(ctx context.Context, movieID int, backImage []byte) error
}

type Movies added in v0.5.0

type Movies []*Movie

func (*Movies) Append added in v0.5.0

func (m *Movies) Append(o interface{})

func (*Movies) New added in v0.5.0

func (m *Movies) New() interface{}

type MoviesScenes added in v0.2.0

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

func MoviesScenesFromInput added in v0.18.0

func MoviesScenesFromInput(input []*SceneMovieInput) ([]MoviesScenes, error)

func (MoviesScenes) Equal added in v0.17.0

func (s MoviesScenes) Equal(o MoviesScenes) bool

func (MoviesScenes) SceneMovieInput added in v0.17.0

func (s MoviesScenes) SceneMovieInput() *SceneMovieInput

type MultiCriterionInput added in v0.17.0

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

type NullSQLiteTimestamp added in v0.4.0

type NullSQLiteTimestamp struct {
	Timestamp time.Time
	Valid     bool
}

func (*NullSQLiteTimestamp) Scan added in v0.4.0

func (t *NullSQLiteTimestamp) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSQLiteTimestamp) Value added in v0.4.0

func (t NullSQLiteTimestamp) Value() (driver.Value, error)

Value implements the driver Valuer interface.

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
}

OptionalBool represents an optional float64 argument that may be null. See OptionalString.

func NewOptionalFloat64 added in v0.17.0

func NewOptionalFloat64(v float64) OptionalFloat64

NewOptionalFloat64 returns a new OptionalFloat64 with the given value.

func NewOptionalFloat64Ptr added in v0.18.0

func NewOptionalFloat64Ptr(v *float64) OptionalFloat64

NewOptionalFloat64 returns a new OptionalFloat64 with the given value.

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

type PHashDuplicationCriterionInput struct {
	Duplicated *bool `json:"duplicated"`
	// Currently unimplemented
	Distance *int `json:"distance"`
}

type Performer

type Performer struct {
	ID             int        `json:"id"`
	Name           string     `json:"name"`
	Disambiguation string     `json:"disambiguation"`
	Gender         GenderEnum `json:"gender"`
	URL            string     `json:"url"`
	Twitter        string     `json:"twitter"`
	Instagram      string     `json:"instagram"`
	Birthdate      *Date      `json:"birthdate"`
	Ethnicity      string     `json:"ethnicity"`
	Country        string     `json:"country"`
	EyeColor       string     `json:"eye_color"`
	Height         *int       `json:"height"`
	Measurements   string     `json:"measurements"`
	FakeTits       string     `json:"fake_tits"`
	CareerLength   string     `json:"career_length"`
	Tattoos        string     `json:"tattoos"`
	Piercings      string     `json:"piercings"`
	Favorite       bool       `json:"favorite"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	// Rating expressed in 1-100 scale
	Rating        *int   `json:"rating"`
	Details       string `json:"details"`
	DeathDate     *Date  `json:"death_date"`
	HairColor     string `json:"hair_color"`
	Weight        *int   `json:"weight"`
	IgnoreAutoTag bool   `json:"ignore_auto_tag"`

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

func NewPerformer added in v0.4.0

func NewPerformer(name string) *Performer

func (*Performer) LoadAliases added in v0.19.0

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

func (*Performer) LoadRelationships added in v0.19.0

func (s *Performer) LoadRelationships(ctx context.Context, l PerformerReader) error

func (*Performer) LoadStashIDs added in v0.19.0

func (s *Performer) LoadStashIDs(ctx context.Context, l StashIDLoader) error

func (*Performer) LoadTagIDs added in v0.19.0

func (s *Performer) LoadTagIDs(ctx context.Context, l TagIDLoader) error

type PerformerFilterType added in v0.17.0

type PerformerFilterType struct {
	And            *PerformerFilterType  `json:"AND"`
	Or             *PerformerFilterType  `json:"OR"`
	Not            *PerformerFilterType  `json:"NOT"`
	Name           *StringCriterionInput `json:"name"`
	Disambiguation *StringCriterionInput `json:"disambiguation"`
	Details        *StringCriterionInput `json:"details"`
	// Filter by favorite
	FilterFavorites *bool `json:"filter_favorites"`
	// Filter by birth year
	BirthYear *IntCriterionInput `json:"birth_year"`
	// Filter by age
	Age *IntCriterionInput `json:"age"`
	// Filter by ethnicity
	Ethnicity *StringCriterionInput `json:"ethnicity"`
	// Filter by country
	Country *StringCriterionInput `json:"country"`
	// Filter by eye color
	EyeColor *StringCriterionInput `json:"eye_color"`
	// Filter by height - deprecated: use height_cm instead
	Height *StringCriterionInput `json:"height"`
	// Filter by height in centimeters
	HeightCm *IntCriterionInput `json:"height_cm"`
	// Filter by measurements
	Measurements *StringCriterionInput `json:"measurements"`
	// Filter by fake tits value
	FakeTits *StringCriterionInput `json:"fake_tits"`
	// Filter by 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 StashID
	StashID *StringCriterionInput `json:"stash_id"`
	// Filter by StashID Endpoint
	StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
	// Filter by rating expressed as 1-5
	Rating *IntCriterionInput `json:"rating"`
	// 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 autotag ignore value
	IgnoreAutoTag *bool `json:"ignore_auto_tag"`
	// Filter by birthdate
	Birthdate *DateCriterionInput `json:"birth_date"`
	// Filter by death date
	DeathDate *DateCriterionInput `json:"death_date"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type PerformerFinder added in v0.17.0

type PerformerFinder interface {
	FindMany(ctx context.Context, ids []int) ([]*Performer, error)
}

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 {
	ID             int
	Name           OptionalString
	Disambiguation OptionalString
	Gender         OptionalString
	URL            OptionalString
	Twitter        OptionalString
	Instagram      OptionalString
	Birthdate      OptionalDate
	Ethnicity      OptionalString
	Country        OptionalString
	EyeColor       OptionalString
	Height         OptionalInt
	Measurements   OptionalString
	FakeTits       OptionalString
	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 PerformerReader added in v0.4.0

type PerformerReader interface {
	Find(ctx context.Context, id int) (*Performer, error)
	PerformerFinder
	FindBySceneID(ctx context.Context, sceneID int) ([]*Performer, error)
	FindByImageID(ctx context.Context, imageID int) ([]*Performer, error)
	FindByGalleryID(ctx context.Context, galleryID int) ([]*Performer, error)
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*Performer, error)
	FindByStashID(ctx context.Context, stashID StashID) ([]*Performer, error)
	FindByStashIDStatus(ctx context.Context, hasStashID bool, stashboxEndpoint string) ([]*Performer, error)
	CountByTagID(ctx context.Context, tagID int) (int, error)
	Count(ctx context.Context) (int, error)
	All(ctx context.Context) ([]*Performer, error)
	// TODO - this interface is temporary until the filter schema can fully
	// support the query needed
	QueryForAutoTag(ctx context.Context, words []string) ([]*Performer, error)
	Query(ctx context.Context, performerFilter *PerformerFilterType, findFilter *FindFilterType) ([]*Performer, int, error)
	QueryCount(ctx context.Context, galleryFilter *PerformerFilterType, findFilter *FindFilterType) (int, error)
	AliasLoader
	GetImage(ctx context.Context, performerID int) ([]byte, error)
	StashIDLoader
	TagIDLoader
}

type PerformerReaderWriter added in v0.4.0

type PerformerReaderWriter interface {
	PerformerReader
	PerformerWriter
}

type PerformerWriter added in v0.4.0

type PerformerWriter interface {
	Create(ctx context.Context, newPerformer *Performer) error
	UpdatePartial(ctx context.Context, id int, updatedPerformer PerformerPartial) (*Performer, error)
	Update(ctx context.Context, updatedPerformer *Performer) error
	Destroy(ctx context.Context, id int) error
	UpdateImage(ctx context.Context, performerID int, image []byte) error
	DestroyImage(ctx context.Context, performerID int) error
}

type Performers added in v0.5.0

type Performers []*Performer

func (*Performers) Append added in v0.5.0

func (p *Performers) Append(o interface{})

func (*Performers) New added in v0.5.0

func (p *Performers) New() interface{}

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.File) RelatedFiles

func (RelatedFiles) List added in v0.17.0

func (r RelatedFiles) List() []file.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.File

Primary returns the primary file. Panics if the relationship has not been loaded.

func (RelatedFiles) PrimaryLoaded added in v0.17.0

func (r RelatedFiles) PrimaryLoaded() bool

Loaded returns true if the primary file relationship has been loaded.

type RelatedIDs added in v0.17.0

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

RelatedIDs represents a list of related IDs. TODO - this can be made generic

func NewRelatedIDs added in v0.17.0

func NewRelatedIDs(ids []int) RelatedIDs

NewRelatedIDs returns a loaded RelatedIDs object with the provided IDs. Loaded will return true when called on the returned object if the provided slice is not nil.

func (*RelatedIDs) Add added in v0.17.0

func (r *RelatedIDs) Add(ids ...int)

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

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

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

func NewRelatedImageFiles added in v0.17.0

func NewRelatedImageFiles(files []*file.ImageFile) RelatedImageFiles

func (RelatedImageFiles) List added in v0.17.0

func (r RelatedImageFiles) List() []*file.ImageFile

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

func (RelatedImageFiles) Loaded added in v0.17.0

func (r RelatedImageFiles) Loaded() bool

Loaded returns true if the relationship has been loaded.

func (RelatedImageFiles) Primary added in v0.17.0

func (r RelatedImageFiles) Primary() *file.ImageFile

Primary returns the primary file. Panics if the relationship has not been loaded.

func (RelatedImageFiles) PrimaryLoaded added in v0.17.0

func (r RelatedImageFiles) PrimaryLoaded() bool

Loaded returns true if the primary file relationship has been loaded.

type RelatedMovies added in v0.17.0

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

RelatedMovies represents a list of related Movies.

func NewRelatedMovies added in v0.17.0

func NewRelatedMovies(list []MoviesScenes) RelatedMovies

NewRelatedMovies returns a loaded RelatedMovies object with the provided movies. Loaded will return true when called on the returned object if the provided slice is not nil.

func (*RelatedMovies) Add added in v0.17.0

func (r *RelatedMovies) Add(movies ...MoviesScenes)

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

func (*RelatedMovies) ForID added in v0.18.0

func (r *RelatedMovies) ForID(id int) *MoviesScenes

ForID returns the MoviesScenes object for the given movie ID. Returns nil if not found.

func (RelatedMovies) List added in v0.17.0

func (r RelatedMovies) List() []MoviesScenes

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

func (RelatedMovies) Loaded added in v0.17.0

func (r RelatedMovies) Loaded() bool

Loaded returns true if the relationship has 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) 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 []*file.VideoFile) RelatedVideoFiles

func (RelatedVideoFiles) List added in v0.17.0

func (r RelatedVideoFiles) List() []*file.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() *file.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 []*file.VideoFile)

func (*RelatedVideoFiles) SetPrimary added in v0.17.0

func (r *RelatedVideoFiles) SetPrimary(f *file.VideoFile)

type RelationshipUpdateMode added in v0.17.0

type RelationshipUpdateMode string
const (
	RelationshipUpdateModeSet    RelationshipUpdateMode = "SET"
	RelationshipUpdateModeAdd    RelationshipUpdateMode = "ADD"
	RelationshipUpdateModeRemove RelationshipUpdateMode = "REMOVE"
)

func (RelationshipUpdateMode) IsValid added in v0.17.0

func (e RelationshipUpdateMode) IsValid() bool

func (RelationshipUpdateMode) MarshalGQL added in v0.17.0

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

func (RelationshipUpdateMode) String added in v0.17.0

func (e RelationshipUpdateMode) String() string

func (*RelationshipUpdateMode) UnmarshalGQL added in v0.17.0

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

type Repository added in v0.5.0

type 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
	ResolutionEnumVrHd ResolutionEnum = "VR_HD"
	// 4k
	ResolutionEnumFourK ResolutionEnum = "FOUR_K"
	// 5k
	ResolutionEnumFiveK ResolutionEnum = "FIVE_K"
	// 6k
	ResolutionEnumSixK ResolutionEnum = "SIX_K"
	// 8k
	ResolutionEnumEightK ResolutionEnum = "EIGHT_K"
)

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 SQLiteDate

type SQLiteDate struct {
	String string
	Valid  bool
}

TODO - this should be moved to sqlite

func (*SQLiteDate) DatePtr added in v0.17.0

func (t *SQLiteDate) DatePtr() *Date

func (*SQLiteDate) Scan

func (t *SQLiteDate) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*SQLiteDate) StringPtr added in v0.11.0

func (t *SQLiteDate) StringPtr() *string

func (*SQLiteDate) TimePtr added in v0.17.0

func (t *SQLiteDate) TimePtr() *time.Time

func (SQLiteDate) Value

func (t SQLiteDate) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type SQLiteTimestamp

type SQLiteTimestamp struct {
	Timestamp time.Time
}

func (*SQLiteTimestamp) Scan

func (t *SQLiteTimestamp) Scan(value interface{}) error

Scan implements the Scanner interface.

func (SQLiteTimestamp) Value

func (t SQLiteTimestamp) Value() (driver.Value, error)

Value implements the driver Valuer interface.

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"`
	// JSON-encoded filter string
	Filter string `db:"filter" json:"filter"`
}

type SavedFilterReader added in v0.8.0

type SavedFilterReader interface {
	All(ctx context.Context) ([]*SavedFilter, error)
	Find(ctx context.Context, id int) (*SavedFilter, error)
	FindMany(ctx context.Context, ids []int, ignoreNotFound bool) ([]*SavedFilter, error)
	FindByMode(ctx context.Context, mode FilterMode) ([]*SavedFilter, error)
	FindDefault(ctx context.Context, mode FilterMode) (*SavedFilter, error)
}

type SavedFilterReaderWriter added in v0.8.0

type SavedFilterReaderWriter interface {
	SavedFilterReader
	SavedFilterWriter
}

type SavedFilterWriter added in v0.8.0

type SavedFilterWriter interface {
	Create(ctx context.Context, obj SavedFilter) (*SavedFilter, error)
	Update(ctx context.Context, obj SavedFilter) (*SavedFilter, error)
	SetDefault(ctx context.Context, obj SavedFilter) (*SavedFilter, error)
	Destroy(ctx context.Context, id int) error
}

type SavedFilters added in v0.8.0

type SavedFilters []*SavedFilter

func (*SavedFilters) Append added in v0.8.0

func (m *SavedFilters) Append(o interface{})

func (*SavedFilters) New added in v0.8.0

func (m *SavedFilters) New() interface{}

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"`
	URL      string `json:"url"`
	Date     *Date  `json:"date"`
	// Rating expressed in 1-100 scale
	Rating    *int `json:"rating"`
	Organized bool `json:"organized"`
	OCounter  int  `json:"o_counter"`
	StudioID  *int `json:"studio_id"`

	// transient - not persisted
	Files         RelatedVideoFiles
	PrimaryFileID *file.ID
	// transient - path of primary file - empty if no files
	Path string
	// transient - oshash of primary file - empty if no files
	OSHash string
	// transient - checksum of primary file - empty if no files
	Checksum string

	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	LastPlayedAt *time.Time `json:"last_played_at"`
	ResumeTime   float64    `json:"resume_time"`
	PlayDuration float64    `json:"play_duration"`
	PlayCount    int        `json:"play_count"`

	GalleryIDs   RelatedIDs      `json:"gallery_ids"`
	TagIDs       RelatedIDs      `json:"tag_ids"`
	PerformerIDs RelatedIDs      `json:"performer_ids"`
	Movies       RelatedMovies   `json:"movies"`
	StashIDs     RelatedStashIDs `json:"stash_ids"`
}

Scene stores the metadata for a single video scene.

func (Scene) DisplayName added in v0.17.0

func (s Scene) DisplayName() string

DisplayName returns a display name for the scene for logging purposes. It returns Path if not empty, otherwise it returns the ID.

func (Scene) GetHash added in v0.3.0

func (s Scene) GetHash(hashAlgorithm HashAlgorithm) string

GetHash returns the hash of the scene, based on the hash algorithm provided. If hash algorithm is MD5, then Checksum is returned. Otherwise, OSHash is returned.

func (Scene) GetTitle

func (s Scene) GetTitle() string

GetTitle returns the title of the scene. If the Title field is empty, then the base filename is returned.

func (*Scene) LoadFiles added in v0.17.0

func (s *Scene) LoadFiles(ctx context.Context, l VideoFileLoader) error

func (*Scene) LoadGalleryIDs added in v0.17.0

func (s *Scene) LoadGalleryIDs(ctx context.Context, l GalleryIDLoader) error

func (*Scene) LoadMovies added in v0.17.0

func (s *Scene) LoadMovies(ctx context.Context, l SceneMovieLoader) error

func (*Scene) LoadPerformerIDs added in v0.17.0

func (s *Scene) LoadPerformerIDs(ctx context.Context, l PerformerIDLoader) error

func (*Scene) LoadPrimaryFile added in v0.17.0

func (s *Scene) LoadPrimaryFile(ctx context.Context, l file.Finder) error

func (*Scene) LoadRelationships added in v0.17.0

func (s *Scene) LoadRelationships(ctx context.Context, l SceneReader) error

func (*Scene) LoadStashIDs added in v0.17.0

func (s *Scene) LoadStashIDs(ctx context.Context, l StashIDLoader) error

func (*Scene) LoadTagIDs added in v0.17.0

func (s *Scene) LoadTagIDs(ctx context.Context, l TagIDLoader) error

type SceneDestroyInput added in v0.17.0

type SceneDestroyInput struct {
	ID              string `json:"id"`
	DeleteFile      *bool  `json:"delete_file"`
	DeleteGenerated *bool  `json:"delete_generated"`
}

type SceneFileType

type SceneFileType struct {
	Size       *string  `graphql:"size" json:"size"`
	Duration   *float64 `graphql:"duration" json:"duration"`
	VideoCodec *string  `graphql:"video_codec" json:"video_codec"`
	AudioCodec *string  `graphql:"audio_codec" json:"audio_codec"`
	Width      *int     `graphql:"width" json:"width"`
	Height     *int     `graphql:"height" json:"height"`
	Framerate  *float64 `graphql:"framerate" json:"framerate"`
	Bitrate    *int     `graphql:"bitrate" json:"bitrate"`
}

SceneFileType represents the file metadata for a scene.

type SceneFilterType added in v0.17.0

type SceneFilterType struct {
	And      *SceneFilterType      `json:"AND"`
	Or       *SceneFilterType      `json:"OR"`
	Not      *SceneFilterType      `json:"NOT"`
	ID       *IntCriterionInput    `json:"id"`
	Title    *StringCriterionInput `json:"title"`
	Code     *StringCriterionInput `json:"code"`
	Details  *StringCriterionInput `json:"details"`
	Director *StringCriterionInput `json:"director"`
	// Filter by file oshash
	Oshash *StringCriterionInput `json:"oshash"`
	// Filter by file checksum
	Checksum *StringCriterionInput `json:"checksum"`
	// Filter by file phash
	Phash *StringCriterionInput `json:"phash"`
	// Filter by path
	Path *StringCriterionInput `json:"path"`
	// Filter by file count
	FileCount *IntCriterionInput `json:"file_count"`
	// Filter by rating expressed as 1-5
	Rating *IntCriterionInput `json:"rating"`
	// 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 duration (in seconds)
	Duration *IntCriterionInput `json:"duration"`
	// Filter to only include scenes which have markers. `true` or `false`
	HasMarkers *string `json:"has_markers"`
	// Filter to only include scenes missing this property
	IsMissing *string `json:"is_missing"`
	// Filter to only include scenes with this studio
	Studios *HierarchicalMultiCriterionInput `json:"studios"`
	// Filter to only include scenes with this movie
	Movies *MultiCriterionInput `json:"movies"`
	// Filter to only include scenes with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter by tag count
	TagCount *IntCriterionInput `json:"tag_count"`
	// Filter to only include scenes with performers with these tags
	PerformerTags *HierarchicalMultiCriterionInput `json:"performer_tags"`
	// Filter scenes that have performers that have been favorited
	PerformerFavorite *bool `json:"performer_favorite"`
	// Filter scenes by performer age at time of scene
	PerformerAge *IntCriterionInput `json:"performer_age"`
	// Filter to only include scenes with these performers
	Performers *MultiCriterionInput `json:"performers"`
	// Filter by performer count
	PerformerCount *IntCriterionInput `json:"performer_count"`
	// Filter by StashID
	StashID *StringCriterionInput `json:"stash_id"`
	// Filter by StashID Endpoint
	StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
	// Filter by url
	URL *StringCriterionInput `json:"url"`
	// Filter by interactive
	Interactive *bool `json:"interactive"`
	// Filter by InteractiveSpeed
	InteractiveSpeed *IntCriterionInput `json:"interactive_speed"`
	// Filter by captions
	Captions *StringCriterionInput `json:"captions"`
	// Filter by resume time
	ResumeTime *IntCriterionInput `json:"resume_time"`
	// Filter by play count
	PlayCount *IntCriterionInput `json:"play_count"`
	// Filter by play duration (in seconds)
	PlayDuration *IntCriterionInput `json:"play_duration"`
	// Filter by date
	Date *DateCriterionInput `json:"date"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type SceneFinder added in v0.11.0

type SceneFinder interface {
	// TODO - rename this to Find and remove existing method
	FindMany(ctx context.Context, ids []int) ([]*Scene, 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             `db:"id" json:"id"`
	Title        string          `db:"title" json:"title"`
	Seconds      float64         `db:"seconds" json:"seconds"`
	PrimaryTagID int             `db:"primary_tag_id" json:"primary_tag_id"`
	SceneID      sql.NullInt64   `db:"scene_id,omitempty" json:"scene_id"`
	CreatedAt    SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt    SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

type SceneMarkerFilterType added in v0.17.0

type SceneMarkerFilterType struct {
	// Filter to only include scene markers with this tag
	TagID *string `json:"tag_id"`
	// Filter to only include scene markers with these tags
	Tags *HierarchicalMultiCriterionInput `json:"tags"`
	// Filter to only include scene markers attached to a scene with these tags
	SceneTags *HierarchicalMultiCriterionInput `json:"scene_tags"`
	// Filter to only include scene markers with these performers
	Performers *MultiCriterionInput `json:"performers"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
	// Filter by scenes date
	SceneDate *DateCriterionInput `json:"scene_date"`
	// Filter by scenes created at
	SceneCreatedAt *TimestampCriterionInput `json:"scene_created_at"`
	// Filter by scenes updated at
	SceneUpdatedAt *TimestampCriterionInput `json:"scene_updated_at"`
}

type SceneMarkerReader added in v0.4.0

type SceneMarkerReader interface {
	Find(ctx context.Context, id int) (*SceneMarker, error)
	FindMany(ctx context.Context, ids []int) ([]*SceneMarker, error)
	FindBySceneID(ctx context.Context, sceneID int) ([]*SceneMarker, error)
	CountByTagID(ctx context.Context, tagID int) (int, error)
	GetMarkerStrings(ctx context.Context, q *string, sort *string) ([]*MarkerStringsResultType, error)
	Wall(ctx context.Context, q *string) ([]*SceneMarker, error)
	Count(ctx context.Context) (int, error)
	All(ctx context.Context) ([]*SceneMarker, error)
	Query(ctx context.Context, sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) ([]*SceneMarker, int, error)
	GetTagIDs(ctx context.Context, imageID int) ([]int, error)
}

type SceneMarkerReaderWriter added in v0.4.0

type SceneMarkerReaderWriter interface {
	SceneMarkerReader
	SceneMarkerWriter
}

type SceneMarkerWriter added in v0.4.0

type SceneMarkerWriter interface {
	Create(ctx context.Context, newSceneMarker SceneMarker) (*SceneMarker, error)
	Update(ctx context.Context, updatedSceneMarker SceneMarker) (*SceneMarker, error)
	Destroy(ctx context.Context, id int) error
	UpdateTags(ctx context.Context, markerID int, tagIDs []int) error
}

type SceneMarkers added in v0.5.0

type SceneMarkers []*SceneMarker

func (*SceneMarkers) Append added in v0.5.0

func (m *SceneMarkers) Append(o interface{})

func (*SceneMarkers) New added in v0.5.0

func (m *SceneMarkers) New() interface{}

type SceneMovieInput added in v0.17.0

type SceneMovieInput struct {
	MovieID    string `json:"movie_id"`
	SceneIndex *int   `json:"scene_index"`
}

type SceneMovieLoader added in v0.17.0

type SceneMovieLoader interface {
	GetMovies(ctx context.Context, id int) ([]MoviesScenes, error)
}

type ScenePartial

type ScenePartial struct {
	Title    OptionalString
	Code     OptionalString
	Details  OptionalString
	Director OptionalString
	URL      OptionalString
	Date     OptionalDate
	// Rating expressed in 1-100 scale
	Rating       OptionalInt
	Organized    OptionalBool
	OCounter     OptionalInt
	StudioID     OptionalInt
	CreatedAt    OptionalTime
	UpdatedAt    OptionalTime
	ResumeTime   OptionalFloat64
	PlayDuration OptionalFloat64
	PlayCount    OptionalInt
	LastPlayedAt OptionalTime

	GalleryIDs    *UpdateIDs
	TagIDs        *UpdateIDs
	PerformerIDs  *UpdateIDs
	MovieIDs      *UpdateMovieIDs
	StashIDs      *UpdateStashIDs
	PrimaryFileID *file.ID
}

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(finder SceneFinder) *SceneQueryResult

func (*SceneQueryResult) Resolve added in v0.11.0

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

type SceneReader added in v0.4.0

type SceneReader interface {
	SceneFinder
	// TODO - remove this in another PR
	Find(ctx context.Context, id int) (*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)
	FindByPerformerID(ctx context.Context, performerID int) ([]*Scene, error)
	FindByGalleryID(ctx context.Context, performerID int) ([]*Scene, error)
	FindDuplicates(ctx context.Context, distance int) ([][]*Scene, error)

	GalleryIDLoader
	PerformerIDLoader
	TagIDLoader
	SceneMovieLoader
	StashIDLoader
	VideoFileLoader

	CountByPerformerID(ctx context.Context, performerID int) (int, error)
	// FindByStudioID(studioID int) ([]*Scene, error)
	FindByMovieID(ctx context.Context, movieID int) ([]*Scene, error)
	CountByMovieID(ctx context.Context, movieID int) (int, error)
	Count(ctx context.Context) (int, error)
	Size(ctx context.Context) (float64, error)
	Duration(ctx context.Context) (float64, error)
	// SizeCount() (string, error)
	CountByStudioID(ctx context.Context, studioID int) (int, error)
	CountByTagID(ctx context.Context, tagID int) (int, error)
	CountMissingChecksum(ctx context.Context) (int, error)
	CountMissingOSHash(ctx context.Context) (int, error)
	Wall(ctx context.Context, q *string) ([]*Scene, error)
	All(ctx context.Context) ([]*Scene, error)
	Query(ctx context.Context, options SceneQueryOptions) (*SceneQueryResult, error)
	GetCover(ctx context.Context, sceneID int) ([]byte, error)
	HasCover(ctx context.Context, sceneID int) (bool, error)
}

type SceneReaderWriter added in v0.4.0

type SceneReaderWriter interface {
	SceneReader
	SceneWriter
}

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"`
	Date             *string `json:"date"`
	// Rating expressed in 1-5 scale
	Rating *int `json:"rating"`
	// Rating expressed in 1-100 scale
	Rating100    *int               `json:"rating100"`
	OCounter     *int               `json:"o_counter"`
	Organized    *bool              `json:"organized"`
	StudioID     *string            `json:"studio_id"`
	GalleryIds   []string           `json:"gallery_ids"`
	PerformerIds []string           `json:"performer_ids"`
	Movies       []*SceneMovieInput `json:"movies"`
	TagIds       []string           `json:"tag_ids"`
	// This should be a URL or a base64 encoded data URL
	CoverImage    *string   `json:"cover_image"`
	StashIds      []StashID `json:"stash_ids"`
	ResumeTime    *float64  `json:"resume_time"`
	PlayDuration  *float64  `json:"play_duration"`
	PlayCount     *int      `json:"play_count"`
	PrimaryFileID *string   `json:"primary_file_id"`
}

type SceneWriter added in v0.4.0

type SceneWriter interface {
	Create(ctx context.Context, newScene *Scene, fileIDs []file.ID) error
	Update(ctx context.Context, updatedScene *Scene) error
	UpdatePartial(ctx context.Context, id int, updatedScene ScenePartial) (*Scene, error)
	IncrementOCounter(ctx context.Context, id int) (int, error)
	DecrementOCounter(ctx context.Context, id int) (int, error)
	ResetOCounter(ctx context.Context, id int) (int, error)
	SaveActivity(ctx context.Context, id int, resumeTime *float64, playDuration *float64) (bool, error)
	IncrementWatchCount(ctx context.Context, id int) (int, error)
	Destroy(ctx context.Context, id int) error
	UpdateCover(ctx context.Context, sceneID int, cover []byte) error
}

type Scenes added in v0.5.0

type Scenes []*Scene

func (*Scenes) Append added in v0.5.0

func (s *Scenes) Append(o interface{})

func (*Scenes) New added in v0.5.0

func (s *Scenes) New() interface{}

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 ScrapedItem

type ScrapedItem struct {
	ID              int             `db:"id" json:"id"`
	Title           sql.NullString  `db:"title" json:"title"`
	Code            sql.NullString  `db:"code" json:"code"`
	Description     sql.NullString  `db:"description" json:"description"`
	Director        sql.NullString  `db:"director" json:"director"`
	URL             sql.NullString  `db:"url" json:"url"`
	Date            SQLiteDate      `db:"date" json:"date"`
	Rating          sql.NullString  `db:"rating" json:"rating"`
	Tags            sql.NullString  `db:"tags" json:"tags"`
	Models          sql.NullString  `db:"models" json:"models"`
	Episode         sql.NullInt64   `db:"episode" json:"episode"`
	GalleryFilename sql.NullString  `db:"gallery_filename" json:"gallery_filename"`
	GalleryURL      sql.NullString  `db:"gallery_url" json:"gallery_url"`
	VideoFilename   sql.NullString  `db:"video_filename" json:"video_filename"`
	VideoURL        sql.NullString  `db:"video_url" json:"video_url"`
	StudioID        sql.NullInt64   `db:"studio_id,omitempty" json:"studio_id"`
	CreatedAt       SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt       SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

type ScrapedItemReader added in v0.5.0

type ScrapedItemReader interface {
	All(ctx context.Context) ([]*ScrapedItem, error)
}

type ScrapedItemReaderWriter added in v0.5.0

type ScrapedItemReaderWriter interface {
	ScrapedItemReader
	ScrapedItemWriter
}

type ScrapedItemWriter added in v0.5.0

type ScrapedItemWriter interface {
	Create(ctx context.Context, newObject ScrapedItem) (*ScrapedItem, error)
}

type ScrapedItems added in v0.5.0

type ScrapedItems []*ScrapedItem

func (*ScrapedItems) Append added in v0.5.0

func (s *ScrapedItems) Append(o interface{})

func (*ScrapedItems) New added in v0.5.0

func (s *ScrapedItems) New() interface{}

type ScrapedMovie added in v0.3.0

type ScrapedMovie struct {
	StoredID *string        `json:"stored_id"`
	Name     *string        `json:"name"`
	Aliases  *string        `json:"aliases"`
	Duration *string        `json:"duration"`
	Date     *string        `json:"date"`
	Rating   *string        `json:"rating"`
	Director *string        `json:"director"`
	URL      *string        `json:"url"`
	Synopsis *string        `json:"synopsis"`
	Studio   *ScrapedStudio `json:"studio"`
	// This should be a base64 encoded data URL
	FrontImage *string `json:"front_image"`
	// This should be a base64 encoded data URL
	BackImage *string `json:"back_image"`
}

A movie from a scraping operation...

func (ScrapedMovie) IsScrapedContent added in v0.17.0

func (ScrapedMovie) IsScrapedContent()

type ScrapedPerformer

type ScrapedPerformer struct {
	// Set if performer matched
	StoredID       *string       `json:"stored_id"`
	Name           *string       `json:"name"`
	Disambiguation *string       `json:"disambiguation"`
	Gender         *string       `json:"gender"`
	URL            *string       `json:"url"`
	Twitter        *string       `json:"twitter"`
	Instagram      *string       `json:"instagram"`
	Birthdate      *string       `json:"birthdate"`
	Ethnicity      *string       `json:"ethnicity"`
	Country        *string       `json:"country"`
	EyeColor       *string       `json:"eye_color"`
	Height         *string       `json:"height"`
	Measurements   *string       `json:"measurements"`
	FakeTits       *string       `json:"fake_tits"`
	CareerLength   *string       `json:"career_length"`
	Tattoos        *string       `json:"tattoos"`
	Piercings      *string       `json:"piercings"`
	Aliases        *string       `json:"aliases"`
	Tags           []*ScrapedTag `json:"tags"`
	// This should be a base64 encoded data URL
	Image        *string  `json:"image"`
	Images       []string `json:"images"`
	Details      *string  `json:"details"`
	DeathDate    *string  `json:"death_date"`
	HairColor    *string  `json:"hair_color"`
	Weight       *string  `json:"weight"`
	RemoteSiteID *string  `json:"remote_site_id"`
}

A performer from a scraping operation...

func (ScrapedPerformer) IsScrapedContent added in v0.17.0

func (ScrapedPerformer) IsScrapedContent()

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"`
	Image        *string `json:"image"`
	RemoteSiteID *string `json:"remote_site_id"`
}

func (ScrapedStudio) IsScrapedContent added in v0.17.0

func (ScrapedStudio) IsScrapedContent()

type ScrapedTag added in v0.17.0

type ScrapedTag struct {
	// Set if tag matched
	StoredID *string `json:"stored_id"`
	Name     string  `json:"name"`
}

func (ScrapedTag) IsScrapedContent added in v0.17.0

func (ScrapedTag) IsScrapedContent()

type SearchSpecs added in v0.12.0

type SearchSpecs struct {
	// MustHave specifies all of the terms that must appear in the results.
	MustHave []string

	// AnySets specifies sets of terms where one of each set must appear in the results.
	AnySets [][]string

	// MustNot specifies all terms that must not appear in the results.
	MustNot []string
}

SearchSpecs provides the specifications for text-based searches.

func ParseSearchString added in v0.12.0

func ParseSearchString(s string) SearchSpecs

ParseSearchString parses the Q value and returns a SearchSpecs object.

By default, any words in the search value must appear in the results. Words encompassed by quotes (") as treated as a single term. Where keyword "OR" (case-insensitive) appears (and is not part of a quoted phrase), one of the OR'd terms must appear in the results. Where a keyword is prefixed with "-", that keyword must not appear in the results. Where OR appears as the first or last term, or where one of the OR operands has a not prefix, then the OR is treated literally.

type SortDirectionEnum added in v0.17.0

type SortDirectionEnum string
const (
	SortDirectionEnumAsc  SortDirectionEnum = "ASC"
	SortDirectionEnumDesc SortDirectionEnum = "DESC"
)

func (SortDirectionEnum) 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             `db:"id" json:"id"`
	Checksum  string          `db:"checksum" json:"checksum"`
	Name      sql.NullString  `db:"name" json:"name"`
	URL       sql.NullString  `db:"url" json:"url"`
	ParentID  sql.NullInt64   `db:"parent_id,omitempty" json:"parent_id"`
	CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
	// Rating expressed in 1-100 scale
	Rating        sql.NullInt64  `db:"rating" json:"rating"`
	Details       sql.NullString `db:"details" json:"details"`
	IgnoreAutoTag bool           `db:"ignore_auto_tag" json:"ignore_auto_tag"`
	// TODO - this is only here because of database code in the models package
	ImageBlob sql.NullString `db:"image_blob" json:"-"`
}

func NewStudio added in v0.4.0

func NewStudio(name string) *Studio

type StudioFilterType added in v0.17.0

type StudioFilterType struct {
	And     *StudioFilterType     `json:"AND"`
	Or      *StudioFilterType     `json:"OR"`
	Not     *StudioFilterType     `json:"NOT"`
	Name    *StringCriterionInput `json:"name"`
	Details *StringCriterionInput `json:"details"`
	// Filter to only include studios with this parent studio
	Parents *MultiCriterionInput `json:"parents"`
	// Filter by StashID
	StashID *StringCriterionInput `json:"stash_id"`
	// Filter by StashID Endpoint
	StashIDEndpoint *StashIDCriterionInput `json:"stash_id_endpoint"`
	// Filter to only include studios missing this property
	IsMissing *string `json:"is_missing"`
	// Filter by rating expressed as 1-5
	Rating *IntCriterionInput `json:"rating"`
	// Filter by rating expressed as 1-100
	Rating100 *IntCriterionInput `json:"rating100"`
	// Filter by scene count
	SceneCount *IntCriterionInput `json:"scene_count"`
	// Filter by image count
	ImageCount *IntCriterionInput `json:"image_count"`
	// Filter by gallery count
	GalleryCount *IntCriterionInput `json:"gallery_count"`
	// Filter by url
	URL *StringCriterionInput `json:"url"`
	// Filter by studio aliases
	Aliases *StringCriterionInput `json:"aliases"`
	// Filter by autotag ignore value
	IgnoreAutoTag *bool `json:"ignore_auto_tag"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type StudioFinder added in v0.17.0

type StudioFinder interface {
	FindMany(ctx context.Context, ids []int) ([]*Studio, error)
}

type StudioPartial added in v0.3.0

type StudioPartial struct {
	ID        int              `db:"id" json:"id"`
	Checksum  *string          `db:"checksum" json:"checksum"`
	Name      *sql.NullString  `db:"name" json:"name"`
	URL       *sql.NullString  `db:"url" json:"url"`
	ParentID  *sql.NullInt64   `db:"parent_id,omitempty" json:"parent_id"`
	CreatedAt *SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt *SQLiteTimestamp `db:"updated_at" json:"updated_at"`
	// Rating expressed in 1-100 scale
	Rating        *sql.NullInt64  `db:"rating" json:"rating"`
	Details       *sql.NullString `db:"details" json:"details"`
	IgnoreAutoTag *bool           `db:"ignore_auto_tag" json:"ignore_auto_tag"`
}

type StudioReader added in v0.4.0

type StudioReader interface {
	Find(ctx context.Context, id int) (*Studio, error)
	StudioFinder
	FindChildren(ctx context.Context, id int) ([]*Studio, error)
	FindByName(ctx context.Context, name string, nocase bool) (*Studio, error)
	FindByStashID(ctx context.Context, stashID StashID) ([]*Studio, error)
	Count(ctx context.Context) (int, error)
	All(ctx context.Context) ([]*Studio, error)
	// TODO - this interface is temporary until the filter schema can fully
	// support the query needed
	QueryForAutoTag(ctx context.Context, words []string) ([]*Studio, error)
	Query(ctx context.Context, studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int, error)
	GetImage(ctx context.Context, studioID int) ([]byte, error)
	HasImage(ctx context.Context, studioID int) (bool, error)
	StashIDLoader
	GetAliases(ctx context.Context, studioID int) ([]string, error)
}

type StudioReaderWriter added in v0.4.0

type StudioReaderWriter interface {
	StudioReader
	StudioWriter
}

type StudioWriter added in v0.4.0

type StudioWriter interface {
	Create(ctx context.Context, newStudio Studio) (*Studio, error)
	Update(ctx context.Context, updatedStudio StudioPartial) (*Studio, error)
	UpdateFull(ctx context.Context, updatedStudio Studio) (*Studio, error)
	Destroy(ctx context.Context, id int) error
	UpdateImage(ctx context.Context, studioID int, image []byte) error
	UpdateStashIDs(ctx context.Context, studioID int, stashIDs []StashID) error
	UpdateAliases(ctx context.Context, studioID int, aliases []string) error
}

type Studios added in v0.5.0

type Studios []*Studio

func (*Studios) Append added in v0.5.0

func (s *Studios) Append(o interface{})

func (*Studios) New added in v0.5.0

func (s *Studios) New() interface{}

type Tag

type Tag struct {
	ID            int            `db:"id" json:"id"`
	Name          string         `db:"name" json:"name"` // TODO make schema not null
	Description   sql.NullString `db:"description" json:"description"`
	IgnoreAutoTag bool           `db:"ignore_auto_tag" json:"ignore_auto_tag"`
	// TODO - this is only here because of database code in the models package
	ImageBlob sql.NullString  `db:"image_blob" json:"-"`
	CreatedAt SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

func NewTag added in v0.4.0

func NewTag(name string) *Tag

type TagFilterType added in v0.17.0

type TagFilterType struct {
	And *TagFilterType `json:"AND"`
	Or  *TagFilterType `json:"OR"`
	Not *TagFilterType `json:"NOT"`
	// Filter by tag name
	Name *StringCriterionInput `json:"name"`
	// Filter by tag aliases
	Aliases *StringCriterionInput `json:"aliases"`
	// Filter by tag description
	Description *StringCriterionInput `json:"description"`
	// Filter to only include tags missing this property
	IsMissing *string `json:"is_missing"`
	// Filter by number of scenes with this tag
	SceneCount *IntCriterionInput `json:"scene_count"`
	// Filter by number of images with this tag
	ImageCount *IntCriterionInput `json:"image_count"`
	// Filter by number of galleries with this tag
	GalleryCount *IntCriterionInput `json:"gallery_count"`
	// Filter by number of performers with this tag
	PerformerCount *IntCriterionInput `json:"performer_count"`
	// Filter by number of markers with this tag
	MarkerCount *IntCriterionInput `json:"marker_count"`
	// Filter by parent tags
	Parents *HierarchicalMultiCriterionInput `json:"parents"`
	// Filter by child tags
	Children *HierarchicalMultiCriterionInput `json:"children"`
	// Filter by number of parent tags the tag has
	ParentCount *IntCriterionInput `json:"parent_count"`
	// Filter by number f child tags the tag has
	ChildCount *IntCriterionInput `json:"child_count"`
	// Filter by autotag ignore value
	IgnoreAutoTag *bool `json:"ignore_auto_tag"`
	// Filter by created at
	CreatedAt *TimestampCriterionInput `json:"created_at"`
	// Filter by updated at
	UpdatedAt *TimestampCriterionInput `json:"updated_at"`
}

type TagFinder added in v0.17.0

type TagFinder interface {
	FindMany(ctx context.Context, ids []int) ([]*Tag, error)
}

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 {
	ID            int              `db:"id" json:"id"`
	Name          *string          `db:"name" json:"name"` // TODO make schema not null
	Description   *sql.NullString  `db:"description" json:"description"`
	IgnoreAutoTag *bool            `db:"ignore_auto_tag" json:"ignore_auto_tag"`
	CreatedAt     *SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt     *SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

type TagPath added in v0.11.0

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

type TagPaths added in v0.11.0

type TagPaths []*TagPath

func (*TagPaths) Append added in v0.11.0

func (t *TagPaths) Append(o interface{})

func (*TagPaths) New added in v0.11.0

func (t *TagPaths) New() interface{}

type TagReader added in v0.4.0

type TagReader interface {
	Find(ctx context.Context, id int) (*Tag, error)
	TagFinder
	FindBySceneID(ctx context.Context, sceneID int) ([]*Tag, error)
	FindByPerformerID(ctx context.Context, performerID int) ([]*Tag, error)
	FindBySceneMarkerID(ctx context.Context, sceneMarkerID int) ([]*Tag, error)
	FindByImageID(ctx context.Context, imageID int) ([]*Tag, error)
	FindByGalleryID(ctx context.Context, galleryID int) ([]*Tag, error)
	FindByName(ctx context.Context, name string, nocase bool) (*Tag, error)
	FindByNames(ctx context.Context, names []string, nocase bool) ([]*Tag, error)
	FindByParentTagID(ctx context.Context, parentID int) ([]*Tag, error)
	FindByChildTagID(ctx context.Context, childID int) ([]*Tag, error)
	Count(ctx context.Context) (int, error)
	All(ctx context.Context) ([]*Tag, error)
	// TODO - this interface is temporary until the filter schema can fully
	// support the query needed
	QueryForAutoTag(ctx context.Context, words []string) ([]*Tag, error)
	Query(ctx context.Context, tagFilter *TagFilterType, findFilter *FindFilterType) ([]*Tag, int, error)
	GetImage(ctx context.Context, tagID int) ([]byte, error)
	GetAliases(ctx context.Context, tagID int) ([]string, error)
	FindAllAncestors(ctx context.Context, tagID int, excludeIDs []int) ([]*TagPath, error)
	FindAllDescendants(ctx context.Context, tagID int, excludeIDs []int) ([]*TagPath, error)
}

type TagReaderWriter added in v0.4.0

type TagReaderWriter interface {
	TagReader
	TagWriter
}

type TagWriter added in v0.4.0

type TagWriter interface {
	Create(ctx context.Context, newTag Tag) (*Tag, error)
	Update(ctx context.Context, updateTag TagPartial) (*Tag, error)
	UpdateFull(ctx context.Context, updatedTag Tag) (*Tag, error)
	Destroy(ctx context.Context, id int) error
	UpdateImage(ctx context.Context, tagID int, image []byte) error
	UpdateAliases(ctx context.Context, tagID int, aliases []string) error
	Merge(ctx context.Context, source []int, destination int) error
	UpdateParentTags(ctx context.Context, tagID int, parentIDs []int) error
	UpdateChildTags(ctx context.Context, tagID int, parentIDs []int) error
}

type Tags added in v0.5.0

type Tags []*Tag

func (*Tags) Append added in v0.5.0

func (t *Tags) Append(o interface{})

func (*Tags) New added in v0.5.0

func (t *Tags) New() interface{}

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
	Reset() error
}

type UpdateIDs added in v0.17.0

type UpdateIDs struct {
	IDs  []int                  `json:"ids"`
	Mode RelationshipUpdateMode `json:"mode"`
}

func (*UpdateIDs) IDStrings added in v0.17.0

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

type UpdateMovieIDs added in v0.17.0

type UpdateMovieIDs struct {
	Movies []MoviesScenes         `json:"movies"`
	Mode   RelationshipUpdateMode `json:"mode"`
}

func UpdateMovieIDsFromInput added in v0.17.0

func UpdateMovieIDsFromInput(i []*SceneMovieInput) (*UpdateMovieIDs, error)

func (*UpdateMovieIDs) AddUnique added in v0.18.0

func (u *UpdateMovieIDs) AddUnique(v MoviesScenes)

func (*UpdateMovieIDs) SceneMovieInputs added in v0.17.0

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

type UpdateStashIDs added in v0.17.0

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

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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