managers

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const MinFileSize = 5e6 // 5MB

MinFileSize defines how big a file has to be to be indexed.

Variables

View Source
var SupportedExtensions = map[string]bool{
	".mp4":  true,
	".mkv":  true,
	".mov":  true,
	".avi":  true,
	".webm": true,
	".wmv":  true,
	".mpg":  true,
	".mpeg": true,
}

SupportedExtensions is a list of all extensions that we will scan as valid mediafiles.

Functions

func DatabaseStreamFromFfmpegStream added in v0.2.0

func DatabaseStreamFromFfmpegStream(s ffmpeg.Stream) db.Stream

DatabaseStreamFromFfmpegStream does the reverse of the above.

func FfmpegStreamFromDatabaseStream added in v0.2.0

func FfmpegStreamFromDatabaseStream(s db.Stream) ffmpeg.Stream

FfmpegStreamFromDatabaseStream creates a ffmpeg stream object based on a database object

func FileMissing added in v0.3.3

func FileMissing(m db.MediaFile) bool

FileMissing checks if the given media file is missing

func ValidFile

func ValidFile(node filesystem.Node) bool

ValidFile checks whether the supplied filepath is a file that can be indexed by the metadata server.

Types

type LibraryManager

type LibraryManager struct {
	Watcher *fsnotify.Watcher
	Pool    *WorkerPool
	Library *db.Library
	// contains filtered or unexported fields
}

LibraryManager manages all active libraries.

func NewLibraryManager

func NewLibraryManager(lib *db.Library, metadataManager *metadata.MetadataManager) *LibraryManager

NewLibraryManager creates a new LibraryManager

func (*LibraryManager) AddWatcher

func (man *LibraryManager) AddWatcher(filePath string)

AddWatcher adds a fsnotify watcher to the given path.

func (*LibraryManager) DeleteLibrary added in v0.3.3

func (man *LibraryManager) DeleteLibrary() error

DeleteLibrary deletes the underlying Library object in the database and all associated files. Shutdown() must be called before calling this function! After that, the LibraryManager object must be discarded, it is no longer valid.

func (*LibraryManager) IdentifyUnidentifiedEpisodeFiles added in v0.3.0

func (man *LibraryManager) IdentifyUnidentifiedEpisodeFiles() error

IdentifyUnidentifiedEpisodeFiles loops over all series with no tmdb information yet and attempts to retrieve the metadata.

func (*LibraryManager) IdentifyUnidentifiedFiles added in v0.3.0

func (man *LibraryManager) IdentifyUnidentifiedFiles()

IdentifyUnidentifiedFiles looks for missing metadata information and attempts to retrieve it.

func (*LibraryManager) IdentifyUnidentifiedMovieFiles added in v0.3.0

func (man *LibraryManager) IdentifyUnidentifiedMovieFiles() error

IdentifyUnidentifiedMovieFiles loops over all movies with no tmdb information yet and attempts to retrieve the metadata.

func (*LibraryManager) ProbeFile

func (man *LibraryManager) ProbeFile(n filesystem.Node) error

ProbeFile goes over the given file, creates a new entry in the database if required, and tries to associate the file with metadata based on the filename.

func (*LibraryManager) RecursiveProbe added in v0.3.3

func (man *LibraryManager) RecursiveProbe(rootNode filesystem.Node)

RecursiveProbe does what it says on the tin: recursively walks through a filesystem, starting from the given rootNode, adds watchers for all local subdirectories found, and probes any interesting files it finds along the way.

func (*LibraryManager) RefreshAll

func (man *LibraryManager) RefreshAll()

RefreshAll rescans all files and attempts to find missing metadata information.

func (*LibraryManager) RemoveMissingFiles added in v0.3.3

func (man *LibraryManager) RemoveMissingFiles(locator filesystem.FileLocator)

RemoveMissingFiles checks all files in the database to ensure they still exist; if not, it attempts to remove the MD information from the db.

func (*LibraryManager) RescanFilesystem added in v0.3.0

func (man *LibraryManager) RescanFilesystem()

RescanFilesystem goes over the filesystem and parses filenames in the given library.

func (*LibraryManager) Shutdown added in v0.3.0

func (man *LibraryManager) Shutdown()

Shutdown shuts down the LibraryManager, right now it's just about cleaning up the fsnotify watcher.

type WorkerPool added in v0.3.0

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

WorkerPool is a container for the various workers that a library needs

func NewDefaultWorkerPool added in v0.3.0

func NewDefaultWorkerPool() *WorkerPool

NewDefaultWorkerPool needs a description

func (*WorkerPool) Shutdown added in v0.3.0

func (p *WorkerPool) Shutdown()

Shutdown properly shuts down the WP

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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