Documentation
¶
Index ¶
- Constants
- Variables
- func NullInt64(v int64) sql.NullInt64
- func NullString(v string) sql.NullString
- func WithROTxn(txn ReadTransaction, fn func(r ReaderRepository) error) error
- func WithTxn(txn Transaction, fn func(r Repository) error) error
- type Galleries
- type Gallery
- type GalleryPartial
- type GalleryReader
- type GalleryReaderWriter
- type GalleryWriter
- type Image
- type ImageFileType
- type ImagePartial
- type ImageReader
- type ImageReaderWriter
- type ImageWriter
- type Images
- type JSONTime
- type Movie
- type MoviePartial
- type MovieReader
- type MovieReaderWriter
- type MovieWriter
- type Movies
- type MoviesScenes
- type NullSQLiteTimestamp
- type Performer
- type PerformerPartial
- type PerformerReader
- type PerformerReaderWriter
- type PerformerWriter
- type Performers
- type ReadTransaction
- type ReaderRepository
- type Repository
- type SQLiteDate
- type SQLiteTimestamp
- type Scene
- type SceneFileType
- type SceneMarker
- type SceneMarkerReader
- type SceneMarkerReaderWriter
- type SceneMarkerWriter
- type SceneMarkers
- type ScenePartial
- type SceneReader
- type SceneReaderWriter
- type SceneWriter
- type Scenes
- type ScrapedGalleryStash
- type ScrapedItem
- type ScrapedItemReader
- type ScrapedItemReaderWriter
- type ScrapedItemWriter
- type ScrapedItems
- type ScrapedMovie
- type ScrapedMovieStudio
- type ScrapedPerformer
- type ScrapedPerformerStash
- type ScrapedScene
- type ScrapedSceneMovie
- type ScrapedScenePerformer
- type ScrapedSceneStash
- type ScrapedSceneStudio
- type ScrapedSceneTag
- type StashID
- type Studio
- type StudioPartial
- type StudioReader
- type StudioReaderWriter
- type StudioWriter
- type Studios
- type Tag
- type TagReader
- type TagReaderWriter
- type TagWriter
- type Tags
- type Transaction
- type TransactionManager
Constants ¶
const DefaultGthumbWidth int = 640
Variables ¶
var DefaultMovieImage = "" /* 562-byte string literal not displayed */
var DefaultStudioImage = "" /* 562-byte string literal not displayed */
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 NullString ¶ added in v0.5.0
func NullString(v string) sql.NullString
func WithROTxn ¶ added in v0.5.0
func WithROTxn(txn ReadTransaction, fn func(r ReaderRepository) error) error
func WithTxn ¶ added in v0.5.0
func WithTxn(txn Transaction, fn func(r Repository) error) error
Types ¶
type Gallery ¶
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"`
Organized bool `db:"organized" json:"organized"`
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"`
}
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"`
Organized *bool `db:"organized" json:"organized"`
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"`
}
GalleryPartial represents part of a Gallery object. It is used to update the database entry. Only non-nil fields will be updated.
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)
FindByChecksums(checksums []string) ([]*Gallery, error)
FindByPath(path string) (*Gallery, error)
FindBySceneID(sceneID int) ([]*Gallery, error)
FindByImageID(imageID int) ([]*Gallery, error)
Count() (int, error)
All() ([]*Gallery, error)
Query(galleryFilter *GalleryFilterType, findFilter *FindFilterType) ([]*Gallery, int, error)
GetPerformerIDs(galleryID int) ([]int, error)
GetTagIDs(galleryID int) ([]int, error)
GetSceneIDs(galleryID int) ([]int, error)
GetImageIDs(galleryID int) ([]int, error)
}
type GalleryReaderWriter ¶ added in v0.4.0
type GalleryReaderWriter interface {
GalleryReader
GalleryWriter
}
type GalleryWriter ¶ added in v0.4.0
type GalleryWriter interface {
Create(newGallery Gallery) (*Gallery, error)
Update(updatedGallery Gallery) (*Gallery, error)
UpdatePartial(updatedGallery GalleryPartial) (*Gallery, error)
UpdateFileModTime(id int, modTime NullSQLiteTimestamp) error
Destroy(id int) error
UpdatePerformers(galleryID int, performerIDs []int) error
UpdateTags(galleryID int, tagIDs []int) error
UpdateScenes(galleryID int, sceneIDs []int) error
UpdateImages(galleryID int, imageIDs []int) 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"`
Organized bool `db:"organized" json:"organized"`
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"`
Organized *bool `db:"organized" json:"organized"`
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 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)
CountByGalleryID(galleryID int) (int, error)
FindByPath(path string) (*Image, error)
// FindByPerformerID(performerID int) ([]*Image, error)
// CountByPerformerID(performerID int) (int, error)
// FindByStudioID(studioID int) ([]*Image, error)
Count() (int, error)
Size() (float64, error)
// SizeCount() (string, error)
// CountByStudioID(studioID int) (int, error)
// CountByTagID(tagID int) (int, error)
All() ([]*Image, error)
Query(imageFilter *ImageFilterType, findFilter *FindFilterType) ([]*Image, int, error)
GetGalleryIDs(imageID int) ([]int, error)
GetTagIDs(imageID int) ([]int, error)
GetPerformerIDs(imageID int) ([]int, error)
}
type ImageReaderWriter ¶ added in v0.4.0
type ImageReaderWriter interface {
ImageReader
ImageWriter
}
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)
IncrementOCounter(id int) (int, error)
DecrementOCounter(id int) (int, error)
ResetOCounter(id int) (int, error)
Destroy(id int) error
UpdateGalleries(imageID int, galleryIDs []int) error
UpdatePerformers(imageID int, performerIDs []int) error
UpdateTags(imageID int, tagIDs []int) 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"`
}
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 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)
Count() (int, error)
AllSlim() ([]*Movie, error)
Query(movieFilter *MovieFilterType, findFilter *FindFilterType) ([]*Movie, int, error)
GetFrontImage(movieID int) ([]byte, error)
GetBackImage(movieID int) ([]byte, error)
}
type MovieReaderWriter ¶ added in v0.4.0
type MovieReaderWriter interface {
MovieReader
MovieWriter
}
type MovieWriter ¶ added in v0.4.0
type MoviesScenes ¶ added in v0.2.0
type NullSQLiteTimestamp ¶ added in v0.4.0
func (*NullSQLiteTimestamp) Scan ¶ added in v0.4.0
func (t *NullSQLiteTimestamp) Scan(value interface{}) error
Scan implements the Scanner 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
type PerformerPartial ¶ added in v0.5.0
type PerformerPartial 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"`
}
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, error)
GetImage(performerID int) ([]byte, error)
GetStashIDs(performerID int) ([]*StashID, error)
}
type PerformerReaderWriter ¶ added in v0.4.0
type PerformerReaderWriter interface {
PerformerReader
PerformerWriter
}
type PerformerWriter ¶ added in v0.4.0
type PerformerWriter interface {
Create(newPerformer Performer) (*Performer, error)
Update(updatedPerformer PerformerPartial) (*Performer, error)
UpdateFull(updatedPerformer Performer) (*Performer, error)
Destroy(id int) error
UpdateImage(performerID int, image []byte) error
DestroyImage(performerID int) error
UpdateStashIDs(performerID int, stashIDs []StashID) 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 ReadTransaction ¶ added in v0.5.0
type ReadTransaction interface {
Begin() error
Rollback() error
Commit() error
Repository() ReaderRepository
}
type ReaderRepository ¶ added in v0.5.0
type ReaderRepository interface {
Gallery() GalleryReader
Image() ImageReader
Movie() MovieReader
Performer() PerformerReader
Scene() SceneReader
SceneMarker() SceneMarkerReader
ScrapedItem() ScrapedItemReader
Studio() StudioReader
Tag() TagReader
}
type Repository ¶ added in v0.5.0
type Repository interface {
Gallery() GalleryReaderWriter
Image() ImageReaderWriter
Movie() MovieReaderWriter
Performer() PerformerReaderWriter
Scene() SceneReaderWriter
SceneMarker() SceneMarkerReaderWriter
ScrapedItem() ScrapedItemReaderWriter
Studio() StudioReaderWriter
Tag() TagReaderWriter
}
type SQLiteDate ¶
func (*SQLiteDate) Scan ¶
func (t *SQLiteDate) Scan(value interface{}) error
Scan implements the Scanner interface.
type SQLiteTimestamp ¶
func (*SQLiteTimestamp) Scan ¶
func (t *SQLiteTimestamp) Scan(value interface{}) error
Scan implements the Scanner 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"`
Organized bool `db:"organized" json:"organized"`
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.
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 SceneMarkerReader ¶ added in v0.4.0
type SceneMarkerReader interface {
Find(id int) (*SceneMarker, error)
FindMany(ids []int) ([]*SceneMarker, error)
FindBySceneID(sceneID int) ([]*SceneMarker, error)
CountByTagID(tagID int) (int, error)
GetMarkerStrings(q *string, sort *string) ([]*MarkerStringsResultType, error)
Wall(q *string) ([]*SceneMarker, error)
Query(sceneMarkerFilter *SceneMarkerFilterType, findFilter *FindFilterType) ([]*SceneMarker, int, error)
GetTagIDs(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(newSceneMarker SceneMarker) (*SceneMarker, error)
Update(updatedSceneMarker SceneMarker) (*SceneMarker, error)
Destroy(id int) error
UpdateTags(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 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"`
Organized *bool `db:"organized" json:"organized"`
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 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)
FindByGalleryID(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)
Size() (float64, 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)
QueryForAutoTag(regex string, pathPrefixes []string) ([]*Scene, error)
Query(sceneFilter *SceneFilterType, findFilter *FindFilterType) ([]*Scene, int, error)
GetCover(sceneID int) ([]byte, error)
GetMovies(sceneID int) ([]MoviesScenes, error)
GetTagIDs(sceneID int) ([]int, error)
GetGalleryIDs(sceneID int) ([]int, error)
GetPerformerIDs(sceneID int) ([]int, error)
GetStashIDs(sceneID int) ([]*StashID, error)
}
type SceneReaderWriter ¶ added in v0.4.0
type SceneReaderWriter interface {
SceneReader
SceneWriter
}
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)
UpdateFileModTime(id int, modTime NullSQLiteTimestamp) error
Destroy(id int) error
UpdateCover(sceneID int, cover []byte) error
DestroyCover(sceneID int) error
UpdatePerformers(sceneID int, performerIDs []int) error
UpdateTags(sceneID int, tagIDs []int) error
UpdateGalleries(sceneID int, galleryIDs []int) error
UpdateMovies(sceneID int, movies []MoviesScenes) error
UpdateStashIDs(sceneID int, stashIDs []StashID) error
}
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 ScrapedItemReader ¶ added in v0.5.0
type ScrapedItemReader interface {
All() ([]*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(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 {
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 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 ScrapedSceneTag ¶
type StashID ¶ added in v0.4.0
type StashID struct {
StashID string `db:"stash_id" json:"stash_id"`
Endpoint string `db:"endpoint" json:"endpoint"`
}
func StashIDsFromInput ¶ added in v0.5.0
func StashIDsFromInput(i []*StashIDInput) []StashID
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"`
}
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 StudioReader ¶ added in v0.4.0
type StudioReader interface {
Find(id int) (*Studio, error)
FindMany(ids []int) ([]*Studio, error)
FindChildren(id 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, error)
GetImage(studioID int) ([]byte, error)
HasImage(studioID int) (bool, error)
GetStashIDs(studioID int) ([]*StashID, error)
}
type StudioReaderWriter ¶ added in v0.4.0
type StudioReaderWriter interface {
StudioReader
StudioWriter
}
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 int) error
UpdateImage(studioID int, image []byte) error
DestroyImage(studioID int) error
UpdateStashIDs(studioID int, stashIDs []StashID) 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"`
}
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)
GetImage(tagID int) ([]byte, error)
}
type TagReaderWriter ¶ added in v0.4.0
type Transaction ¶ added in v0.5.0
type Transaction interface {
Begin() error
Rollback() error
Commit() error
Repository() Repository
}
type TransactionManager ¶ added in v0.5.0
type TransactionManager interface {
WithTxn(ctx context.Context, fn func(r Repository) error) error
WithReadTxn(ctx context.Context, fn func(r ReaderRepository) error) error
}
Source Files
¶
- extension_find_filter.go
- gallery.go
- image.go
- json_time.go
- model_gallery.go
- model_image.go
- model_joins.go
- model_movie.go
- model_performer.go
- model_scene.go
- model_scene_marker.go
- model_scraped_item.go
- model_studio.go
- model_tag.go
- movie.go
- performer.go
- repository.go
- scene.go
- scene_marker.go
- scraped.go
- sql.go
- sqlite_date.go
- sqlite_timestamp.go
- stash_ids.go
- studio.go
- tag.go
- transaction.go