manager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteGeneratedSceneFiles

func DeleteGeneratedSceneFiles(scene *models.Scene, fileNamingAlgo models.HashAlgorithm)

DeleteGeneratedSceneFiles deletes generated files for the provided scene.

func DeleteSceneFile

func DeleteSceneFile(scene *models.Scene)

DeleteSceneFile deletes the scene video file from the filesystem.

func DeleteSceneMarkerFiles added in v0.2.0

func DeleteSceneMarkerFiles(scene *models.Scene, seconds int, fileNamingAlgo models.HashAlgorithm)

DeleteSceneMarkerFiles deletes generated files for a scene marker with the provided scene and timestamp.

func DestroyScene

func DestroyScene(sceneID int, tx *sqlx.Tx) error

DestroyScene deletes a scene and its associated relationships from the database.

func EnsureTagNameUnique added in v0.3.0

func EnsureTagNameUnique(tag models.Tag, tx *sqlx.Tx) error

func GetInstance

func GetInstance() *singleton

func GetSceneFileContainer added in v0.3.0

func GetSceneFileContainer(scene *models.Scene) (ffmpeg.Container, error)

func GetSceneStreamPaths added in v0.3.0

func GetSceneStreamPaths(scene *models.Scene, directStreamURL string) ([]*models.SceneStreamEndpoint, error)

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 Initialize

func Initialize() *singleton

func KillRunningStreams

func KillRunningStreams(path string)

func RegisterStream

func RegisterStream(filepath string, w *http.ResponseWriter)

func SetSceneScreenshot

func SetSceneScreenshot(checksum string, imageData []byte) error

func ValidateModifyStudio added in v0.3.0

func ValidateModifyStudio(studio models.StudioPartial, tx *sqlx.Tx) error

func ValidateVideoFileNamingAlgorithm added in v0.3.0

func ValidateVideoFileNamingAlgorithm(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.

func WaitAndDeregisterStream

func WaitAndDeregisterStream(filepath string, w *http.ResponseWriter, r *http.Request)

Types

type AutoTagPerformerTask

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

func (*AutoTagPerformerTask) Start

func (t *AutoTagPerformerTask) Start(wg *sync.WaitGroup)

type AutoTagStudioTask

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

func (*AutoTagStudioTask) Start

func (t *AutoTagStudioTask) Start(wg *sync.WaitGroup)

type AutoTagTagTask

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

func (*AutoTagTagTask) Start

func (t *AutoTagTagTask) Start(wg *sync.WaitGroup)

type CleanTask

type CleanTask struct {
	Scene   *models.Scene
	Gallery *models.Gallery
	// contains filtered or unexported fields
}

func (*CleanTask) Start

func (t *CleanTask) Start(wg *sync.WaitGroup)

type ExportTask

type ExportTask struct {
	Mappings *jsonschema.Mappings
	Scraped  []jsonschema.ScrapedItem
	// contains filtered or unexported fields
}

func (*ExportTask) ExportGalleries

func (t *ExportTask) ExportGalleries(ctx context.Context)

func (*ExportTask) ExportMovies added in v0.2.0

func (t *ExportTask) ExportMovies(ctx context.Context, workers int)

func (*ExportTask) ExportPerformers

func (t *ExportTask) ExportPerformers(ctx context.Context, workers int)

func (*ExportTask) ExportScenes

func (t *ExportTask) ExportScenes(ctx context.Context, workers int)

func (*ExportTask) ExportScrapedItems

func (t *ExportTask) ExportScrapedItems(ctx context.Context)

func (*ExportTask) ExportStudios

func (t *ExportTask) ExportStudios(ctx context.Context, workers int)

func (*ExportTask) ExportTags added in v0.3.0

func (t *ExportTask) ExportTags(ctx context.Context, workers int)

func (*ExportTask) Start

func (t *ExportTask) Start(wg *sync.WaitGroup)

type GenerateGthumbsTask added in v0.2.0

type GenerateGthumbsTask struct {
	Gallery   models.Gallery
	Overwrite bool
}

func (*GenerateGthumbsTask) Start added in v0.2.0

func (t *GenerateGthumbsTask) Start(wg *sync.WaitGroup)

type GenerateMarkersTask

type GenerateMarkersTask struct {
	Scene     *models.Scene
	Marker    *models.SceneMarker
	Overwrite bool
	// contains filtered or unexported fields
}

func (*GenerateMarkersTask) Start

func (t *GenerateMarkersTask) Start(wg *sync.WaitGroup)

type GeneratePreviewTask

type GeneratePreviewTask struct {
	Scene        models.Scene
	ImagePreview bool

	Options models.GeneratePreviewOptionsInput

	Overwrite bool
	// contains filtered or unexported fields
}

func (*GeneratePreviewTask) Start

func (t *GeneratePreviewTask) Start(wg *sync.WaitGroup)

type GenerateScreenshotTask added in v0.2.0

type GenerateScreenshotTask struct {
	Scene        models.Scene
	ScreenshotAt *float64
	// contains filtered or unexported fields
}

func (*GenerateScreenshotTask) Start added in v0.2.0

func (t *GenerateScreenshotTask) Start(wg *sync.WaitGroup)

type GenerateSpriteTask

type GenerateSpriteTask struct {
	Scene     models.Scene
	Overwrite bool
	// contains filtered or unexported fields
}

func (*GenerateSpriteTask) Start

func (t *GenerateSpriteTask) Start(wg *sync.WaitGroup)

type GenerateTranscodeTask

type GenerateTranscodeTask struct {
	Scene     models.Scene
	Overwrite bool
	// contains filtered or unexported fields
}

func (*GenerateTranscodeTask) Start

func (t *GenerateTranscodeTask) Start(wg *sync.WaitGroup)

type GeneratorInfo

type GeneratorInfo struct {
	ChunkCount     int
	FrameRate      float64
	NumberOfFrames int

	// NthFrame used for sprite generation
	NthFrame int

	ChunkDuration float64
	ExcludeStart  string
	ExcludeEnd    string

	VideoFile ffmpeg.VideoFile
}

type ImportTask

type ImportTask struct {
	Mappings *jsonschema.Mappings
	Scraped  []jsonschema.ScrapedItem
	// contains filtered or unexported fields
}

func (*ImportTask) ImportGalleries

func (t *ImportTask) ImportGalleries(ctx context.Context)

func (*ImportTask) ImportMovies added in v0.2.0

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

func (t *ImportTask) ImportStudio(studioJSON *jsonschema.Studio, pendingParent map[string][]*jsonschema.Studio, tx *sqlx.Tx) error

func (*ImportTask) ImportStudios

func (t *ImportTask) ImportStudios(ctx context.Context)

func (*ImportTask) ImportTags

func (t *ImportTask) ImportTags(ctx context.Context)

func (*ImportTask) Start

func (t *ImportTask) Start(wg *sync.WaitGroup)

type JobStatus

type JobStatus int
const (
	Idle            JobStatus = 0
	Import          JobStatus = 1
	Export          JobStatus = 2
	Scan            JobStatus = 3
	Generate        JobStatus = 4
	Clean           JobStatus = 5
	Scrape          JobStatus = 6
	AutoTag         JobStatus = 7
	Migrate         JobStatus = 8
	PluginOperation JobStatus = 9
)

func (JobStatus) String

func (s JobStatus) String() string

type MigrateHashTask added in v0.3.0

type MigrateHashTask struct {
	Scene *models.Scene
	// contains filtered or unexported fields
}

MigrateHashTask renames generated files between oshash and MD5 based on the value of the fileNamingAlgorithm flag.

func (*MigrateHashTask) Start added in v0.3.0

func (t *MigrateHashTask) Start(wg *sync.WaitGroup)

Start starts the task.

type PreviewGenerator

type PreviewGenerator struct {
	Info *GeneratorInfo

	VideoFilename   string
	ImageFilename   string
	OutputDirectory string

	GenerateVideo bool
	GenerateImage bool

	PreviewPreset string

	Overwrite bool
}

func NewPreviewGenerator

func NewPreviewGenerator(videoFile ffmpeg.VideoFile, videoFilename string, imageFilename string, outputDirectory string, generateVideo bool, generateImage bool, previewPreset string) (*PreviewGenerator, error)

func (*PreviewGenerator) Generate

func (g *PreviewGenerator) Generate() error

type ScanTask

type ScanTask struct {
	FilePath        string
	UseFileMetadata bool
	// contains filtered or unexported fields
}

func (*ScanTask) Start

func (t *ScanTask) Start(wg *sync.WaitGroup)

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

type SpriteGenerator

type SpriteGenerator struct {
	Info *GeneratorInfo

	ImageOutputPath string
	VTTOutputPath   string
	Rows            int
	Columns         int

	Overwrite bool
}

func NewSpriteGenerator

func NewSpriteGenerator(videoFile ffmpeg.VideoFile, imageOutputPath string, vttOutputPath string, rows int, cols int) (*SpriteGenerator, error)

func (*SpriteGenerator) Generate

func (g *SpriteGenerator) Generate() error

type Task

type Task interface {
	Start(wg *sync.WaitGroup)
}

type TaskStatus

type TaskStatus struct {
	Status     JobStatus
	Progress   float64
	LastUpdate time.Time
	// contains filtered or unexported fields
}

func (*TaskStatus) SetStatus

func (t *TaskStatus) SetStatus(s JobStatus)

func (*TaskStatus) Stop

func (t *TaskStatus) Stop() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳