Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteGalleryFile(gallery *models.Gallery)
- func GenerateAPIKey(userID string) (string, error)
- func GetSceneFileContainer(scene *models.Scene) (ffmpeg.Container, error)
- func GetSceneStreamPaths(scene *models.Scene, directStreamURL string, ...) ([]*models.SceneStreamEndpoint, error)
- func GetUserIDFromAPIKey(apiKey string) (string, error)
- func HasTranscode(scene *models.Scene, fileNamingAlgo models.HashAlgorithm) bool
- func KillRunningStreams(scene *models.Scene, fileNamingAlgo models.HashAlgorithm)
- func ValidateModifyStudio(studio models.StudioPartial, qb models.StudioReader) error
- func ValidateVideoFileNamingAlgorithm(txnManager models.TransactionManager, newValue models.HashAlgorithm) error
- type APIKeyClaims
- type Action
- type DownloadStore
- type ExportTask
- func (t *ExportTask) ExportGalleries(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportImages(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportMovies(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportPerformers(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportScenes(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportScrapedItems(repo models.ReaderRepository)
- func (t *ExportTask) ExportStudios(workers int, repo models.ReaderRepository)
- func (t *ExportTask) ExportTags(workers int, repo models.ReaderRepository)
- func (t *ExportTask) Start(ctx context.Context, wg *sync.WaitGroup)
- type FaviconProvider
- type GenerateInteractiveHeatmapSpeedTask
- type GenerateJob
- type GenerateMarkersTask
- type GeneratePhashTask
- type GeneratePreviewTask
- type GenerateScreenshotTask
- type GenerateSpriteTask
- type GenerateTranscodeTask
- type GradientTable
- type IdentifyJob
- type ImportTask
- func (t *ImportTask) GetDescription() string
- func (t *ImportTask) ImportGalleries(ctx context.Context)
- func (t *ImportTask) ImportImages(ctx context.Context)
- func (t *ImportTask) ImportMovies(ctx context.Context)
- func (t *ImportTask) ImportPerformers(ctx context.Context)
- func (t *ImportTask) ImportScenes(ctx context.Context)
- func (t *ImportTask) ImportScrapedItems(ctx context.Context)
- func (t *ImportTask) ImportStudio(studioJSON *jsonschema.Studio, pendingParent map[string][]*jsonschema.Studio, ...) error
- func (t *ImportTask) ImportStudios(ctx context.Context)
- func (t *ImportTask) ImportTag(tagJSON *jsonschema.Tag, pendingParent map[string][]*jsonschema.Tag, fail bool, ...) error
- func (t *ImportTask) ImportTags(ctx context.Context)
- func (t *ImportTask) Start(ctx context.Context)
- type InteractiveHeatmapSpeedGenerator
- type Manager
- func (s *Manager) AutoTag(ctx context.Context, input models.AutoTagMetadataInput) int
- func (s *Manager) Clean(ctx context.Context, input models.CleanMetadataInput) int
- func (s *Manager) Export(ctx context.Context) (int, error)
- func (s *Manager) Generate(ctx context.Context, input models.GenerateMetadataInput) (int, error)
- func (s *Manager) GenerateDefaultScreenshot(ctx context.Context, sceneId string) int
- func (s *Manager) GenerateScreenshot(ctx context.Context, sceneId string, at float64) int
- func (s *Manager) GetSystemStatus() *models.SystemStatus
- func (s *Manager) Import(ctx context.Context) (int, error)
- func (s *Manager) Migrate(ctx context.Context, input models.MigrateInput) error
- func (s *Manager) MigrateHash(ctx context.Context) int
- func (s *Manager) PostInit(ctx context.Context) error
- func (s *Manager) PostMigrate(ctx context.Context)
- func (s *Manager) RefreshConfig()
- func (s *Manager) RefreshScraperCache()
- func (s *Manager) RunPluginTask(ctx context.Context, pluginID string, taskName string, ...) int
- func (s *Manager) RunSingleTask(ctx context.Context, t Task) int
- func (s *Manager) Scan(ctx context.Context, input models.ScanMetadataInput) (int, error)
- func (s *Manager) ScanSubscribe(ctx context.Context) <-chan bool
- func (s *Manager) Setup(ctx context.Context, input models.SetupInput) error
- func (s *Manager) Shutdown(code int)
- func (s *Manager) StashBoxBatchPerformerTag(ctx context.Context, input models.StashBoxBatchPerformerTagInput) int
- type MigrateHashTask
- type ScanJob
- type ScanTask
- type SceneFilenameParser
- type SceneServer
- type Script
- type SpriteGenerator
- type StashBoxPerformerTagTask
- type StreamRequestContext
- type Task
Constants ¶
const APIKeySubject = "APIKey"
Variables ¶
var ErrInput = errors.New("invalid request input")
var ErrInvalidToken = errors.New("invalid apikey")
Functions ¶
func DeleteGalleryFile ¶
func GenerateAPIKey ¶
func GetSceneFileContainer ¶
func GetSceneStreamPaths ¶
func GetSceneStreamPaths(scene *models.Scene, directStreamURL string, maxStreamingTranscodeSize models.StreamingResolutionEnum) ([]*models.SceneStreamEndpoint, error)
func GetUserIDFromAPIKey ¶
GetUserIDFromAPIKey validates the provided api key and returns the user ID
func HasTranscode ¶
func HasTranscode(scene *models.Scene, fileNamingAlgo models.HashAlgorithm) bool
HasTranscode returns true if a transcoded video exists for the provided scene. It will check using the OSHash of the scene first, then fall back to the checksum.
func KillRunningStreams ¶
func KillRunningStreams(scene *models.Scene, fileNamingAlgo models.HashAlgorithm)
func ValidateModifyStudio ¶
func ValidateModifyStudio(studio models.StudioPartial, qb models.StudioReader) error
func ValidateVideoFileNamingAlgorithm ¶
func ValidateVideoFileNamingAlgorithm(txnManager models.TransactionManager, newValue models.HashAlgorithm) error
ValidateVideoFileNamingAlgorithm validates changing the VideoFileNamingAlgorithm configuration flag.
If setting VideoFileNamingAlgorithm to MD5, then this function will ensure that all checksum values are set on all scenes.
Likewise, if VideoFileNamingAlgorithm is set to oshash, then this function will ensure that all oshash values are set on all scenes.
Types ¶
type APIKeyClaims ¶
type APIKeyClaims struct {
UserID string `json:"uid"`
jwt.StandardClaims
}
type Action ¶
type Action struct {
// At time in milliseconds the action should fire.
At int64 `json:"at"`
// Pos is the place in percent to move to.
Pos int `json:"pos"`
Slope float64
Intensity int64
Speed float64
}
Action is a move at a specific time.
type DownloadStore ¶
type DownloadStore struct {
// contains filtered or unexported fields
}
DownloadStore manages single-use generated files for the UI to download.
func NewDownloadStore ¶
func NewDownloadStore() *DownloadStore
func (*DownloadStore) RegisterFile ¶
func (*DownloadStore) Serve ¶
func (s *DownloadStore) Serve(hash string, w http.ResponseWriter, r *http.Request)
type ExportTask ¶
type ExportTask struct {
Mappings *jsonschema.Mappings
DownloadHash string
// contains filtered or unexported fields
}
func CreateExportTask ¶
func CreateExportTask(a models.HashAlgorithm, input models.ExportObjectsInput) *ExportTask
func (*ExportTask) ExportGalleries ¶
func (t *ExportTask) ExportGalleries(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportImages ¶
func (t *ExportTask) ExportImages(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportMovies ¶
func (t *ExportTask) ExportMovies(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportPerformers ¶
func (t *ExportTask) ExportPerformers(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportScenes ¶
func (t *ExportTask) ExportScenes(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportScrapedItems ¶
func (t *ExportTask) ExportScrapedItems(repo models.ReaderRepository)
func (*ExportTask) ExportStudios ¶
func (t *ExportTask) ExportStudios(workers int, repo models.ReaderRepository)
func (*ExportTask) ExportTags ¶
func (t *ExportTask) ExportTags(workers int, repo models.ReaderRepository)
type FaviconProvider ¶
func (*FaviconProvider) GetFavicon ¶
func (p *FaviconProvider) GetFavicon() []byte
func (*FaviconProvider) GetFaviconPng ¶
func (p *FaviconProvider) GetFaviconPng() []byte
type GenerateInteractiveHeatmapSpeedTask ¶
type GenerateInteractiveHeatmapSpeedTask struct {
Scene models.Scene
Overwrite bool
TxnManager models.TransactionManager
// contains filtered or unexported fields
}
func (*GenerateInteractiveHeatmapSpeedTask) GetDescription ¶
func (t *GenerateInteractiveHeatmapSpeedTask) GetDescription() string
func (*GenerateInteractiveHeatmapSpeedTask) Start ¶
func (t *GenerateInteractiveHeatmapSpeedTask) Start(ctx context.Context)
type GenerateJob ¶
type GenerateJob struct {
// contains filtered or unexported fields
}
type GenerateMarkersTask ¶
type GenerateMarkersTask struct {
TxnManager models.TransactionManager
Scene *models.Scene
Marker *models.SceneMarker
Overwrite bool
ImagePreview bool
Screenshot bool
// contains filtered or unexported fields
}
func (*GenerateMarkersTask) GetDescription ¶
func (t *GenerateMarkersTask) GetDescription() string
func (*GenerateMarkersTask) Start ¶
func (t *GenerateMarkersTask) Start(ctx context.Context)
type GeneratePhashTask ¶
type GeneratePhashTask struct {
Scene models.Scene
Overwrite bool
// contains filtered or unexported fields
}
func (*GeneratePhashTask) GetDescription ¶
func (t *GeneratePhashTask) GetDescription() string
func (*GeneratePhashTask) Start ¶
func (t *GeneratePhashTask) Start(ctx context.Context)
type GeneratePreviewTask ¶
type GeneratePreviewTask struct {
Scene models.Scene
ImagePreview bool
Options generate.PreviewOptions
Overwrite bool
// contains filtered or unexported fields
}
func (*GeneratePreviewTask) GetDescription ¶
func (t *GeneratePreviewTask) GetDescription() string
func (*GeneratePreviewTask) Start ¶
func (t *GeneratePreviewTask) Start(ctx context.Context)
type GenerateScreenshotTask ¶
type GenerateScreenshotTask struct {
Scene models.Scene
ScreenshotAt *float64
// contains filtered or unexported fields
}
func (*GenerateScreenshotTask) Start ¶
func (t *GenerateScreenshotTask) Start(ctx context.Context)
type GenerateSpriteTask ¶
type GenerateSpriteTask struct {
Scene models.Scene
Overwrite bool
// contains filtered or unexported fields
}
func (*GenerateSpriteTask) GetDescription ¶
func (t *GenerateSpriteTask) GetDescription() string
func (*GenerateSpriteTask) Start ¶
func (t *GenerateSpriteTask) Start(ctx context.Context)
type GenerateTranscodeTask ¶
type GenerateTranscodeTask struct {
Scene models.Scene
Overwrite bool
// is true, generate even if video is browser-supported
Force bool
// contains filtered or unexported fields
}
func (*GenerateTranscodeTask) GetDescription ¶
func (t *GenerateTranscodeTask) GetDescription() string
func (*GenerateTranscodeTask) Start ¶
func (t *GenerateTranscodeTask) Start(ctc context.Context)
type GradientTable ¶
func (GradientTable) GetInterpolatedColorFor ¶
func (gt GradientTable) GetInterpolatedColorFor(t float64) colorful.Color
type IdentifyJob ¶
type IdentifyJob struct {
// contains filtered or unexported fields
}
func CreateIdentifyJob ¶
func CreateIdentifyJob(input models.IdentifyMetadataInput) *IdentifyJob
type ImportTask ¶
type ImportTask struct {
BaseDir string
TmpZip string
Reset bool
DuplicateBehaviour models.ImportDuplicateEnum
MissingRefBehaviour models.ImportMissingRefEnum
// contains filtered or unexported fields
}
func CreateImportTask ¶
func CreateImportTask(a models.HashAlgorithm, input models.ImportObjectsInput) (*ImportTask, error)
func (*ImportTask) GetDescription ¶
func (t *ImportTask) GetDescription() string
func (*ImportTask) ImportGalleries ¶
func (t *ImportTask) ImportGalleries(ctx context.Context)
func (*ImportTask) ImportImages ¶
func (t *ImportTask) ImportImages(ctx context.Context)
func (*ImportTask) ImportMovies ¶
func (t *ImportTask) ImportMovies(ctx context.Context)
func (*ImportTask) ImportPerformers ¶
func (t *ImportTask) ImportPerformers(ctx context.Context)
func (*ImportTask) ImportScenes ¶
func (t *ImportTask) ImportScenes(ctx context.Context)
func (*ImportTask) ImportScrapedItems ¶
func (t *ImportTask) ImportScrapedItems(ctx context.Context)
func (*ImportTask) ImportStudio ¶
func (t *ImportTask) ImportStudio(studioJSON *jsonschema.Studio, pendingParent map[string][]*jsonschema.Studio, readerWriter models.StudioReaderWriter) error
func (*ImportTask) ImportStudios ¶
func (t *ImportTask) ImportStudios(ctx context.Context)
func (*ImportTask) ImportTag ¶
func (t *ImportTask) ImportTag(tagJSON *jsonschema.Tag, pendingParent map[string][]*jsonschema.Tag, fail bool, readerWriter models.TagReaderWriter) error
func (*ImportTask) ImportTags ¶
func (t *ImportTask) ImportTags(ctx context.Context)
func (*ImportTask) Start ¶
func (t *ImportTask) Start(ctx context.Context)
type InteractiveHeatmapSpeedGenerator ¶
type InteractiveHeatmapSpeedGenerator struct {
InteractiveSpeed int64
Funscript Script
FunscriptPath string
HeatmapPath string
Width int
Height int
NumSegments int
}
func NewInteractiveHeatmapSpeedGenerator ¶
func NewInteractiveHeatmapSpeedGenerator(funscriptPath string, heatmapPath string) *InteractiveHeatmapSpeedGenerator
func (*InteractiveHeatmapSpeedGenerator) Generate ¶
func (g *InteractiveHeatmapSpeedGenerator) Generate() error
func (*InteractiveHeatmapSpeedGenerator) LoadFunscriptData ¶
func (g *InteractiveHeatmapSpeedGenerator) LoadFunscriptData(path string) (Script, error)
func (*InteractiveHeatmapSpeedGenerator) RenderHeatmap ¶
func (g *InteractiveHeatmapSpeedGenerator) RenderHeatmap() error
funscript needs to have intensity updated first
type Manager ¶ added in v0.15.0
type Manager struct {
Config *config.Instance
Logger *log.Logger
Paths *paths.Paths
FFMPEG ffmpeg.FFMpeg
FFProbe ffmpeg.FFProbe
ReadLockManager *fsutil.ReadLockManager
SessionStore *session.Store
JobManager *job.Manager
PluginCache *plugin.Cache
ScraperCache *scraper.Cache
DownloadStore *DownloadStore
DLNAService *dlna.Service
TxnManager models.TransactionManager
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance() *Manager
func Initialize ¶
func (*Manager) GenerateDefaultScreenshot ¶ added in v0.15.0
func (*Manager) GenerateScreenshot ¶ added in v0.15.0
func (*Manager) GetSystemStatus ¶ added in v0.15.0
func (s *Manager) GetSystemStatus() *models.SystemStatus
func (*Manager) MigrateHash ¶ added in v0.15.0
func (*Manager) PostInit ¶ added in v0.15.0
PostInit initialises the paths, caches and txnManager after the initial configuration has been set. Should only be called if the configuration is valid.
func (*Manager) PostMigrate ¶ added in v0.15.0
PostMigrate is executed after migrations have been executed.
func (*Manager) RefreshConfig ¶ added in v0.15.0
func (s *Manager) RefreshConfig()
func (*Manager) RefreshScraperCache ¶ added in v0.15.0
func (s *Manager) RefreshScraperCache()
RefreshScraperCache refreshes the scraper cache. Call this when scraper configuration changes.
func (*Manager) RunPluginTask ¶ added in v0.15.0
func (*Manager) RunSingleTask ¶ added in v0.15.0
func (*Manager) ScanSubscribe ¶ added in v0.15.0
ScanSubscribe subscribes to a notification that is triggered when a scan or clean is complete.
func (*Manager) StashBoxBatchPerformerTag ¶ added in v0.15.0
type MigrateHashTask ¶
MigrateHashTask renames generated files between oshash and MD5 based on the value of the fileNamingAlgorithm flag.
type ScanTask ¶
type SceneFilenameParser ¶
type SceneFilenameParser struct {
Pattern string
ParserInput models.SceneParserInput
Filter *models.FindFilterType
// contains filtered or unexported fields
}
func NewSceneFilenameParser ¶
func NewSceneFilenameParser(filter *models.FindFilterType, config models.SceneParserInput) *SceneFilenameParser
func (*SceneFilenameParser) Parse ¶
func (p *SceneFilenameParser) Parse(repo models.ReaderRepository) ([]*models.SceneParserResult, int, error)
type SceneServer ¶
type SceneServer struct {
TXNManager models.TransactionManager
}
func (*SceneServer) ServeScreenshot ¶
func (s *SceneServer) ServeScreenshot(scene *models.Scene, w http.ResponseWriter, r *http.Request)
func (*SceneServer) StreamSceneDirect ¶
func (s *SceneServer) StreamSceneDirect(scene *models.Scene, w http.ResponseWriter, r *http.Request)
type Script ¶
type Script struct {
// Version of Launchscript
Version string `json:"version"`
// Inverted causes up and down movement to be flipped.
Inverted bool `json:"inverted,omitempty"`
// Range is the percentage of a full stroke to use.
Range int `json:"range,omitempty"`
// Actions are the timed moves.
Actions []Action `json:"actions"`
AvarageSpeed int64
}
func (*Script) CalculateMedian ¶
func (*Script) UpdateIntensityAndSpeed ¶
func (funscript *Script) UpdateIntensityAndSpeed()
type SpriteGenerator ¶
type SpriteGenerator struct {
Info *generatorInfo
VideoChecksum string
ImageOutputPath string
VTTOutputPath string
Rows int
Columns int
SlowSeek bool // use alternate seek function, very slow!
Overwrite bool
// contains filtered or unexported fields
}
func NewSpriteGenerator ¶
func (*SpriteGenerator) Generate ¶
func (g *SpriteGenerator) Generate() error
type StashBoxPerformerTagTask ¶
type StashBoxPerformerTagTask struct {
// contains filtered or unexported fields
}
func (*StashBoxPerformerTagTask) Description ¶
func (t *StashBoxPerformerTagTask) Description() string
func (*StashBoxPerformerTagTask) Start ¶
func (t *StashBoxPerformerTagTask) Start(ctx context.Context)
type StreamRequestContext ¶ added in v0.15.0
type StreamRequestContext struct {
context.Context
ResponseWriter http.ResponseWriter
}
func NewStreamRequestContext ¶ added in v0.15.0
func NewStreamRequestContext(w http.ResponseWriter, r *http.Request) *StreamRequestContext
func (*StreamRequestContext) Cancel ¶ added in v0.15.0
func (c *StreamRequestContext) Cancel()
Source Files
¶
- apikey.go
- checksum.go
- downloads.go
- exclude_files.go
- favicon.go
- filename_parser.go
- gallery.go
- generator.go
- generator_interactive_heatmap_speed.go
- generator_sprite.go
- image.go
- import.go
- json_utils.go
- log.go
- manager.go
- manager_tasks.go
- post_migrate.go
- running_streams.go
- scene.go
- studio.go
- subscribe.go
- task.go
- task_autotag.go
- task_clean.go
- task_export.go
- task_generate.go
- task_generate_interactive_heatmap_speed.go
- task_generate_markers.go
- task_generate_phash.go
- task_generate_preview.go
- task_generate_screenshot.go
- task_generate_sprite.go
- task_identify.go
- task_import.go
- task_migrate_hash.go
- task_plugin.go
- task_scan.go
- task_scan_gallery.go
- task_scan_image.go
- task_scan_scene.go
- task_stash_box_tag.go
- task_transcode.go