manager

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: AGPL-3.0 Imports: 73 Imported by: 0

Documentation

Index

Constants

View Source
const APIKeySubject = "APIKey"

Variables

View Source
var ErrInput = errors.New("invalid request input")
View Source
var ErrInvalidToken = errors.New("invalid apikey")

Functions

func ConvertFunscriptToCSV added in v0.22.0

func ConvertFunscriptToCSV(funscriptPath string) ([]byte, error)

func ConvertFunscriptToCSVFile added in v0.22.0

func ConvertFunscriptToCSVFile(funscriptPath string, csvPath string) error

func GenerateAPIKey

func GenerateAPIKey(userID string) (string, error)

func GetUserIDFromAPIKey

func GetUserIDFromAPIKey(apiKey string) (string, error)

GetUserIDFromAPIKey validates the provided api key and returns the user ID

func GetVideoFileContainer added in v0.17.0

func GetVideoFileContainer(file *models.VideoFile) (ffmpeg.Container, 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 KillRunningStreams

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

func ValidateVideoFileNamingAlgorithm

func ValidateVideoFileNamingAlgorithm(ctx context.Context, qb SceneMissingHashCounter, 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.RegisteredClaims
}

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

type AutoTagMetadataInput struct {
	// Paths to tag, null for all files
	Paths []string `json:"paths"`
	// IDs of performers to tag files with, or "*" for all
	Performers []string `json:"performers"`
	// IDs of studios to tag files with, or "*" for all
	Studios []string `json:"studios"`
	// IDs of tags to tag files with, or "*" for all
	Tags []string `json:"tags"`
}

type CleanMetadataInput added in v0.17.0

type CleanMetadataInput struct {
	Paths []string `json:"paths"`
	// Do a dry run. Don't delete any files
	DryRun bool `json:"dryRun"`
}

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 (s *DownloadStore) RegisterFile(fp string, contentType string, keep bool) (string, error)

func (*DownloadStore) Serve

func (s *DownloadStore) Serve(hash string, w http.ResponseWriter, r *http.Request)

type ExportObjectTypeInput added in v0.17.0

type ExportObjectTypeInput struct {
	Ids []string `json:"ids"`
	All *bool    `json:"all"`
}

type ExportObjectsInput added in v0.17.0

type ExportObjectsInput struct {
	Scenes              *ExportObjectTypeInput `json:"scenes"`
	Images              *ExportObjectTypeInput `json:"images"`
	Studios             *ExportObjectTypeInput `json:"studios"`
	Performers          *ExportObjectTypeInput `json:"performers"`
	Tags                *ExportObjectTypeInput `json:"tags"`
	Movies              *ExportObjectTypeInput `json:"movies"`
	Galleries           *ExportObjectTypeInput `json:"galleries"`
	IncludeDependencies *bool                  `json:"includeDependencies"`
}

type ExportTask

type ExportTask struct {
	DownloadHash string
	// contains filtered or unexported fields
}

func CreateExportTask

func CreateExportTask(a models.HashAlgorithm, input ExportObjectsInput) *ExportTask

func (*ExportTask) ExportGalleries

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

func (*ExportTask) ExportImages

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

func (*ExportTask) ExportMovies

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) ExportStudios

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

func (*ExportTask) ExportTags

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

func (*ExportTask) Start

func (t *ExportTask) Start(ctx context.Context, wg *sync.WaitGroup)

type GalleryService added in v0.17.0

type GalleryService interface {
	AddImages(ctx context.Context, g *models.Gallery, toAdd ...int) error
	RemoveImages(ctx context.Context, g *models.Gallery, toRemove ...int) error

	Destroy(ctx context.Context, i *models.Gallery, fileDeleter *image.FileDeleter, deleteGenerated, deleteFile bool) ([]*models.Image, error)

	ValidateImageGalleryChange(ctx context.Context, i *models.Image, updateIDs models.UpdateIDs) error

	Updated(ctx context.Context, galleryID int) error
}

type GenerateClipPreviewTask added in v0.21.0

type GenerateClipPreviewTask struct {
	Image     models.Image
	Overwrite bool
}

func (*GenerateClipPreviewTask) GetDescription added in v0.21.0

func (t *GenerateClipPreviewTask) GetDescription() string

func (*GenerateClipPreviewTask) Start added in v0.21.0

func (t *GenerateClipPreviewTask) Start(ctx context.Context)

type GenerateCoverTask added in v0.20.0

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

func (*GenerateCoverTask) GetDescription added in v0.20.0

func (t *GenerateCoverTask) GetDescription() string

func (*GenerateCoverTask) Start added in v0.20.0

func (t *GenerateCoverTask) Start(ctx context.Context)

type GenerateInteractiveHeatmapSpeedTask

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

func (*GenerateInteractiveHeatmapSpeedTask) GetDescription

func (t *GenerateInteractiveHeatmapSpeedTask) GetDescription() string

func (*GenerateInteractiveHeatmapSpeedTask) Start

type GenerateJob

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

func (*GenerateJob) Execute

func (j *GenerateJob) Execute(ctx context.Context, progress *job.Progress)

type GenerateMarkersTask

type GenerateMarkersTask struct {
	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 GenerateMetadataInput added in v0.17.0

type GenerateMetadataInput struct {
	Covers              bool                         `json:"covers"`
	Sprites             bool                         `json:"sprites"`
	Previews            bool                         `json:"previews"`
	ImagePreviews       bool                         `json:"imagePreviews"`
	PreviewOptions      *GeneratePreviewOptionsInput `json:"previewOptions"`
	Markers             bool                         `json:"markers"`
	MarkerImagePreviews bool                         `json:"markerImagePreviews"`
	MarkerScreenshots   bool                         `json:"markerScreenshots"`
	Transcodes          bool                         `json:"transcodes"`
	// Generate transcodes even if not required
	ForceTranscodes           bool `json:"forceTranscodes"`
	Phashes                   bool `json:"phashes"`
	InteractiveHeatmapsSpeeds bool `json:"interactiveHeatmapsSpeeds"`
	ClipPreviews              bool `json:"clipPreviews"`
	// scene ids to generate for
	SceneIDs []string `json:"sceneIDs"`
	// marker ids to generate for
	MarkerIDs []string `json:"markerIDs"`
	// overwrite existing media
	Overwrite bool `json:"overwrite"`
}

type GeneratePhashTask

type GeneratePhashTask struct {
	File      *models.VideoFile
	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 GeneratePreviewOptionsInput added in v0.17.0

type GeneratePreviewOptionsInput struct {
	// Number of segments in a preview file
	PreviewSegments *int `json:"previewSegments"`
	// Preview segment duration, in seconds
	PreviewSegmentDuration *float64 `json:"previewSegmentDuration"`
	// Duration of start of video to exclude when generating previews
	PreviewExcludeStart *string `json:"previewExcludeStart"`
	// Duration of end of video to exclude when generating previews
	PreviewExcludeEnd *string `json:"previewExcludeEnd"`
	// Preset when generating preview
	PreviewPreset *models.PreviewPreset `json:"previewPreset"`
}

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

type GradientTable []struct {
	Col    colorful.Color
	Pos    float64
	YRange [2]float64
}

func (GradientTable) GetInterpolatedColorFor

func (gt GradientTable) GetInterpolatedColorFor(t float64) colorful.Color

func (GradientTable) GetYRange added in v0.20.0

func (gt GradientTable) GetYRange(t float64) [2]float64

type IdentifyJob

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

func CreateIdentifyJob

func CreateIdentifyJob(input identify.Options) *IdentifyJob

func (*IdentifyJob) Execute

func (j *IdentifyJob) Execute(ctx context.Context, progress *job.Progress)

type ImageService added in v0.17.0

type ImageService interface {
	Destroy(ctx context.Context, image *models.Image, fileDeleter *image.FileDeleter, deleteGenerated, deleteFile bool) error
	DestroyZipImages(ctx context.Context, zipFile models.File, fileDeleter *image.FileDeleter, deleteGenerated bool) ([]*models.Image, error)
}

type ImportDuplicateEnum added in v0.17.0

type ImportDuplicateEnum string
const (
	ImportDuplicateEnumIgnore    ImportDuplicateEnum = "IGNORE"
	ImportDuplicateEnumOverwrite ImportDuplicateEnum = "OVERWRITE"
	ImportDuplicateEnumFail      ImportDuplicateEnum = "FAIL"
)

func (ImportDuplicateEnum) IsValid added in v0.17.0

func (e ImportDuplicateEnum) IsValid() bool

func (ImportDuplicateEnum) MarshalGQL added in v0.17.0

func (e ImportDuplicateEnum) MarshalGQL(w io.Writer)

func (ImportDuplicateEnum) String added in v0.17.0

func (e ImportDuplicateEnum) String() string

func (*ImportDuplicateEnum) UnmarshalGQL added in v0.17.0

func (e *ImportDuplicateEnum) UnmarshalGQL(v interface{}) error

type ImportObjectsInput added in v0.17.0

type ImportObjectsInput struct {
	File                graphql.Upload              `json:"file"`
	DuplicateBehaviour  ImportDuplicateEnum         `json:"duplicateBehaviour"`
	MissingRefBehaviour models.ImportMissingRefEnum `json:"missingRefBehaviour"`
}

type ImportTask

type ImportTask struct {
	BaseDir             string
	TmpZip              string
	Reset               bool
	DuplicateBehaviour  ImportDuplicateEnum
	MissingRefBehaviour models.ImportMissingRefEnum
	// contains filtered or unexported fields
}

func CreateImportTask

func CreateImportTask(a models.HashAlgorithm, input ImportObjectsInput) (*ImportTask, error)

func (*ImportTask) GetDescription

func (t *ImportTask) GetDescription() string

func (*ImportTask) ImportFiles added in v0.17.0

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

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) 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(ctx context.Context)

type InteractiveHeatmapSpeedGenerator

type InteractiveHeatmapSpeedGenerator struct {
	InteractiveSpeed int
	Funscript        Script
	Width            int
	Height           int
	NumSegments      int

	DrawRange bool
}

func NewInteractiveHeatmapSpeedGenerator

func NewInteractiveHeatmapSpeedGenerator(drawRange bool) *InteractiveHeatmapSpeedGenerator

func (*InteractiveHeatmapSpeedGenerator) Generate

func (g *InteractiveHeatmapSpeedGenerator) Generate(funscriptPath string, heatmapPath string, sceneDuration float64) error

func (*InteractiveHeatmapSpeedGenerator) LoadFunscriptData

func (g *InteractiveHeatmapSpeedGenerator) LoadFunscriptData(path string, sceneDuration float64) (Script, error)

func (*InteractiveHeatmapSpeedGenerator) RenderHeatmap

func (g *InteractiveHeatmapSpeedGenerator) RenderHeatmap(heatmapPath string, sceneDurationMilli int64) error

funscript needs to have intensity updated first

type Manager added in v0.15.0

type Manager struct {
	Config *config.Config
	Logger *log.Logger

	Paths *paths.Paths

	FFMpeg        *ffmpeg.FFMpeg
	FFProbe       ffmpeg.FFProbe
	StreamManager *ffmpeg.StreamManager

	JobManager      *job.Manager
	ReadLockManager *fsutil.ReadLockManager

	DownloadStore *DownloadStore
	SessionStore  *session.Store

	PluginCache  *plugin.Cache
	ScraperCache *scraper.Cache

	PluginPackageManager  *pkg.Manager
	ScraperPackageManager *pkg.Manager

	DLNAService *dlna.Service

	Database   *sqlite.Database
	Repository models.Repository

	SceneService   SceneService
	ImageService   ImageService
	GalleryService GalleryService
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Manager

func Initialize

func Initialize(cfg *config.Config, l *log.Logger) (*Manager, error)

Called at startup

func (*Manager) AnonymiseDatabase added in v0.24.0

func (s *Manager) AnonymiseDatabase(download bool) (string, string, error)

func (*Manager) AutoTag added in v0.15.0

func (s *Manager) AutoTag(ctx context.Context, input AutoTagMetadataInput) int

func (*Manager) BackupDatabase added in v0.24.0

func (s *Manager) BackupDatabase(download bool) (string, string, error)

func (*Manager) Clean added in v0.15.0

func (s *Manager) Clean(ctx context.Context, input CleanMetadataInput) int

func (*Manager) Export added in v0.15.0

func (s *Manager) Export(ctx context.Context) (int, error)

func (*Manager) Generate added in v0.15.0

func (s *Manager) Generate(ctx context.Context, input GenerateMetadataInput) (int, error)

func (*Manager) GenerateDefaultScreenshot added in v0.15.0

func (s *Manager) GenerateDefaultScreenshot(ctx context.Context, sceneId string) int

func (*Manager) GenerateScreenshot added in v0.15.0

func (s *Manager) GenerateScreenshot(ctx context.Context, sceneId string, at float64) int

func (*Manager) GetSystemStatus added in v0.15.0

func (s *Manager) GetSystemStatus() *SystemStatus

func (*Manager) Import added in v0.15.0

func (s *Manager) Import(ctx context.Context) (int, error)

func (*Manager) Migrate added in v0.15.0

func (s *Manager) Migrate(ctx context.Context, input MigrateInput) error

func (*Manager) MigrateHash added in v0.15.0

func (s *Manager) MigrateHash(ctx context.Context) int

func (*Manager) OptimiseDatabase added in v0.22.0

func (s *Manager) OptimiseDatabase(ctx context.Context) int

func (*Manager) RefreshConfig added in v0.15.0

func (s *Manager) RefreshConfig()

func (*Manager) RefreshDLNA added in v0.24.0

func (s *Manager) RefreshDLNA()

RefreshDLNA starts/stops the DLNA service as needed.

func (*Manager) RefreshPluginCache added in v0.24.0

func (s *Manager) RefreshPluginCache()

RefreshPluginCache refreshes the plugin cache. Call this when the plugin configuration changes.

func (*Manager) RefreshPluginSourceManager added in v0.24.0

func (s *Manager) RefreshPluginSourceManager()

func (*Manager) RefreshScraperCache added in v0.15.0

func (s *Manager) RefreshScraperCache()

RefreshScraperCache refreshes the scraper cache. Call this when the scraper configuration changes.

func (*Manager) RefreshScraperSourceManager added in v0.24.0

func (s *Manager) RefreshScraperSourceManager()

func (*Manager) RefreshStreamManager added in v0.20.0

func (s *Manager) RefreshStreamManager()

RefreshStreamManager refreshes the stream manager. Call this when the cache directory changes.

func (*Manager) RunPluginTask added in v0.15.0

func (s *Manager) RunPluginTask(ctx context.Context, pluginID string, taskName string, args []*plugin.PluginArgInput) int

func (*Manager) RunSingleTask added in v0.15.0

func (s *Manager) RunSingleTask(ctx context.Context, t Task) int

func (*Manager) Scan added in v0.15.0

func (s *Manager) Scan(ctx context.Context, input ScanMetadataInput) (int, error)

func (*Manager) ScanSubscribe added in v0.15.0

func (s *Manager) ScanSubscribe(ctx context.Context) <-chan bool

ScanSubscribe subscribes to a notification that is triggered when a scan or clean is complete.

func (*Manager) SetBlobStoreOptions added in v0.20.0

func (s *Manager) SetBlobStoreOptions()

func (*Manager) Setup added in v0.15.0

func (s *Manager) Setup(ctx context.Context, input SetupInput) error

func (*Manager) Shutdown added in v0.15.0

func (s *Manager) Shutdown()

Shutdown gracefully stops the manager

func (*Manager) StashBoxBatchPerformerTag added in v0.15.0

func (s *Manager) StashBoxBatchPerformerTag(ctx context.Context, input StashBoxBatchTagInput) int

func (*Manager) StashBoxBatchStudioTag added in v0.22.0

func (s *Manager) StashBoxBatchStudioTag(ctx context.Context, input StashBoxBatchTagInput) int

type MigrateHashTask

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

func (t *MigrateHashTask) Start()

Start starts the task.

type MigrateInput added in v0.17.0

type MigrateInput struct {
	BackupPath string `json:"backupPath"`
}

type OptimiseDatabaseJob added in v0.22.0

type OptimiseDatabaseJob struct {
	Optimiser Optimiser
}

func (*OptimiseDatabaseJob) Execute added in v0.22.0

func (j *OptimiseDatabaseJob) Execute(ctx context.Context, progress *job.Progress)

type Optimiser added in v0.22.0

type Optimiser interface {
	Analyze(ctx context.Context) error
	Vacuum(ctx context.Context) error
}

type Resetter added in v0.24.0

type Resetter interface {
	Reset() error
}

type ScanJob

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

func (*ScanJob) Execute

func (j *ScanJob) Execute(ctx context.Context, progress *job.Progress)

type ScanMetaDataFilterInput added in v0.17.0

type ScanMetaDataFilterInput struct {
	// If set, files with a modification time before this time point are ignored by the scan
	MinModTime *time.Time `json:"minModTime"`
}

Filter options for meta data scannning

type ScanMetadataInput added in v0.17.0

type ScanMetadataInput struct {
	Paths []string `json:"paths"`

	config.ScanMetadataOptions `mapstructure:",squash"`

	// Filter options for the scan
	Filter *ScanMetaDataFilterInput `json:"filter"`
}

type SceneCoverGetter added in v0.17.0

type SceneCoverGetter interface {
	GetCover(ctx context.Context, sceneID int) ([]byte, error)
}

type SceneMissingHashCounter added in v0.17.0

type SceneMissingHashCounter interface {
	CountMissingChecksum(ctx context.Context) (int, error)
	CountMissingOSHash(ctx context.Context) (int, error)
}

type SceneServer

type SceneServer struct {
	TxnManager       txn.Manager
	SceneCoverGetter SceneCoverGetter
}

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

type SceneService interface {
	Create(ctx context.Context, input *models.Scene, fileIDs []models.FileID, coverImage []byte) (*models.Scene, error)
	AssignFile(ctx context.Context, sceneID int, fileID models.FileID) error
	Merge(ctx context.Context, sourceIDs []int, destinationID int, values models.ScenePartial) error
	Destroy(ctx context.Context, scene *models.Scene, fileDeleter *scene.FileDeleter, deleteGenerated, deleteFile bool) error
}

type SceneStreamEndpoint added in v0.17.0

type SceneStreamEndpoint struct {
	URL      string  `json:"url"`
	MimeType *string `json:"mime_type"`
	Label    *string `json:"label"`
}

func GetSceneStreamPaths

func GetSceneStreamPaths(scene *models.Scene, directStreamURL *url.URL, maxStreamingTranscodeSize models.StreamingResolutionEnum) ([]*SceneStreamEndpoint, error)

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

func LoadFunscriptData added in v0.22.0

func LoadFunscriptData(path string) (Script, error)

func (*Script) CalculateMedian

func (funscript *Script) CalculateMedian() int

func (*Script) UpdateIntensityAndSpeed

func (funscript *Script) UpdateIntensityAndSpeed()

type SetupInput added in v0.17.0

type SetupInput struct {
	// Empty to indicate $HOME/.stash/config.yml default
	ConfigLocation string                     `json:"configLocation"`
	Stashes        []*config.StashConfigInput `json:"stashes"`
	// Empty to indicate default
	DatabaseFile string `json:"databaseFile"`
	// Empty to indicate default
	GeneratedLocation string `json:"generatedLocation"`
	// Empty to indicate default
	CacheLocation string `json:"cacheLocation"`

	StoreBlobsInDatabase bool `json:"storeBlobsInDatabase"`
	// Empty to indicate default
	BlobsLocation string `json:"blobsLocation"`
}

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 NewSpriteGenerator(videoFile ffmpeg.VideoFile, videoChecksum string, imageOutputPath string, vttOutputPath string, rows int, cols int) (*SpriteGenerator, error)

func (*SpriteGenerator) Generate

func (g *SpriteGenerator) Generate() error

type StashBoxBatchTagInput added in v0.22.0

type StashBoxBatchTagInput struct {
	// Stash endpoint to use for the tagging
	Endpoint int `json:"endpoint"`
	// Fields to exclude when executing the tagging
	ExcludeFields []string `json:"exclude_fields"`
	// Refresh items already tagged by StashBox if true. Only tag items with no StashBox tagging if false
	Refresh bool `json:"refresh"`
	// If batch adding studios, should their parent studios also be created?
	CreateParent bool `json:"createParent"`
	// If set, only tag these ids
	Ids []string `json:"ids"`
	// If set, only tag these names
	Names []string `json:"names"`
	// If set, only tag these performer ids
	//
	// Deprecated: please use Ids
	PerformerIds []string `json:"performer_ids"`
	// If set, only tag these performer names
	//
	// Deprecated: please use Names
	PerformerNames []string `json:"performer_names"`
}

If neither ids nor names are set, tag all items

type StashBoxBatchTagTask added in v0.22.0

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

func (*StashBoxBatchTagTask) Description added in v0.22.0

func (t *StashBoxBatchTagTask) Description() string

func (*StashBoxBatchTagTask) Start added in v0.22.0

func (t *StashBoxBatchTagTask) Start(ctx context.Context)

type StashBoxTagTaskType added in v0.22.0

type StashBoxTagTaskType int
const (
	Performer StashBoxTagTaskType = iota
	Studio
)

type SystemStatus added in v0.17.0

type SystemStatus struct {
	DatabaseSchema *int             `json:"databaseSchema"`
	DatabasePath   *string          `json:"databasePath"`
	ConfigPath     *string          `json:"configPath"`
	AppSchema      int              `json:"appSchema"`
	Status         SystemStatusEnum `json:"status"`
	Os             string           `json:"os"`
	WorkingDir     string           `json:"working_dir"`
	HomeDir        string           `json:"home_dir"`
}

type SystemStatusEnum added in v0.17.0

type SystemStatusEnum string
const (
	SystemStatusEnumSetup          SystemStatusEnum = "SETUP"
	SystemStatusEnumNeedsMigration SystemStatusEnum = "NEEDS_MIGRATION"
	SystemStatusEnumOk             SystemStatusEnum = "OK"
)

func (SystemStatusEnum) IsValid added in v0.17.0

func (e SystemStatusEnum) IsValid() bool

func (SystemStatusEnum) MarshalGQL added in v0.17.0

func (e SystemStatusEnum) MarshalGQL(w io.Writer)

func (SystemStatusEnum) String added in v0.17.0

func (e SystemStatusEnum) String() string

func (*SystemStatusEnum) UnmarshalGQL added in v0.17.0

func (e *SystemStatusEnum) UnmarshalGQL(v interface{}) error

type Task

type Task interface {
	Start(context.Context)
	GetDescription() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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