models

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGthumbWidth int = 640

Variables

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

Functions

func MatchScrapedSceneMovie added in v0.4.0

func MatchScrapedSceneMovie(m *ScrapedSceneMovie) error

MatchScrapedSceneMovie matches the provided movie with the movies in the database and sets the ID field if one is found.

func MatchScrapedScenePerformer added in v0.4.0

func MatchScrapedScenePerformer(p *ScrapedScenePerformer) error

MatchScrapedScenePerformer matches the provided performer with the performers in the database and sets the ID field if one is found.

func MatchScrapedSceneStudio added in v0.4.0

func MatchScrapedSceneStudio(s *ScrapedSceneStudio) error

MatchScrapedSceneStudio matches the provided studio with the studios in the database and sets the ID field if one is found.

func MatchScrapedSceneTag added in v0.4.0

func MatchScrapedSceneTag(s *ScrapedSceneTag) error

MatchScrapedSceneTag matches the provided tag with the tags in the database and sets the ID field if one is found.

func SQLGenKeys

func SQLGenKeys(i interface{}) string

https://github.com/jmoiron/sqlx/issues/410 sqlGenKeys is used for passing a struct and returning a string of keys for non empty key:values. These keys are formated keyname=:keyname with a comma seperating them

func SQLGenKeysPartial

func SQLGenKeysPartial(i interface{}) string

support a partial interface. When a partial interface is provided, keys will always be included if the value is not null. The partial interface must therefore consist of pointers

Types

type GalleriesImages added in v0.4.0

type GalleriesImages struct {
	GalleryID int `db:"gallery_id" json:"gallery_id"`
	ImageID   int `db:"image_id" json:"image_id"`
}

type GalleriesTags added in v0.4.0

type GalleriesTags struct {
	TagID     int `db:"tag_id" json:"tag_id"`
	GalleryID int `db:"gallery_id" json:"gallery_id"`
}
type Gallery struct {
	ID          int                 `db:"id" json:"id"`
	Path        sql.NullString      `db:"path" json:"path"`
	Checksum    string              `db:"checksum" json:"checksum"`
	Zip         bool                `db:"zip" json:"zip"`
	Title       sql.NullString      `db:"title" json:"title"`
	URL         sql.NullString      `db:"url" json:"url"`
	Date        SQLiteDate          `db:"date" json:"date"`
	Details     sql.NullString      `db:"details" json:"details"`
	Rating      sql.NullInt64       `db:"rating" json:"rating"`
	StudioID    sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	SceneID     sql.NullInt64       `db:"scene_id,omitempty" json:"scene_id"`
	FileModTime NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

type GalleryNullSceneID

type GalleryNullSceneID struct {
	SceneID sql.NullInt64
}

type GalleryPartial added in v0.4.0

type GalleryPartial struct {
	ID          int                  `db:"id" json:"id"`
	Path        *sql.NullString      `db:"path" json:"path"`
	Checksum    *string              `db:"checksum" json:"checksum"`
	Title       *sql.NullString      `db:"title" json:"title"`
	URL         *sql.NullString      `db:"url" json:"url"`
	Date        *SQLiteDate          `db:"date" json:"date"`
	Details     *sql.NullString      `db:"details" json:"details"`
	Rating      *sql.NullInt64       `db:"rating" json:"rating"`
	StudioID    *sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	SceneID     *sql.NullInt64       `db:"scene_id,omitempty" json:"scene_id"`
	FileModTime *NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   *SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   *SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

GalleryPartial represents part of a Gallery object. It is used to update the database entry. Only non-nil fields will be updated.

type GalleryQueryBuilder

type GalleryQueryBuilder struct{}

func NewGalleryQueryBuilder

func NewGalleryQueryBuilder() GalleryQueryBuilder

func (*GalleryQueryBuilder) All

func (qb *GalleryQueryBuilder) All() ([]*Gallery, error)

func (*GalleryQueryBuilder) ClearGalleryId

func (qb *GalleryQueryBuilder) ClearGalleryId(sceneID int, tx *sqlx.Tx) error

func (*GalleryQueryBuilder) Count

func (qb *GalleryQueryBuilder) Count() (int, error)

func (*GalleryQueryBuilder) CountByImageID added in v0.4.0

func (qb *GalleryQueryBuilder) CountByImageID(imageID int) (int, error)

func (*GalleryQueryBuilder) Create

func (qb *GalleryQueryBuilder) Create(newGallery Gallery, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) Destroy added in v0.2.0

func (qb *GalleryQueryBuilder) Destroy(id int, tx *sqlx.Tx) error

func (*GalleryQueryBuilder) Find

func (qb *GalleryQueryBuilder) Find(id int, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) FindByChecksum

func (qb *GalleryQueryBuilder) FindByChecksum(checksum string, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) FindByImageID added in v0.4.0

func (qb *GalleryQueryBuilder) FindByImageID(imageID int, tx *sqlx.Tx) ([]*Gallery, error)

func (*GalleryQueryBuilder) FindByPath

func (qb *GalleryQueryBuilder) FindByPath(path string) (*Gallery, error)

func (*GalleryQueryBuilder) FindBySceneID

func (qb *GalleryQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) FindMany added in v0.3.0

func (qb *GalleryQueryBuilder) FindMany(ids []int) ([]*Gallery, error)

func (*GalleryQueryBuilder) Query

func (qb *GalleryQueryBuilder) Query(galleryFilter *GalleryFilterType, findFilter *FindFilterType) ([]*Gallery, int)

func (*GalleryQueryBuilder) Update

func (qb *GalleryQueryBuilder) Update(updatedGallery Gallery, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) UpdateChecksum added in v0.4.0

func (qb *GalleryQueryBuilder) UpdateChecksum(id int, checksum string, tx *sqlx.Tx) error

func (*GalleryQueryBuilder) UpdateFileModTime added in v0.4.0

func (qb *GalleryQueryBuilder) UpdateFileModTime(id int, modTime NullSQLiteTimestamp, tx *sqlx.Tx) error

func (*GalleryQueryBuilder) UpdatePartial added in v0.4.0

func (qb *GalleryQueryBuilder) UpdatePartial(updatedGallery GalleryPartial, tx *sqlx.Tx) (*Gallery, error)

func (*GalleryQueryBuilder) ValidGalleriesForScenePath

func (qb *GalleryQueryBuilder) ValidGalleriesForScenePath(scenePath string) ([]*Gallery, error)

type GalleryReader added in v0.4.0

type GalleryReader interface {
	// Find(id int) (*Gallery, error)
	FindMany(ids []int) ([]*Gallery, error)
	FindByChecksum(checksum string) (*Gallery, error)
	FindByPath(path string) (*Gallery, error)
	FindBySceneID(sceneID int) (*Gallery, error)
	FindByImageID(imageID int) ([]*Gallery, error)
	// ValidGalleriesForScenePath(scenePath string) ([]*Gallery, error)
	// Count() (int, error)
	All() ([]*Gallery, error)
}

type GalleryReaderWriter added in v0.4.0

type GalleryReaderWriter interface {
	GalleryReader
	GalleryWriter
}

func NewGalleryReaderWriter added in v0.4.0

func NewGalleryReaderWriter(tx *sqlx.Tx) GalleryReaderWriter

type GalleryWriter added in v0.4.0

type GalleryWriter interface {
	Create(newGallery Gallery) (*Gallery, error)
	Update(updatedGallery Gallery) (*Gallery, error)
}

type Image added in v0.4.0

type Image struct {
	ID          int                 `db:"id" json:"id"`
	Checksum    string              `db:"checksum" json:"checksum"`
	Path        string              `db:"path" json:"path"`
	Title       sql.NullString      `db:"title" json:"title"`
	Rating      sql.NullInt64       `db:"rating" json:"rating"`
	OCounter    int                 `db:"o_counter" json:"o_counter"`
	Size        sql.NullInt64       `db:"size" json:"size"`
	Width       sql.NullInt64       `db:"width" json:"width"`
	Height      sql.NullInt64       `db:"height" json:"height"`
	StudioID    sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	FileModTime NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

Image stores the metadata for a single image.

type ImageFileType added in v0.4.0

type ImageFileType struct {
	Size   *int `graphql:"size" json:"size"`
	Width  *int `graphql:"width" json:"width"`
	Height *int `graphql:"height" json:"height"`
}

ImageFileType represents the file metadata for an image.

type ImagePartial added in v0.4.0

type ImagePartial struct {
	ID          int                  `db:"id" json:"id"`
	Checksum    *string              `db:"checksum" json:"checksum"`
	Path        *string              `db:"path" json:"path"`
	Title       *sql.NullString      `db:"title" json:"title"`
	Rating      *sql.NullInt64       `db:"rating" json:"rating"`
	Size        *sql.NullInt64       `db:"size" json:"size"`
	Width       *sql.NullInt64       `db:"width" json:"width"`
	Height      *sql.NullInt64       `db:"height" json:"height"`
	StudioID    *sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	FileModTime *NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   *SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   *SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

ImagePartial represents part of a Image object. It is used to update the database entry. Only non-nil fields will be updated.

type ImageQueryBuilder added in v0.4.0

type ImageQueryBuilder struct{}

func NewImageQueryBuilder added in v0.4.0

func NewImageQueryBuilder() ImageQueryBuilder

func (*ImageQueryBuilder) All added in v0.4.0

func (qb *ImageQueryBuilder) All() ([]*Image, error)

func (*ImageQueryBuilder) Count added in v0.4.0

func (qb *ImageQueryBuilder) Count() (int, error)

func (*ImageQueryBuilder) CountByGalleryID added in v0.4.0

func (qb *ImageQueryBuilder) CountByGalleryID(galleryID int) (int, error)

func (*ImageQueryBuilder) CountByPerformerID added in v0.4.0

func (qb *ImageQueryBuilder) CountByPerformerID(performerID int) (int, error)

func (*ImageQueryBuilder) CountByStudioID added in v0.4.0

func (qb *ImageQueryBuilder) CountByStudioID(studioID int) (int, error)

func (*ImageQueryBuilder) CountByTagID added in v0.4.0

func (qb *ImageQueryBuilder) CountByTagID(tagID int) (int, error)

func (*ImageQueryBuilder) Create added in v0.4.0

func (qb *ImageQueryBuilder) Create(newImage Image, tx *sqlx.Tx) (*Image, error)

func (*ImageQueryBuilder) DecrementOCounter added in v0.4.0

func (qb *ImageQueryBuilder) DecrementOCounter(id int, tx *sqlx.Tx) (int, error)

func (*ImageQueryBuilder) Destroy added in v0.4.0

func (qb *ImageQueryBuilder) Destroy(id int, tx *sqlx.Tx) error

func (*ImageQueryBuilder) Find added in v0.4.0

func (qb *ImageQueryBuilder) Find(id int) (*Image, error)

func (*ImageQueryBuilder) FindByChecksum added in v0.4.0

func (qb *ImageQueryBuilder) FindByChecksum(checksum string) (*Image, error)

func (*ImageQueryBuilder) FindByGalleryID added in v0.4.0

func (qb *ImageQueryBuilder) FindByGalleryID(galleryID int) ([]*Image, error)

func (*ImageQueryBuilder) FindByPath added in v0.4.0

func (qb *ImageQueryBuilder) FindByPath(path string) (*Image, error)

func (*ImageQueryBuilder) FindByPerformerID added in v0.4.0

func (qb *ImageQueryBuilder) FindByPerformerID(performerID int) ([]*Image, error)

func (*ImageQueryBuilder) FindByStudioID added in v0.4.0

func (qb *ImageQueryBuilder) FindByStudioID(studioID int) ([]*Image, error)

func (*ImageQueryBuilder) FindMany added in v0.4.0

func (qb *ImageQueryBuilder) FindMany(ids []int) ([]*Image, error)

func (*ImageQueryBuilder) IncrementOCounter added in v0.4.0

func (qb *ImageQueryBuilder) IncrementOCounter(id int, tx *sqlx.Tx) (int, error)

func (*ImageQueryBuilder) Query added in v0.4.0

func (qb *ImageQueryBuilder) Query(imageFilter *ImageFilterType, findFilter *FindFilterType) ([]*Image, int)

func (*ImageQueryBuilder) ResetOCounter added in v0.4.0

func (qb *ImageQueryBuilder) ResetOCounter(id int, tx *sqlx.Tx) (int, error)

func (*ImageQueryBuilder) Size added in v0.4.0

func (qb *ImageQueryBuilder) Size() (uint64, error)

func (*ImageQueryBuilder) Update added in v0.4.0

func (qb *ImageQueryBuilder) Update(updatedImage ImagePartial, tx *sqlx.Tx) (*Image, error)

func (*ImageQueryBuilder) UpdateFileModTime added in v0.4.0

func (qb *ImageQueryBuilder) UpdateFileModTime(id int, modTime NullSQLiteTimestamp, tx *sqlx.Tx) error

func (*ImageQueryBuilder) UpdateFull added in v0.4.0

func (qb *ImageQueryBuilder) UpdateFull(updatedImage Image, tx *sqlx.Tx) (*Image, error)

type ImageReader added in v0.4.0

type ImageReader interface {
	// Find(id int) (*Image, error)
	FindMany(ids []int) ([]*Image, error)
	FindByChecksum(checksum string) (*Image, error)
	FindByGalleryID(galleryID int) ([]*Image, error)
	// FindByPath(path string) (*Image, error)
	// FindByPerformerID(performerID int) ([]*Image, error)
	// CountByPerformerID(performerID int) (int, error)
	// FindByStudioID(studioID int) ([]*Image, error)
	// Count() (int, error)
	// SizeCount() (string, error)
	// CountByStudioID(studioID int) (int, error)
	// CountByTagID(tagID int) (int, error)
	All() ([]*Image, error)
}

type ImageReaderWriter added in v0.4.0

type ImageReaderWriter interface {
	ImageReader
	ImageWriter
}

func NewImageReaderWriter added in v0.4.0

func NewImageReaderWriter(tx *sqlx.Tx) ImageReaderWriter

type ImageWriter added in v0.4.0

type ImageWriter interface {
	Create(newImage Image) (*Image, error)
	Update(updatedImage ImagePartial) (*Image, error)
	UpdateFull(updatedImage Image) (*Image, error)
}

type ImagesTags added in v0.4.0

type ImagesTags struct {
	ImageID int `db:"image_id" json:"image_id"`
	TagID   int `db:"tag_id" json:"tag_id"`
}

type JSONTime

type JSONTime struct {
	time.Time
}

func (JSONTime) GetTime added in v0.4.0

func (jt JSONTime) GetTime() time.Time

func (*JSONTime) MarshalJSON

func (jt *JSONTime) MarshalJSON() ([]byte, error)

func (*JSONTime) UnmarshalJSON

func (jt *JSONTime) UnmarshalJSON(b []byte) error

type JoinReader added in v0.4.0

type JoinReader interface {
	// GetScenePerformers(sceneID int) ([]PerformersScenes, error)
	GetSceneMovies(sceneID int) ([]MoviesScenes, error)
}

type JoinReaderWriter added in v0.4.0

type JoinReaderWriter interface {
	JoinReader
	JoinWriter
}

func NewJoinReaderWriter added in v0.4.0

func NewJoinReaderWriter(tx *sqlx.Tx) JoinReaderWriter

type JoinWriter added in v0.4.0

type JoinWriter interface {
	CreatePerformersScenes(newJoins []PerformersScenes) error
	// AddPerformerScene(sceneID int, performerID int) (bool, error)
	UpdatePerformersScenes(sceneID int, updatedJoins []PerformersScenes) error
	// DestroyPerformersScenes(sceneID int) error
	CreateMoviesScenes(newJoins []MoviesScenes) error
	// AddMoviesScene(sceneID int, movieID int, sceneIdx *int) (bool, error)
	UpdateMoviesScenes(sceneID int, updatedJoins []MoviesScenes) error
	// DestroyMoviesScenes(sceneID int) error
	// CreateScenesTags(newJoins []ScenesTags) error
	UpdateScenesTags(sceneID int, updatedJoins []ScenesTags) error
	// AddSceneTag(sceneID int, tagID int) (bool, error)
	// DestroyScenesTags(sceneID int) error
	// CreateSceneMarkersTags(newJoins []SceneMarkersTags) error
	UpdateSceneMarkersTags(sceneMarkerID int, updatedJoins []SceneMarkersTags) error
	// DestroySceneMarkersTags(sceneMarkerID int, updatedJoins []SceneMarkersTags) error
	// DestroyScenesGalleries(sceneID int) error
	// DestroyScenesMarkers(sceneID int) error
	UpdatePerformersGalleries(galleryID int, updatedJoins []PerformersGalleries) error
	UpdateGalleriesTags(galleryID int, updatedJoins []GalleriesTags) error
	UpdateGalleriesImages(imageID int, updatedJoins []GalleriesImages) error
	UpdatePerformersImages(imageID int, updatedJoins []PerformersImages) error
	UpdateImagesTags(imageID int, updatedJoins []ImagesTags) error
}

type JoinsQueryBuilder

type JoinsQueryBuilder struct{}

func NewJoinsQueryBuilder

func NewJoinsQueryBuilder() JoinsQueryBuilder

func (*JoinsQueryBuilder) AddGalleryTag added in v0.4.0

func (qb *JoinsQueryBuilder) AddGalleryTag(galleryID int, tagID int, tx *sqlx.Tx) (bool, error)

AddGalleryTag adds a tag to a gallery. It does not make any change if the tag already exists on the gallery. It returns true if gallery tag was added.

func (*JoinsQueryBuilder) AddImageGallery added in v0.4.0

func (qb *JoinsQueryBuilder) AddImageGallery(imageID int, galleryID int, tx *sqlx.Tx) (bool, error)

AddGalleryImage adds a gallery to an image. It does not make any change if the tag already exists on the image. It returns true if image tag was added.

func (*JoinsQueryBuilder) AddImageTag added in v0.4.0

func (qb *JoinsQueryBuilder) AddImageTag(imageID int, tagID int, tx *sqlx.Tx) (bool, error)

AddImageTag adds a tag to a image. It does not make any change if the tag already exists on the image. It returns true if image tag was added.

func (*JoinsQueryBuilder) AddMoviesScene added in v0.2.0

func (qb *JoinsQueryBuilder) AddMoviesScene(sceneID int, movieID int, sceneIdx *int, tx *sqlx.Tx) (bool, error)

func (*JoinsQueryBuilder) AddPerformerGallery added in v0.4.0

func (qb *JoinsQueryBuilder) AddPerformerGallery(galleryID int, performerID int, tx *sqlx.Tx) (bool, error)

AddPerformerGallery adds a performer to a gallery. It does not make any change if the performer already exists on the gallery. It returns true if gallery performer was added.

func (*JoinsQueryBuilder) AddPerformerImage added in v0.4.0

func (qb *JoinsQueryBuilder) AddPerformerImage(imageID int, performerID int, tx *sqlx.Tx) (bool, error)

AddPerformerImage adds a performer to a image. It does not make any change if the performer already exists on the image. It returns true if image performer was added.

func (*JoinsQueryBuilder) AddPerformerScene

func (qb *JoinsQueryBuilder) AddPerformerScene(sceneID int, performerID int, tx *sqlx.Tx) (bool, error)

AddPerformerScene adds a performer to a scene. It does not make any change if the performer already exists on the scene. It returns true if scene performer was added.

func (*JoinsQueryBuilder) AddSceneTag

func (qb *JoinsQueryBuilder) AddSceneTag(sceneID int, tagID int, tx *sqlx.Tx) (bool, error)

AddSceneTag adds a tag to a scene. It does not make any change if the tag already exists on the scene. It returns true if scene tag was added.

func (*JoinsQueryBuilder) CreateGalleriesImages added in v0.4.0

func (qb *JoinsQueryBuilder) CreateGalleriesImages(newJoins []GalleriesImages, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateGalleriesTags added in v0.4.0

func (qb *JoinsQueryBuilder) CreateGalleriesTags(newJoins []GalleriesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateImagesTags added in v0.4.0

func (qb *JoinsQueryBuilder) CreateImagesTags(newJoins []ImagesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateMoviesScenes added in v0.2.0

func (qb *JoinsQueryBuilder) CreateMoviesScenes(newJoins []MoviesScenes, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreatePerformersGalleries added in v0.4.0

func (qb *JoinsQueryBuilder) CreatePerformersGalleries(newJoins []PerformersGalleries, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreatePerformersImages added in v0.4.0

func (qb *JoinsQueryBuilder) CreatePerformersImages(newJoins []PerformersImages, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreatePerformersScenes

func (qb *JoinsQueryBuilder) CreatePerformersScenes(newJoins []PerformersScenes, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateSceneMarkersTags

func (qb *JoinsQueryBuilder) CreateSceneMarkersTags(newJoins []SceneMarkersTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateScenesTags

func (qb *JoinsQueryBuilder) CreateScenesTags(newJoins []ScenesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) CreateStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) CreateStashIDs(entityName string, entityID int, newJoins []StashID, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyGalleriesTags added in v0.4.0

func (qb *JoinsQueryBuilder) DestroyGalleriesTags(galleryID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyImageGalleries added in v0.4.0

func (qb *JoinsQueryBuilder) DestroyImageGalleries(imageID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyImagesTags added in v0.4.0

func (qb *JoinsQueryBuilder) DestroyImagesTags(imageID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyMoviesScenes added in v0.2.0

func (qb *JoinsQueryBuilder) DestroyMoviesScenes(sceneID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyPerformersGalleries added in v0.4.0

func (qb *JoinsQueryBuilder) DestroyPerformersGalleries(galleryID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyPerformersImages added in v0.4.0

func (qb *JoinsQueryBuilder) DestroyPerformersImages(imageID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyPerformersScenes

func (qb *JoinsQueryBuilder) DestroyPerformersScenes(sceneID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroySceneMarkersTags

func (qb *JoinsQueryBuilder) DestroySceneMarkersTags(sceneMarkerID int, updatedJoins []SceneMarkersTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyScenesGalleries

func (qb *JoinsQueryBuilder) DestroyScenesGalleries(sceneID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyScenesMarkers

func (qb *JoinsQueryBuilder) DestroyScenesMarkers(sceneID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) DestroyScenesTags

func (qb *JoinsQueryBuilder) DestroyScenesTags(sceneID int, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) GetGalleryPerformers added in v0.4.0

func (qb *JoinsQueryBuilder) GetGalleryPerformers(galleryID int, tx *sqlx.Tx) ([]PerformersGalleries, error)

func (*JoinsQueryBuilder) GetGalleryTags added in v0.4.0

func (qb *JoinsQueryBuilder) GetGalleryTags(galleryID int, tx *sqlx.Tx) ([]GalleriesTags, error)

func (*JoinsQueryBuilder) GetImageGalleries added in v0.4.0

func (qb *JoinsQueryBuilder) GetImageGalleries(imageID int, tx *sqlx.Tx) ([]GalleriesImages, error)

func (*JoinsQueryBuilder) GetImagePerformers added in v0.4.0

func (qb *JoinsQueryBuilder) GetImagePerformers(imageID int, tx *sqlx.Tx) ([]PerformersImages, error)

func (*JoinsQueryBuilder) GetImageTags added in v0.4.0

func (qb *JoinsQueryBuilder) GetImageTags(imageID int, tx *sqlx.Tx) ([]ImagesTags, error)

func (*JoinsQueryBuilder) GetPerformerStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) GetPerformerStashIDs(performerID int) ([]*StashID, error)

func (*JoinsQueryBuilder) GetSceneMovies added in v0.2.0

func (qb *JoinsQueryBuilder) GetSceneMovies(sceneID int, tx *sqlx.Tx) ([]MoviesScenes, error)

func (*JoinsQueryBuilder) GetScenePerformers

func (qb *JoinsQueryBuilder) GetScenePerformers(sceneID int, tx *sqlx.Tx) ([]PerformersScenes, error)

func (*JoinsQueryBuilder) GetSceneStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) GetSceneStashIDs(sceneID int) ([]*StashID, error)

func (*JoinsQueryBuilder) GetSceneTags

func (qb *JoinsQueryBuilder) GetSceneTags(sceneID int, tx *sqlx.Tx) ([]ScenesTags, error)

func (*JoinsQueryBuilder) GetStudioStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) GetStudioStashIDs(studioID int) ([]*StashID, error)

func (*JoinsQueryBuilder) RemoveImageGallery added in v0.4.0

func (qb *JoinsQueryBuilder) RemoveImageGallery(imageID int, galleryID int, tx *sqlx.Tx) (bool, error)

RemoveImageGallery removes a gallery from an image. Returns true if the join was removed.

func (*JoinsQueryBuilder) UpdateGalleriesImages added in v0.4.0

func (qb *JoinsQueryBuilder) UpdateGalleriesImages(imageID int, updatedJoins []GalleriesImages, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateGalleriesTags added in v0.4.0

func (qb *JoinsQueryBuilder) UpdateGalleriesTags(galleryID int, updatedJoins []GalleriesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateImagesTags added in v0.4.0

func (qb *JoinsQueryBuilder) UpdateImagesTags(imageID int, updatedJoins []ImagesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateMoviesScenes added in v0.2.0

func (qb *JoinsQueryBuilder) UpdateMoviesScenes(sceneID int, updatedJoins []MoviesScenes, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdatePerformerStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) UpdatePerformerStashIDs(performerID int, updatedJoins []StashID, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdatePerformersGalleries added in v0.4.0

func (qb *JoinsQueryBuilder) UpdatePerformersGalleries(galleryID int, updatedJoins []PerformersGalleries, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdatePerformersImages added in v0.4.0

func (qb *JoinsQueryBuilder) UpdatePerformersImages(imageID int, updatedJoins []PerformersImages, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdatePerformersScenes

func (qb *JoinsQueryBuilder) UpdatePerformersScenes(sceneID int, updatedJoins []PerformersScenes, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateSceneMarkersTags

func (qb *JoinsQueryBuilder) UpdateSceneMarkersTags(sceneMarkerID int, updatedJoins []SceneMarkersTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateSceneStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) UpdateSceneStashIDs(sceneID int, updatedJoins []StashID, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateScenesTags

func (qb *JoinsQueryBuilder) UpdateScenesTags(sceneID int, updatedJoins []ScenesTags, tx *sqlx.Tx) error

func (*JoinsQueryBuilder) UpdateStudioStashIDs added in v0.4.0

func (qb *JoinsQueryBuilder) UpdateStudioStashIDs(studioID int, updatedJoins []StashID, tx *sqlx.Tx) error

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

func NewMovie added in v0.4.0

func NewMovie(name string) *Movie

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

type MovieQueryBuilder struct{}

func NewMovieQueryBuilder added in v0.2.0

func NewMovieQueryBuilder() MovieQueryBuilder

func (*MovieQueryBuilder) All added in v0.2.0

func (qb *MovieQueryBuilder) All() ([]*Movie, error)

func (*MovieQueryBuilder) AllSlim added in v0.2.0

func (qb *MovieQueryBuilder) AllSlim() ([]*Movie, error)

func (*MovieQueryBuilder) Count added in v0.2.0

func (qb *MovieQueryBuilder) Count() (int, error)

func (*MovieQueryBuilder) Create added in v0.2.0

func (qb *MovieQueryBuilder) Create(newMovie Movie, tx *sqlx.Tx) (*Movie, error)

func (*MovieQueryBuilder) Destroy added in v0.2.0

func (qb *MovieQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*MovieQueryBuilder) DestroyMovieImages added in v0.3.0

func (qb *MovieQueryBuilder) DestroyMovieImages(movieID int, tx *sqlx.Tx) error

func (*MovieQueryBuilder) Find added in v0.2.0

func (qb *MovieQueryBuilder) Find(id int, tx *sqlx.Tx) (*Movie, error)

func (*MovieQueryBuilder) FindByName added in v0.2.0

func (qb *MovieQueryBuilder) FindByName(name string, tx *sqlx.Tx, nocase bool) (*Movie, error)

func (*MovieQueryBuilder) FindByNames added in v0.2.0

func (qb *MovieQueryBuilder) FindByNames(names []string, tx *sqlx.Tx, nocase bool) ([]*Movie, error)

func (*MovieQueryBuilder) FindBySceneID added in v0.2.0

func (qb *MovieQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) ([]*Movie, error)

func (*MovieQueryBuilder) FindMany added in v0.4.0

func (qb *MovieQueryBuilder) FindMany(ids []int) ([]*Movie, error)

func (*MovieQueryBuilder) GetBackImage added in v0.3.0

func (qb *MovieQueryBuilder) GetBackImage(movieID int, tx *sqlx.Tx) ([]byte, error)

func (*MovieQueryBuilder) GetFrontImage added in v0.3.0

func (qb *MovieQueryBuilder) GetFrontImage(movieID int, tx *sqlx.Tx) ([]byte, error)

func (*MovieQueryBuilder) Query added in v0.2.0

func (qb *MovieQueryBuilder) Query(movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int)

func (*MovieQueryBuilder) Update added in v0.2.0

func (qb *MovieQueryBuilder) Update(updatedMovie MoviePartial, tx *sqlx.Tx) (*Movie, error)

func (*MovieQueryBuilder) UpdateFull added in v0.4.0

func (qb *MovieQueryBuilder) UpdateFull(updatedMovie Movie, tx *sqlx.Tx) (*Movie, error)

func (*MovieQueryBuilder) UpdateMovieImages added in v0.3.0

func (qb *MovieQueryBuilder) UpdateMovieImages(movieID int, frontImage []byte, backImage []byte, tx *sqlx.Tx) error

type MovieReader added in v0.4.0

type MovieReader interface {
	Find(id int) (*Movie, error)
	FindMany(ids []int) ([]*Movie, error)
	// FindBySceneID(sceneID int) ([]*Movie, error)
	FindByName(name string, nocase bool) (*Movie, error)
	FindByNames(names []string, nocase bool) ([]*Movie, error)
	All() ([]*Movie, error)
	// AllSlim() ([]*Movie, error)
	// Query(movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int)
	GetFrontImage(movieID int) ([]byte, error)
	GetBackImage(movieID int) ([]byte, error)
}

type MovieReaderWriter added in v0.4.0

type MovieReaderWriter interface {
	MovieReader
	MovieWriter
}

func NewMovieReaderWriter added in v0.4.0

func NewMovieReaderWriter(tx *sqlx.Tx) MovieReaderWriter

type MovieWriter added in v0.4.0

type MovieWriter interface {
	Create(newMovie Movie) (*Movie, error)
	Update(updatedMovie MoviePartial) (*Movie, error)
	UpdateFull(updatedMovie Movie) (*Movie, error)
	// Destroy(id string) error
	UpdateMovieImages(movieID int, frontImage []byte, backImage []byte) error
}

type MoviesScenes added in v0.2.0

type MoviesScenes struct {
	MovieID    int           `db:"movie_id" json:"movie_id"`
	SceneID    int           `db:"scene_id" json:"scene_id"`
	SceneIndex sql.NullInt64 `db:"scene_index" json:"scene_index"`
}

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 Performer

type Performer struct {
	ID           int             `db:"id" json:"id"`
	Checksum     string          `db:"checksum" json:"checksum"`
	Name         sql.NullString  `db:"name" json:"name"`
	Gender       sql.NullString  `db:"gender" json:"gender"`
	URL          sql.NullString  `db:"url" json:"url"`
	Twitter      sql.NullString  `db:"twitter" json:"twitter"`
	Instagram    sql.NullString  `db:"instagram" json:"instagram"`
	Birthdate    SQLiteDate      `db:"birthdate" json:"birthdate"`
	Ethnicity    sql.NullString  `db:"ethnicity" json:"ethnicity"`
	Country      sql.NullString  `db:"country" json:"country"`
	EyeColor     sql.NullString  `db:"eye_color" json:"eye_color"`
	Height       sql.NullString  `db:"height" json:"height"`
	Measurements sql.NullString  `db:"measurements" json:"measurements"`
	FakeTits     sql.NullString  `db:"fake_tits" json:"fake_tits"`
	CareerLength sql.NullString  `db:"career_length" json:"career_length"`
	Tattoos      sql.NullString  `db:"tattoos" json:"tattoos"`
	Piercings    sql.NullString  `db:"piercings" json:"piercings"`
	Aliases      sql.NullString  `db:"aliases" json:"aliases"`
	Favorite     sql.NullBool    `db:"favorite" json:"favorite"`
	CreatedAt    SQLiteTimestamp `db:"created_at" json:"created_at"`
	UpdatedAt    SQLiteTimestamp `db:"updated_at" json:"updated_at"`
}

func NewPerformer added in v0.4.0

func NewPerformer(name string) *Performer

type PerformerQueryBuilder

type PerformerQueryBuilder struct{}

func NewPerformerQueryBuilder

func NewPerformerQueryBuilder() PerformerQueryBuilder

func (*PerformerQueryBuilder) All

func (qb *PerformerQueryBuilder) All() ([]*Performer, error)

func (*PerformerQueryBuilder) AllSlim added in v0.2.0

func (qb *PerformerQueryBuilder) AllSlim() ([]*Performer, error)

func (*PerformerQueryBuilder) Count

func (qb *PerformerQueryBuilder) Count() (int, error)

func (*PerformerQueryBuilder) Create

func (qb *PerformerQueryBuilder) Create(newPerformer Performer, tx *sqlx.Tx) (*Performer, error)

func (*PerformerQueryBuilder) Destroy

func (qb *PerformerQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*PerformerQueryBuilder) DestroyPerformerImage added in v0.3.0

func (qb *PerformerQueryBuilder) DestroyPerformerImage(performerID int, tx *sqlx.Tx) error

func (*PerformerQueryBuilder) Find

func (qb *PerformerQueryBuilder) Find(id int) (*Performer, error)

func (*PerformerQueryBuilder) FindByGalleryID added in v0.4.0

func (qb *PerformerQueryBuilder) FindByGalleryID(galleryID int, tx *sqlx.Tx) ([]*Performer, error)

func (*PerformerQueryBuilder) FindByImageID added in v0.4.0

func (qb *PerformerQueryBuilder) FindByImageID(imageID int, tx *sqlx.Tx) ([]*Performer, error)

func (*PerformerQueryBuilder) FindByNames

func (qb *PerformerQueryBuilder) FindByNames(names []string, tx *sqlx.Tx, nocase bool) ([]*Performer, error)

func (*PerformerQueryBuilder) FindBySceneID

func (qb *PerformerQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) ([]*Performer, error)

func (*PerformerQueryBuilder) FindMany added in v0.4.0

func (qb *PerformerQueryBuilder) FindMany(ids []int) ([]*Performer, error)

func (*PerformerQueryBuilder) FindNameBySceneID added in v0.2.0

func (qb *PerformerQueryBuilder) FindNameBySceneID(sceneID int, tx *sqlx.Tx) ([]*Performer, error)

func (*PerformerQueryBuilder) GetPerformerImage added in v0.3.0

func (qb *PerformerQueryBuilder) GetPerformerImage(performerID int, tx *sqlx.Tx) ([]byte, error)

func (*PerformerQueryBuilder) Query

func (qb *PerformerQueryBuilder) Query(performerFilter *PerformerFilterType, findFilter *FindFilterType) ([]*Performer, int)

func (*PerformerQueryBuilder) Update

func (qb *PerformerQueryBuilder) Update(updatedPerformer Performer, tx *sqlx.Tx) (*Performer, error)

func (*PerformerQueryBuilder) UpdatePerformerImage added in v0.3.0

func (qb *PerformerQueryBuilder) UpdatePerformerImage(performerID int, image []byte, tx *sqlx.Tx) error

type PerformerReader added in v0.4.0

type PerformerReader interface {
	// Find(id int) (*Performer, error)
	FindMany(ids []int) ([]*Performer, error)
	FindBySceneID(sceneID int) ([]*Performer, error)
	FindNamesBySceneID(sceneID int) ([]*Performer, error)
	FindByImageID(imageID int) ([]*Performer, error)
	FindByGalleryID(galleryID int) ([]*Performer, error)
	FindByNames(names []string, nocase bool) ([]*Performer, error)
	// Count() (int, error)
	All() ([]*Performer, error)
	// AllSlim() ([]*Performer, error)
	// Query(performerFilter *PerformerFilterType, findFilter *FindFilterType) ([]*Performer, int)
	GetPerformerImage(performerID int) ([]byte, error)
}

type PerformerReaderWriter added in v0.4.0

type PerformerReaderWriter interface {
	PerformerReader
	PerformerWriter
}

func NewPerformerReaderWriter added in v0.4.0

func NewPerformerReaderWriter(tx *sqlx.Tx) PerformerReaderWriter

type PerformerWriter added in v0.4.0

type PerformerWriter interface {
	Create(newPerformer Performer) (*Performer, error)
	Update(updatedPerformer Performer) (*Performer, error)
	// Destroy(id string) error
	UpdatePerformerImage(performerID int, image []byte) error
}

type PerformersGalleries added in v0.4.0

type PerformersGalleries struct {
	PerformerID int `db:"performer_id" json:"performer_id"`
	GalleryID   int `db:"gallery_id" json:"gallery_id"`
}

type PerformersImages added in v0.4.0

type PerformersImages struct {
	PerformerID int `db:"performer_id" json:"performer_id"`
	ImageID     int `db:"image_id" json:"image_id"`
}

type PerformersScenes

type PerformersScenes struct {
	PerformerID int `db:"performer_id" json:"performer_id"`
	SceneID     int `db:"scene_id" json:"scene_id"`
}

type SQLiteDate

type SQLiteDate struct {
	String string
	Valid  bool
}

func (*SQLiteDate) Scan

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

Scan implements the Scanner interface.

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 Scene

type Scene struct {
	ID          int                 `db:"id" json:"id"`
	Checksum    sql.NullString      `db:"checksum" json:"checksum"`
	OSHash      sql.NullString      `db:"oshash" json:"oshash"`
	Path        string              `db:"path" json:"path"`
	Title       sql.NullString      `db:"title" json:"title"`
	Details     sql.NullString      `db:"details" json:"details"`
	URL         sql.NullString      `db:"url" json:"url"`
	Date        SQLiteDate          `db:"date" json:"date"`
	Rating      sql.NullInt64       `db:"rating" json:"rating"`
	OCounter    int                 `db:"o_counter" json:"o_counter"`
	Size        sql.NullString      `db:"size" json:"size"`
	Duration    sql.NullFloat64     `db:"duration" json:"duration"`
	VideoCodec  sql.NullString      `db:"video_codec" json:"video_codec"`
	Format      sql.NullString      `db:"format" json:"format_name"`
	AudioCodec  sql.NullString      `db:"audio_codec" json:"audio_codec"`
	Width       sql.NullInt64       `db:"width" json:"width"`
	Height      sql.NullInt64       `db:"height" json:"height"`
	Framerate   sql.NullFloat64     `db:"framerate" json:"framerate"`
	Bitrate     sql.NullInt64       `db:"bitrate" json:"bitrate"`
	StudioID    sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	FileModTime NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

Scene stores the metadata for a single video scene.

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.

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 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 SceneMarkerQueryBuilder

type SceneMarkerQueryBuilder struct{}

func NewSceneMarkerQueryBuilder

func NewSceneMarkerQueryBuilder() SceneMarkerQueryBuilder

func (*SceneMarkerQueryBuilder) CountByTagID

func (qb *SceneMarkerQueryBuilder) CountByTagID(tagID int) (int, error)

func (*SceneMarkerQueryBuilder) Create

func (qb *SceneMarkerQueryBuilder) Create(newSceneMarker SceneMarker, tx *sqlx.Tx) (*SceneMarker, error)

func (*SceneMarkerQueryBuilder) Destroy

func (qb *SceneMarkerQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*SceneMarkerQueryBuilder) Find

func (qb *SceneMarkerQueryBuilder) Find(id int) (*SceneMarker, error)

func (*SceneMarkerQueryBuilder) FindBySceneID

func (qb *SceneMarkerQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) ([]*SceneMarker, error)

func (*SceneMarkerQueryBuilder) FindMany added in v0.3.0

func (qb *SceneMarkerQueryBuilder) FindMany(ids []int) ([]*SceneMarker, error)

func (*SceneMarkerQueryBuilder) GetMarkerStrings

func (qb *SceneMarkerQueryBuilder) GetMarkerStrings(q *string, sort *string) ([]*MarkerStringsResultType, error)

func (*SceneMarkerQueryBuilder) Query

func (qb *SceneMarkerQueryBuilder) Query(sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) ([]*SceneMarker, int)

func (*SceneMarkerQueryBuilder) Update

func (qb *SceneMarkerQueryBuilder) Update(updatedSceneMarker SceneMarker, tx *sqlx.Tx) (*SceneMarker, error)

func (*SceneMarkerQueryBuilder) Wall

func (qb *SceneMarkerQueryBuilder) Wall(q *string) ([]*SceneMarker, error)

type SceneMarkerReader added in v0.4.0

type SceneMarkerReader interface {
	// Find(id int) (*SceneMarker, error)
	// FindMany(ids []int) ([]*SceneMarker, error)
	FindBySceneID(sceneID int) ([]*SceneMarker, error)
}

type SceneMarkerReaderWriter added in v0.4.0

type SceneMarkerReaderWriter interface {
	SceneMarkerReader
	SceneMarkerWriter
}

func NewSceneMarkerReaderWriter added in v0.4.0

func NewSceneMarkerReaderWriter(tx *sqlx.Tx) SceneMarkerReaderWriter

type SceneMarkerWriter added in v0.4.0

type SceneMarkerWriter interface {
	Create(newSceneMarker SceneMarker) (*SceneMarker, error)
	Update(updatedSceneMarker SceneMarker) (*SceneMarker, error)
}

type SceneMarkersTags

type SceneMarkersTags struct {
	SceneMarkerID int `db:"scene_marker_id" json:"scene_marker_id"`
	TagID         int `db:"tag_id" json:"tag_id"`
}

type ScenePartial

type ScenePartial struct {
	ID          int                  `db:"id" json:"id"`
	Checksum    *sql.NullString      `db:"checksum" json:"checksum"`
	OSHash      *sql.NullString      `db:"oshash" json:"oshash"`
	Path        *string              `db:"path" json:"path"`
	Title       *sql.NullString      `db:"title" json:"title"`
	Details     *sql.NullString      `db:"details" json:"details"`
	URL         *sql.NullString      `db:"url" json:"url"`
	Date        *SQLiteDate          `db:"date" json:"date"`
	Rating      *sql.NullInt64       `db:"rating" json:"rating"`
	Size        *sql.NullString      `db:"size" json:"size"`
	Duration    *sql.NullFloat64     `db:"duration" json:"duration"`
	VideoCodec  *sql.NullString      `db:"video_codec" json:"video_codec"`
	Format      *sql.NullString      `db:"format" json:"format_name"`
	AudioCodec  *sql.NullString      `db:"audio_codec" json:"audio_codec"`
	Width       *sql.NullInt64       `db:"width" json:"width"`
	Height      *sql.NullInt64       `db:"height" json:"height"`
	Framerate   *sql.NullFloat64     `db:"framerate" json:"framerate"`
	Bitrate     *sql.NullInt64       `db:"bitrate" json:"bitrate"`
	StudioID    *sql.NullInt64       `db:"studio_id,omitempty" json:"studio_id"`
	MovieID     *sql.NullInt64       `db:"movie_id,omitempty" json:"movie_id"`
	FileModTime *NullSQLiteTimestamp `db:"file_mod_time" json:"file_mod_time"`
	CreatedAt   *SQLiteTimestamp     `db:"created_at" json:"created_at"`
	UpdatedAt   *SQLiteTimestamp     `db:"updated_at" json:"updated_at"`
}

ScenePartial represents part of a Scene object. It is used to update the database entry. Only non-nil fields will be updated.

type SceneQueryBuilder

type SceneQueryBuilder struct{}

func NewSceneQueryBuilder

func NewSceneQueryBuilder() SceneQueryBuilder

func (*SceneQueryBuilder) All

func (qb *SceneQueryBuilder) All() ([]*Scene, error)

func (*SceneQueryBuilder) Count

func (qb *SceneQueryBuilder) Count() (int, error)

func (*SceneQueryBuilder) CountByMovieID added in v0.2.0

func (qb *SceneQueryBuilder) CountByMovieID(movieID int) (int, error)

func (*SceneQueryBuilder) CountByPerformerID

func (qb *SceneQueryBuilder) CountByPerformerID(performerID int) (int, error)

func (*SceneQueryBuilder) CountByStudioID

func (qb *SceneQueryBuilder) CountByStudioID(studioID int) (int, error)

func (*SceneQueryBuilder) CountByTagID

func (qb *SceneQueryBuilder) CountByTagID(tagID int) (int, error)

func (*SceneQueryBuilder) CountMissingChecksum added in v0.3.0

func (qb *SceneQueryBuilder) CountMissingChecksum() (int, error)

CountMissingChecksum returns the number of scenes missing a checksum value.

func (*SceneQueryBuilder) CountMissingOSHash added in v0.3.0

func (qb *SceneQueryBuilder) CountMissingOSHash() (int, error)

CountMissingOSHash returns the number of scenes missing an oshash value.

func (*SceneQueryBuilder) Create

func (qb *SceneQueryBuilder) Create(newScene Scene, tx *sqlx.Tx) (*Scene, error)

func (*SceneQueryBuilder) DecrementOCounter

func (qb *SceneQueryBuilder) DecrementOCounter(id int, tx *sqlx.Tx) (int, error)

func (*SceneQueryBuilder) Destroy

func (qb *SceneQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*SceneQueryBuilder) DestroySceneCover added in v0.3.0

func (qb *SceneQueryBuilder) DestroySceneCover(sceneID int, tx *sqlx.Tx) error

func (*SceneQueryBuilder) Find

func (qb *SceneQueryBuilder) Find(id int) (*Scene, error)

func (*SceneQueryBuilder) FindByChecksum

func (qb *SceneQueryBuilder) FindByChecksum(checksum string) (*Scene, error)

func (*SceneQueryBuilder) FindByMovieID added in v0.2.0

func (qb *SceneQueryBuilder) FindByMovieID(movieID int) ([]*Scene, error)

func (*SceneQueryBuilder) FindByOSHash added in v0.3.0

func (qb *SceneQueryBuilder) FindByOSHash(oshash string) (*Scene, error)

func (*SceneQueryBuilder) FindByPath

func (qb *SceneQueryBuilder) FindByPath(path string) (*Scene, error)

func (*SceneQueryBuilder) FindByPerformerID

func (qb *SceneQueryBuilder) FindByPerformerID(performerID int) ([]*Scene, error)

func (*SceneQueryBuilder) FindByStudioID

func (qb *SceneQueryBuilder) FindByStudioID(studioID int) ([]*Scene, error)

func (*SceneQueryBuilder) FindMany added in v0.3.0

func (qb *SceneQueryBuilder) FindMany(ids []int) ([]*Scene, error)

func (*SceneQueryBuilder) GetSceneCover added in v0.3.0

func (qb *SceneQueryBuilder) GetSceneCover(sceneID int, tx *sqlx.Tx) ([]byte, error)

func (*SceneQueryBuilder) IncrementOCounter

func (qb *SceneQueryBuilder) IncrementOCounter(id int, tx *sqlx.Tx) (int, error)

func (*SceneQueryBuilder) Query

func (qb *SceneQueryBuilder) Query(sceneFilter *SceneFilterType, findFilter *FindFilterType) ([]*Scene, int)

func (*SceneQueryBuilder) QueryAllByPathRegex

func (qb *SceneQueryBuilder) QueryAllByPathRegex(regex string) ([]*Scene, error)

func (*SceneQueryBuilder) QueryByPathRegex

func (qb *SceneQueryBuilder) QueryByPathRegex(findFilter *FindFilterType) ([]*Scene, int)

func (*SceneQueryBuilder) ResetOCounter

func (qb *SceneQueryBuilder) ResetOCounter(id int, tx *sqlx.Tx) (int, error)

func (*SceneQueryBuilder) Size added in v0.4.0

func (qb *SceneQueryBuilder) Size() (uint64, error)

func (*SceneQueryBuilder) Update

func (qb *SceneQueryBuilder) Update(updatedScene ScenePartial, tx *sqlx.Tx) (*Scene, error)

func (*SceneQueryBuilder) UpdateChecksum added in v0.3.0

func (qb *SceneQueryBuilder) UpdateChecksum(id int, checksum string, tx *sqlx.Tx) error

func (*SceneQueryBuilder) UpdateFileModTime added in v0.4.0

func (qb *SceneQueryBuilder) UpdateFileModTime(id int, modTime NullSQLiteTimestamp, tx *sqlx.Tx) error

func (*SceneQueryBuilder) UpdateFormat added in v0.2.0

func (qb *SceneQueryBuilder) UpdateFormat(id int, format string, tx *sqlx.Tx) error

func (*SceneQueryBuilder) UpdateFull added in v0.4.0

func (qb *SceneQueryBuilder) UpdateFull(updatedScene Scene, tx *sqlx.Tx) (*Scene, error)

func (*SceneQueryBuilder) UpdateOSHash added in v0.3.0

func (qb *SceneQueryBuilder) UpdateOSHash(id int, oshash string, tx *sqlx.Tx) error

func (*SceneQueryBuilder) UpdateSceneCover added in v0.3.0

func (qb *SceneQueryBuilder) UpdateSceneCover(sceneID int, cover []byte, tx *sqlx.Tx) error

func (*SceneQueryBuilder) Wall

func (qb *SceneQueryBuilder) Wall(q *string) ([]*Scene, error)

type SceneReader added in v0.4.0

type SceneReader interface {
	// Find(id int) (*Scene, error)
	FindMany(ids []int) ([]*Scene, error)
	FindByChecksum(checksum string) (*Scene, error)
	FindByOSHash(oshash string) (*Scene, error)
	// FindByPath(path string) (*Scene, error)
	// FindByPerformerID(performerID int) ([]*Scene, error)
	// CountByPerformerID(performerID int) (int, error)
	// FindByStudioID(studioID int) ([]*Scene, error)
	FindByMovieID(movieID int) ([]*Scene, error)
	// CountByMovieID(movieID int) (int, error)
	// Count() (int, error)
	// SizeCount() (string, error)
	// CountByStudioID(studioID int) (int, error)
	// CountByTagID(tagID int) (int, error)
	// CountMissingChecksum() (int, error)
	// CountMissingOSHash() (int, error)
	// Wall(q *string) ([]*Scene, error)
	All() ([]*Scene, error)
	// Query(sceneFilter *SceneFilterType, findFilter *FindFilterType) ([]*Scene, int)
	// QueryAllByPathRegex(regex string) ([]*Scene, error)
	// QueryByPathRegex(findFilter *FindFilterType) ([]*Scene, int)
	GetSceneCover(sceneID int) ([]byte, error)
}

type SceneReaderWriter added in v0.4.0

type SceneReaderWriter interface {
	SceneReader
	SceneWriter
}

func NewSceneReaderWriter added in v0.4.0

func NewSceneReaderWriter(tx *sqlx.Tx) SceneReaderWriter

type SceneWriter added in v0.4.0

type SceneWriter interface {
	Create(newScene Scene) (*Scene, error)
	Update(updatedScene ScenePartial) (*Scene, error)
	UpdateFull(updatedScene Scene) (*Scene, error)
	// IncrementOCounter(id int) (int, error)
	// DecrementOCounter(id int) (int, error)
	// ResetOCounter(id int) (int, error)
	// Destroy(id string) error
	// UpdateFormat(id int, format string) error
	// UpdateOSHash(id int, oshash string) error
	// UpdateChecksum(id int, checksum string) error
	UpdateSceneCover(sceneID int, cover []byte) error
}

type ScenesTags

type ScenesTags struct {
	SceneID int `db:"scene_id" json:"scene_id"`
	TagID   int `db:"tag_id" json:"tag_id"`
}

type ScrapedGalleryStash added in v0.4.0

type ScrapedGalleryStash struct {
	ID         string                   `graphql:"id" json:"id"`
	Title      *string                  `graphql:"title" json:"title"`
	Details    *string                  `graphql:"details" json:"details"`
	URL        *string                  `graphql:"url" json:"url"`
	Date       *string                  `graphql:"date" json:"date"`
	File       *SceneFileType           `graphql:"file" json:"file"`
	Studio     *ScrapedSceneStudio      `graphql:"studio" json:"studio"`
	Tags       []*ScrapedSceneTag       `graphql:"tags" json:"tags"`
	Performers []*ScrapedScenePerformer `graphql:"performers" json:"performers"`
}

type ScrapedItem

type ScrapedItem struct {
	ID              int             `db:"id" json:"id"`
	Title           sql.NullString  `db:"title" json:"title"`
	Description     sql.NullString  `db:"description" json:"description"`
	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 ScrapedItemQueryBuilder

type ScrapedItemQueryBuilder struct{}

func NewScrapedItemQueryBuilder

func NewScrapedItemQueryBuilder() ScrapedItemQueryBuilder

func (*ScrapedItemQueryBuilder) All

func (qb *ScrapedItemQueryBuilder) All() ([]*ScrapedItem, error)

func (*ScrapedItemQueryBuilder) Create

func (qb *ScrapedItemQueryBuilder) Create(newScrapedItem ScrapedItem, tx *sqlx.Tx) (*ScrapedItem, error)

func (*ScrapedItemQueryBuilder) Find

func (qb *ScrapedItemQueryBuilder) Find(id int) (*ScrapedItem, error)

func (*ScrapedItemQueryBuilder) Update

func (qb *ScrapedItemQueryBuilder) Update(updatedScrapedItem ScrapedItem, tx *sqlx.Tx) (*ScrapedItem, error)

type ScrapedMovie added in v0.3.0

type ScrapedMovie struct {
	Name       *string             `graphql:"name" json:"name"`
	Aliases    *string             `graphql:"aliases" json:"aliases"`
	Duration   *string             `graphql:"duration" json:"duration"`
	Date       *string             `graphql:"date" json:"date"`
	Rating     *string             `graphql:"rating" json:"rating"`
	Director   *string             `graphql:"director" json:"director"`
	Studio     *ScrapedMovieStudio `graphql:"studio" json:"studio"`
	Synopsis   *string             `graphql:"synopsis" json:"synopsis"`
	URL        *string             `graphql:"url" json:"url"`
	FrontImage *string             `graphql:"front_image" json:"front_image"`
	BackImage  *string             `graphql:"back_image" json:"back_image"`
}

type ScrapedMovieStudio added in v0.3.0

type ScrapedMovieStudio struct {
	// Set if studio matched
	ID   *string `graphql:"id" json:"id"`
	Name string  `graphql:"name" json:"name"`
	URL  *string `graphql:"url" json:"url"`
}

type ScrapedPerformer

type ScrapedPerformer struct {
	Name         *string `graphql:"name" json:"name"`
	Gender       *string `graphql:"gender" json:"gender"`
	URL          *string `graphql:"url" json:"url"`
	Twitter      *string `graphql:"twitter" json:"twitter"`
	Instagram    *string `graphql:"instagram" json:"instagram"`
	Birthdate    *string `graphql:"birthdate" json:"birthdate"`
	Ethnicity    *string `graphql:"ethnicity" json:"ethnicity"`
	Country      *string `graphql:"country" json:"country"`
	EyeColor     *string `graphql:"eye_color" json:"eye_color"`
	Height       *string `graphql:"height" json:"height"`
	Measurements *string `graphql:"measurements" json:"measurements"`
	FakeTits     *string `graphql:"fake_tits" json:"fake_tits"`
	CareerLength *string `graphql:"career_length" json:"career_length"`
	Tattoos      *string `graphql:"tattoos" json:"tattoos"`
	Piercings    *string `graphql:"piercings" json:"piercings"`
	Aliases      *string `graphql:"aliases" json:"aliases"`
	Image        *string `graphql:"image" json:"image"`
}

type ScrapedPerformerStash added in v0.2.0

type ScrapedPerformerStash struct {
	Name         *string `graphql:"name" json:"name"`
	Gender       *string `graphql:"gender" json:"gender"`
	URL          *string `graphql:"url" json:"url"`
	Twitter      *string `graphql:"twitter" json:"twitter"`
	Instagram    *string `graphql:"instagram" json:"instagram"`
	Birthdate    *string `graphql:"birthdate" json:"birthdate"`
	Ethnicity    *string `graphql:"ethnicity" json:"ethnicity"`
	Country      *string `graphql:"country" json:"country"`
	EyeColor     *string `graphql:"eye_color" json:"eye_color"`
	Height       *string `graphql:"height" json:"height"`
	Measurements *string `graphql:"measurements" json:"measurements"`
	FakeTits     *string `graphql:"fake_tits" json:"fake_tits"`
	CareerLength *string `graphql:"career_length" json:"career_length"`
	Tattoos      *string `graphql:"tattoos" json:"tattoos"`
	Piercings    *string `graphql:"piercings" json:"piercings"`
	Aliases      *string `graphql:"aliases" json:"aliases"`
}

this type has no Image field

type ScrapedScene

type ScrapedScene struct {
	Title        *string                  `graphql:"title" json:"title"`
	Details      *string                  `graphql:"details" json:"details"`
	URL          *string                  `graphql:"url" json:"url"`
	Date         *string                  `graphql:"date" json:"date"`
	Image        *string                  `graphql:"image" json:"image"`
	RemoteSiteID *string                  `graphql:"remote_site_id" json:"remote_site_id"`
	Duration     *int                     `graphql:"duration" json:"duration"`
	File         *SceneFileType           `graphql:"file" json:"file"`
	Fingerprints []*StashBoxFingerprint   `graphql:"fingerprints" json:"fingerprints"`
	Studio       *ScrapedSceneStudio      `graphql:"studio" json:"studio"`
	Movies       []*ScrapedSceneMovie     `graphql:"movies" json:"movies"`
	Tags         []*ScrapedSceneTag       `graphql:"tags" json:"tags"`
	Performers   []*ScrapedScenePerformer `graphql:"performers" json:"performers"`
}

type ScrapedSceneMovie added in v0.2.0

type ScrapedSceneMovie struct {
	// Set if movie matched
	ID       *string `graphql:"id" json:"id"`
	Name     string  `graphql:"name" json:"name"`
	Aliases  string  `graphql:"aliases" json:"aliases"`
	Duration string  `graphql:"duration" json:"duration"`
	Date     string  `graphql:"date" json:"date"`
	Rating   string  `graphql:"rating" json:"rating"`
	Director string  `graphql:"director" json:"director"`
	Synopsis string  `graphql:"synopsis" json:"synopsis"`
	URL      *string `graphql:"url" json:"url"`
}

type ScrapedScenePerformer

type ScrapedScenePerformer struct {
	// Set if performer matched
	ID           *string  `graphql:"id" json:"id"`
	Name         string   `graphql:"name" json:"name"`
	Gender       *string  `graphql:"gender" json:"gender"`
	URL          *string  `graphql:"url" json:"url"`
	Twitter      *string  `graphql:"twitter" json:"twitter"`
	Instagram    *string  `graphql:"instagram" json:"instagram"`
	Birthdate    *string  `graphql:"birthdate" json:"birthdate"`
	Ethnicity    *string  `graphql:"ethnicity" json:"ethnicity"`
	Country      *string  `graphql:"country" json:"country"`
	EyeColor     *string  `graphql:"eye_color" json:"eye_color"`
	Height       *string  `graphql:"height" json:"height"`
	Measurements *string  `graphql:"measurements" json:"measurements"`
	FakeTits     *string  `graphql:"fake_tits" json:"fake_tits"`
	CareerLength *string  `graphql:"career_length" json:"career_length"`
	Tattoos      *string  `graphql:"tattoos" json:"tattoos"`
	Piercings    *string  `graphql:"piercings" json:"piercings"`
	Aliases      *string  `graphql:"aliases" json:"aliases"`
	RemoteSiteID *string  `graphql:"remote_site_id" json:"remote_site_id"`
	Images       []string `graphql:"images" json:"images"`
}

type ScrapedSceneStash added in v0.2.0

type ScrapedSceneStash struct {
	ID         string                   `graphql:"id" json:"id"`
	Title      *string                  `graphql:"title" json:"title"`
	Details    *string                  `graphql:"details" json:"details"`
	URL        *string                  `graphql:"url" json:"url"`
	Date       *string                  `graphql:"date" json:"date"`
	File       *SceneFileType           `graphql:"file" json:"file"`
	Studio     *ScrapedSceneStudio      `graphql:"studio" json:"studio"`
	Tags       []*ScrapedSceneTag       `graphql:"tags" json:"tags"`
	Performers []*ScrapedScenePerformer `graphql:"performers" json:"performers"`
}

stash doesn't return image, and we need id

type ScrapedSceneStudio

type ScrapedSceneStudio struct {
	// Set if studio matched
	ID           *string `graphql:"id" json:"id"`
	Name         string  `graphql:"name" json:"name"`
	URL          *string `graphql:"url" json:"url"`
	RemoteSiteID *string `graphql:"remote_site_id" json:"remote_site_id"`
}

type ScrapedSceneTag

type ScrapedSceneTag struct {
	// Set if tag matched
	ID   *string `graphql:"stored_id" json:"stored_id"`
	Name string  `graphql:"name" json:"name"`
}

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

func NewStudio added in v0.4.0

func NewStudio(name string) *Studio

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

type StudioQueryBuilder

type StudioQueryBuilder struct{}

func NewStudioQueryBuilder

func NewStudioQueryBuilder() StudioQueryBuilder

func (*StudioQueryBuilder) All

func (qb *StudioQueryBuilder) All() ([]*Studio, error)

func (*StudioQueryBuilder) AllSlim added in v0.2.0

func (qb *StudioQueryBuilder) AllSlim() ([]*Studio, error)

func (*StudioQueryBuilder) Count

func (qb *StudioQueryBuilder) Count() (int, error)

func (*StudioQueryBuilder) Create

func (qb *StudioQueryBuilder) Create(newStudio Studio, tx *sqlx.Tx) (*Studio, error)

func (*StudioQueryBuilder) Destroy

func (qb *StudioQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*StudioQueryBuilder) DestroyStudioImage added in v0.3.0

func (qb *StudioQueryBuilder) DestroyStudioImage(studioID int, tx *sqlx.Tx) error

func (*StudioQueryBuilder) Find

func (qb *StudioQueryBuilder) Find(id int, tx *sqlx.Tx) (*Studio, error)

func (*StudioQueryBuilder) FindByName

func (qb *StudioQueryBuilder) FindByName(name string, tx *sqlx.Tx, nocase bool) (*Studio, error)

func (*StudioQueryBuilder) FindBySceneID

func (qb *StudioQueryBuilder) FindBySceneID(sceneID int) (*Studio, error)

func (*StudioQueryBuilder) FindChildren added in v0.3.0

func (qb *StudioQueryBuilder) FindChildren(id int, tx *sqlx.Tx) ([]*Studio, error)

func (*StudioQueryBuilder) FindMany added in v0.4.0

func (qb *StudioQueryBuilder) FindMany(ids []int) ([]*Studio, error)

func (*StudioQueryBuilder) GetStudioImage added in v0.3.0

func (qb *StudioQueryBuilder) GetStudioImage(studioID int, tx *sqlx.Tx) ([]byte, error)

func (*StudioQueryBuilder) Query

func (qb *StudioQueryBuilder) Query(studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int)

func (*StudioQueryBuilder) Update

func (qb *StudioQueryBuilder) Update(updatedStudio StudioPartial, tx *sqlx.Tx) (*Studio, error)

func (*StudioQueryBuilder) UpdateFull added in v0.4.0

func (qb *StudioQueryBuilder) UpdateFull(updatedStudio Studio, tx *sqlx.Tx) (*Studio, error)

func (*StudioQueryBuilder) UpdateStudioImage added in v0.3.0

func (qb *StudioQueryBuilder) UpdateStudioImage(studioID int, image []byte, tx *sqlx.Tx) error

type StudioReader added in v0.4.0

type StudioReader interface {
	Find(id int) (*Studio, error)
	FindMany(ids []int) ([]*Studio, error)
	// FindChildren(id int) ([]*Studio, error)
	// FindBySceneID(sceneID int) (*Studio, error)
	FindByName(name string, nocase bool) (*Studio, error)
	// Count() (int, error)
	All() ([]*Studio, error)
	// AllSlim() ([]*Studio, error)
	// Query(studioFilter *StudioFilterType, findFilter *FindFilterType) ([]*Studio, int)
	GetStudioImage(studioID int) ([]byte, error)
}

type StudioReaderWriter added in v0.4.0

type StudioReaderWriter interface {
	StudioReader
	StudioWriter
}

func NewStudioReaderWriter added in v0.4.0

func NewStudioReaderWriter(tx *sqlx.Tx) StudioReaderWriter

type StudioWriter added in v0.4.0

type StudioWriter interface {
	Create(newStudio Studio) (*Studio, error)
	Update(updatedStudio StudioPartial) (*Studio, error)
	UpdateFull(updatedStudio Studio) (*Studio, error)
	// Destroy(id string) error
	UpdateStudioImage(studioID int, image []byte) error
}

type Tag

type Tag struct {
	ID        int             `db:"id" json:"id"`
	Name      string          `db:"name" json:"name"` // TODO make schema not null
	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 TagQueryBuilder

type TagQueryBuilder struct{}

func NewTagQueryBuilder

func NewTagQueryBuilder() TagQueryBuilder

func (*TagQueryBuilder) All

func (qb *TagQueryBuilder) All() ([]*Tag, error)

func (*TagQueryBuilder) AllSlim added in v0.2.0

func (qb *TagQueryBuilder) AllSlim() ([]*Tag, error)

func (*TagQueryBuilder) Count

func (qb *TagQueryBuilder) Count() (int, error)

func (*TagQueryBuilder) Create

func (qb *TagQueryBuilder) Create(newTag Tag, tx *sqlx.Tx) (*Tag, error)

func (*TagQueryBuilder) Destroy

func (qb *TagQueryBuilder) Destroy(id string, tx *sqlx.Tx) error

func (*TagQueryBuilder) DestroyTagImage added in v0.3.0

func (qb *TagQueryBuilder) DestroyTagImage(tagID int, tx *sqlx.Tx) error

func (*TagQueryBuilder) Find

func (qb *TagQueryBuilder) Find(id int, tx *sqlx.Tx) (*Tag, error)

func (*TagQueryBuilder) FindByGalleryID added in v0.4.0

func (qb *TagQueryBuilder) FindByGalleryID(galleryID int, tx *sqlx.Tx) ([]*Tag, error)

func (*TagQueryBuilder) FindByImageID added in v0.4.0

func (qb *TagQueryBuilder) FindByImageID(imageID int, tx *sqlx.Tx) ([]*Tag, error)

func (*TagQueryBuilder) FindByName

func (qb *TagQueryBuilder) FindByName(name string, tx *sqlx.Tx, nocase bool) (*Tag, error)

func (*TagQueryBuilder) FindByNames

func (qb *TagQueryBuilder) FindByNames(names []string, tx *sqlx.Tx, nocase bool) ([]*Tag, error)

func (*TagQueryBuilder) FindBySceneID

func (qb *TagQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) ([]*Tag, error)

func (*TagQueryBuilder) FindBySceneMarkerID

func (qb *TagQueryBuilder) FindBySceneMarkerID(sceneMarkerID int, tx *sqlx.Tx) ([]*Tag, error)

func (*TagQueryBuilder) FindMany added in v0.4.0

func (qb *TagQueryBuilder) FindMany(ids []int) ([]*Tag, error)

func (*TagQueryBuilder) GetTagImage added in v0.3.0

func (qb *TagQueryBuilder) GetTagImage(tagID int, tx *sqlx.Tx) ([]byte, error)

func (*TagQueryBuilder) Query

func (qb *TagQueryBuilder) Query(tagFilter *TagFilterType, findFilter *FindFilterType) ([]*Tag, int)

func (*TagQueryBuilder) Update

func (qb *TagQueryBuilder) Update(updatedTag Tag, tx *sqlx.Tx) (*Tag, error)

func (*TagQueryBuilder) UpdateTagImage added in v0.3.0

func (qb *TagQueryBuilder) UpdateTagImage(tagID int, image []byte, tx *sqlx.Tx) error

type TagReader added in v0.4.0

type TagReader interface {
	Find(id int) (*Tag, error)
	FindMany(ids []int) ([]*Tag, error)
	FindBySceneID(sceneID int) ([]*Tag, error)
	FindBySceneMarkerID(sceneMarkerID int) ([]*Tag, error)
	FindByImageID(imageID int) ([]*Tag, error)
	FindByGalleryID(galleryID int) ([]*Tag, error)
	FindByName(name string, nocase bool) (*Tag, error)
	FindByNames(names []string, nocase bool) ([]*Tag, error)
	// Count() (int, error)
	All() ([]*Tag, error)
	// AllSlim() ([]*Tag, error)
	// Query(tagFilter *TagFilterType, findFilter *FindFilterType) ([]*Tag, int, error)
	GetTagImage(tagID int) ([]byte, error)
}

type TagReaderWriter added in v0.4.0

type TagReaderWriter interface {
	TagReader
	TagWriter
}

func NewTagReaderWriter added in v0.4.0

func NewTagReaderWriter(tx *sqlx.Tx) TagReaderWriter

type TagWriter added in v0.4.0

type TagWriter interface {
	Create(newTag Tag) (*Tag, error)
	Update(updatedTag Tag) (*Tag, error)
	// Destroy(id string) error
	UpdateTagImage(tagID int, image []byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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