Documentation
¶
Overview ¶
Package jsonschema provides the JSON schema models used for importing and exporting data.
Index ¶
- Constants
- func CompareJSON(a interface{}, b interface{}) bool
- func SaveFileFile(filePath string, file DirEntry) error
- func SaveFolderFile(filePath string, folder *Folder) error
- func SaveGalleryFile(filePath string, gallery *Gallery) error
- func SaveGroupFile(filePath string, movie *Group) error
- func SaveImageFile(filePath string, image *Image) error
- func SavePerformerFile(filePath string, performer *Performer) error
- func SaveSavedFilterFile(filePath string, image *SavedFilter) error
- func SaveSceneFile(filePath string, scene *Scene) error
- func SaveStudioFile(filePath string, studio *Studio) error
- func SaveTagFile(filePath string, tag *Tag) error
- type BaseDirEntry
- type BaseFile
- type DirEntry
- type Fingerprint
- type Folder
- type Gallery
- type GalleryChapter
- type GalleryRef
- type Group
- type Image
- type ImageFile
- type MovieSynopsisBC
- type Performer
- type SavedFilter
- type Scene
- type SceneFile
- type SceneGroup
- type SceneMarker
- type StringOrStringList
- type Studio
- type SubGroupDescription
- type Tag
- type VideoFile
Constants ¶
View Source
const ( DirEntryTypeFolder = "folder" DirEntryTypeVideo = "video" DirEntryTypeImage = "image" DirEntryTypeFile = "file" )
Variables ¶
This section is empty.
Functions ¶
func CompareJSON ¶
func CompareJSON(a interface{}, b interface{}) bool
func SaveFileFile ¶ added in v0.17.0
func SaveFolderFile ¶ added in v0.17.0
func SaveGalleryFile ¶
func SaveGroupFile ¶ added in v0.27.0
func SaveImageFile ¶
func SavePerformerFile ¶
func SaveSavedFilterFile ¶ added in v0.28.0
func SaveSavedFilterFile(filePath string, image *SavedFilter) error
func SaveSceneFile ¶
func SaveStudioFile ¶
func SaveTagFile ¶
Types ¶
type BaseDirEntry ¶ added in v0.17.0
type BaseDirEntry struct {
ZipFile string `json:"zip_file,omitempty"`
ModTime json.JSONTime `json:"mod_time"`
Type string `json:"type,omitempty"`
Path string `json:"path,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
func (*BaseDirEntry) DirEntry ¶ added in v0.17.0
func (f *BaseDirEntry) DirEntry() *BaseDirEntry
func (*BaseDirEntry) Filename ¶ added in v0.17.0
func (f *BaseDirEntry) Filename() string
func (*BaseDirEntry) IsFile ¶ added in v0.17.0
func (f *BaseDirEntry) IsFile() bool
type BaseFile ¶ added in v0.17.0
type BaseFile struct {
BaseDirEntry
Fingerprints []Fingerprint `json:"fingerprints,omitempty"`
Size int64 `json:"size"`
}
type DirEntry ¶ added in v0.17.0
type DirEntry interface {
IsFile() bool
Filename() string
DirEntry() *BaseDirEntry
}
func LoadFileFile ¶ added in v0.17.0
type Fingerprint ¶ added in v0.17.0
type Fingerprint struct {
Type string `json:"type,omitempty"`
Fingerprint interface{} `json:"fingerprint,omitempty"`
}
type Folder ¶ added in v0.17.0
type Folder struct {
BaseDirEntry
Path string `json:"path,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
func LoadFolderFile ¶ added in v0.17.0
type Gallery ¶
type Gallery struct {
ZipFiles []string `json:"zip_files,omitempty"`
FolderPath string `json:"folder_path,omitempty"`
Title string `json:"title,omitempty"`
Code string `json:"code,omitempty"`
URLs []string `json:"urls,omitempty"`
Date string `json:"date,omitempty"`
Details string `json:"details,omitempty"`
Photographer string `json:"photographer,omitempty"`
Rating int `json:"rating,omitempty"`
Organized bool `json:"organized,omitempty"`
Chapters []GalleryChapter `json:"chapters,omitempty"`
Studio string `json:"studio,omitempty"`
Performers []string `json:"performers,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
}
func LoadGalleryFile ¶
type GalleryChapter ¶ added in v0.20.0
type GalleryRef ¶ added in v0.17.0
type GalleryRef struct {
ZipFiles []string `json:"zip_files,omitempty"`
FolderPath string `json:"folder_path,omitempty"`
// Title is used only if FolderPath and ZipPaths is empty
Title string `json:"title,omitempty"`
}
GalleryRef is used to identify a Gallery. Only one field should be populated.
func (GalleryRef) String ¶ added in v0.17.0
func (r GalleryRef) String() string
type Group ¶ added in v0.27.0
type Group struct {
Name string `json:"name,omitempty"`
Aliases string `json:"aliases,omitempty"`
Duration int `json:"duration,omitempty"`
Date string `json:"date,omitempty"`
Rating int `json:"rating,omitempty"`
Director string `json:"director,omitempty"`
Synopsis string `json:"synopsis,omitempty"`
FrontImage string `json:"front_image,omitempty"`
BackImage string `json:"back_image,omitempty"`
URLs []string `json:"urls,omitempty"`
Studio string `json:"studio,omitempty"`
Tags []string `json:"tags,omitempty"`
SubGroups []SubGroupDescription `json:"sub_groups,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
}
func LoadGroupFile ¶ added in v0.27.0
type Image ¶
type Image struct {
Title string `json:"title,omitempty"`
Code string `json:"code,omitempty"`
Studio string `json:"studio,omitempty"`
Rating int `json:"rating,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
URLs []string `json:"urls,omitempty"`
Date string `json:"date,omitempty"`
Details string `json:"details,omitempty"`
Photographer string `json:"photographer,omitempty"`
Organized bool `json:"organized,omitempty"`
OCounter int `json:"o_counter,omitempty"`
Galleries []GalleryRef `json:"galleries,omitempty"`
Performers []string `json:"performers,omitempty"`
Tags []string `json:"tags,omitempty"`
Files []string `json:"files,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
func LoadImageFile ¶
type MovieSynopsisBC ¶ added in v0.16.0
type MovieSynopsisBC struct {
Synopsis string `json:"sypnopsis,omitempty"`
}
Backwards Compatible synopsis for the movie
type Performer ¶
type Performer struct {
Name string `json:"name,omitempty"`
Disambiguation string `json:"disambiguation,omitempty"`
Gender string `json:"gender,omitempty"`
URLs []string `json:"urls,omitempty"`
Birthdate string `json:"birthdate,omitempty"`
Ethnicity string `json:"ethnicity,omitempty"`
Country string `json:"country,omitempty"`
EyeColor string `json:"eye_color,omitempty"`
// this should be int, but keeping string for backwards compatibility
Height string `json:"height,omitempty"`
Measurements string `json:"measurements,omitempty"`
FakeTits string `json:"fake_tits,omitempty"`
PenisLength float64 `json:"penis_length,omitempty"`
Circumcised string `json:"circumcised,omitempty"`
CareerLength string `json:"career_length,omitempty"`
Tattoos string `json:"tattoos,omitempty"`
Piercings string `json:"piercings,omitempty"`
Aliases StringOrStringList `json:"aliases,omitempty"`
Favorite bool `json:"favorite,omitempty"`
Tags []string `json:"tags,omitempty"`
Image string `json:"image,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
Rating int `json:"rating,omitempty"`
Details string `json:"details,omitempty"`
DeathDate string `json:"death_date,omitempty"`
HairColor string `json:"hair_color,omitempty"`
Weight int `json:"weight,omitempty"`
StashIDs []models.StashID `json:"stash_ids,omitempty"`
IgnoreAutoTag bool `json:"ignore_auto_tag,omitempty"`
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
Twitter string `json:"twitter,omitempty"`
Instagram string `json:"instagram,omitempty"`
}
func LoadPerformerFile ¶
type SavedFilter ¶ added in v0.28.0
type SavedFilter struct {
Mode models.FilterMode `db:"mode" json:"mode"`
Name string `db:"name" json:"name"`
FindFilter *models.FindFilterType `json:"find_filter"`
ObjectFilter map[string]interface{} `json:"object_filter"`
UIOptions map[string]interface{} `json:"ui_options"`
}
func LoadSavedFilterFile ¶ added in v0.28.0
func LoadSavedFilterFile(filePath string) (*SavedFilter, error)
func (SavedFilter) Filename ¶ added in v0.28.0
func (s SavedFilter) Filename() string
type Scene ¶
type Scene struct {
Title string `json:"title,omitempty"`
Code string `json:"code,omitempty"`
Studio string `json:"studio,omitempty"`
// deprecated - for import only
URL string `json:"url,omitempty"`
URLs []string `json:"urls,omitempty"`
Date string `json:"date,omitempty"`
Rating int `json:"rating,omitempty"`
Organized bool `json:"organized,omitempty"`
// deprecated - for import only
OCounter int `json:"o_counter,omitempty"`
Details string `json:"details,omitempty"`
Director string `json:"director,omitempty"`
Galleries []GalleryRef `json:"galleries,omitempty"`
Performers []string `json:"performers,omitempty"`
Groups []SceneGroup `json:"movies,omitempty"`
Tags []string `json:"tags,omitempty"`
Markers []SceneMarker `json:"markers,omitempty"`
Files []string `json:"files,omitempty"`
Cover string `json:"cover,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
// deprecated - for import only
LastPlayedAt json.JSONTime `json:"last_played_at,omitempty"`
ResumeTime float64 `json:"resume_time,omitempty"`
// deprecated - for import only
PlayCount int `json:"play_count,omitempty"`
PlayHistory []json.JSONTime `json:"play_history,omitempty"`
OHistory []json.JSONTime `json:"o_history,omitempty"`
PlayDuration float64 `json:"play_duration,omitempty"`
StashIDs []models.StashID `json:"stash_ids,omitempty"`
}
func LoadSceneFile ¶
type SceneFile ¶
type SceneFile struct {
ModTime json.JSONTime `json:"mod_time,omitempty"`
Size string `json:"size"`
Duration string `json:"duration"`
VideoCodec string `json:"video_codec"`
AudioCodec string `json:"audio_codec"`
Format string `json:"format"`
Width int `json:"width"`
Height int `json:"height"`
Framerate string `json:"framerate"`
Bitrate int `json:"bitrate"`
}
type SceneGroup ¶ added in v0.27.0
type SceneMarker ¶
type SceneMarker struct {
Title string `json:"title,omitempty"`
Seconds string `json:"seconds,omitempty"`
PrimaryTag string `json:"primary_tag,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
type StringOrStringList ¶ added in v0.19.0
type StringOrStringList []string
func (*StringOrStringList) UnmarshalJSON ¶ added in v0.19.0
func (s *StringOrStringList) UnmarshalJSON(data []byte) error
type Studio ¶
type Studio struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
ParentStudio string `json:"parent_studio,omitempty"`
Image string `json:"image,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
Rating int `json:"rating,omitempty"`
Favorite bool `json:"favorite,omitempty"`
Details string `json:"details,omitempty"`
Aliases []string `json:"aliases,omitempty"`
StashIDs []models.StashID `json:"stash_ids,omitempty"`
Tags []string `json:"tags,omitempty"`
IgnoreAutoTag bool `json:"ignore_auto_tag,omitempty"`
}
func LoadStudioFile ¶
type SubGroupDescription ¶ added in v0.27.0
type Tag ¶
type Tag struct {
Name string `json:"name,omitempty"`
SortName string `json:"sort_name,omitempty"`
Description string `json:"description,omitempty"`
Favorite bool `json:"favorite,omitempty"`
Aliases []string `json:"aliases,omitempty"`
Image string `json:"image,omitempty"`
Parents []string `json:"parents,omitempty"`
IgnoreAutoTag bool `json:"ignore_auto_tag,omitempty"`
CreatedAt json.JSONTime `json:"created_at,omitempty"`
UpdatedAt json.JSONTime `json:"updated_at,omitempty"`
}
func LoadTagFile ¶
type VideoFile ¶ added in v0.17.0
type VideoFile struct {
*BaseFile
Format string `json:"format,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Duration float64 `json:"duration,omitempty"`
VideoCodec string `json:"video_codec,omitempty"`
AudioCodec string `json:"audio_codec,omitempty"`
FrameRate float64 `json:"frame_rate,omitempty"`
BitRate int64 `json:"bitrate,omitempty"`
Interactive bool `json:"interactive,omitempty"`
InteractiveSpeed *int `json:"interactive_speed,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.