library

package
v0.0.0-...-e05c83d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVideoFilesFromDir

func GetVideoFilesFromDir(dirToSearch string) ([]string, error)

GetVideoFilesFromDir returns a string slice of video files, found recursively from dirToSearch.

Types

type Cache

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

Cache sits in front of a MetadataReader and only calls it for a Read call when the file has updated(based on the modtime)

func NewCache

NewCache returns a new Cache.

func (*Cache) Read

func (c *Cache) Read(path string) (controller.FileMetadata, error)

Read uses the data storer and file.Stat to determine whether or not to call the MetadataReader or return from the cache.

type CommandDecider

type CommandDecider interface {
	Decide(m controller.FileMetadata, cmdDeciderSettings string) (cmd []string, err error)
	DefaultSettings() string
}

The CommandDecider interface defines how a CommandDecider should behave.

type Manager

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

Manager satisfies the conroller.LibraryManager interface.

func NewManager

func NewManager(logger controller.Logger, ds controller.LibraryManagerDataStorer, metadataReader MetadataReader, commandDecider CommandDecider) Manager

NewManager return a new Manager.

func (*Manager) ImportCompletedJobs

func (m *Manager) ImportCompletedJobs(jobs []controller.CompletedJob)

ImportCompletedJobs takes a list of completed jobs and imports them and their files into the system.

func (*Manager) LibrarySettings

func (m *Manager) LibrarySettings() ([]controller.Library, error)

LibrarySettings returns the current settings of each library in the data store.

func (*Manager) PopNewJob

func (m *Manager) PopNewJob() (controller.Job, error)

PopNewJob returns and deletes a job from the library queues in order of priority.

func (*Manager) Start

func (m *Manager) Start(ctx *context.Context, wg *sync.WaitGroup)

Start starts the library manager without blocking the thread.

func (*Manager) UpdateLibrarySettings

func (m *Manager) UpdateLibrarySettings(libSettings map[int]controller.Library)

UpdateLibrarySettings loops through each entry in the provided map and applies the new settings if the key matches a valid library. However, it will not update the ID and Queue fields. If the key doesn't match a valid library, a brand new one with the provided settings is created.

type MetadataReader

type MetadataReader interface {
	Read(path string) (controller.FileMetadata, error)
}

The MetadataReader interface defines how a MetadataReader should behave.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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