managers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: GPL-3.0 Imports: 12 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 IsDir added in v0.1.2

func IsDir(filePath string) bool

IsDir checks whether the given path is a directory. TODO: This should probably leave in a helper function

func RefreshAgentMetadataForUUID

func RefreshAgentMetadataForUUID(UUID string) bool

RefreshAgentMetadataForUUID takes an UUID of a mediaitem and refreshes all metadata

func RefreshAgentMetadataWithMissingArt

func RefreshAgentMetadataWithMissingArt()

RefreshAgentMetadataWithMissingArt loops over all series/episodes/seasons and movies with missing art (posters/backdrop) and tries to retrieve them.

func RefreshAllMovieMD

func RefreshAllMovieMD() error

RefreshAllMovieMD refreshes all data from the agent and updates the database record.

func RefreshAllSeriesMD

func RefreshAllSeriesMD() error

RefreshAllSeriesMD refreshes all data from the agent and updates the database record.

func UpdateEpisodeMD

func UpdateEpisodeMD(ep *db.Episode, season *db.Season, series *db.Series) error

UpdateEpisodeMD updates the database record with the latest data from the agent

func UpdateMovieMD

func UpdateMovieMD(movie *db.Movie) error

UpdateMovieMD updates the database record with the latest data from the agent

func UpdateSeasonMD

func UpdateSeasonMD(season *db.Season, series *db.Series) error

UpdateSeasonMD updates the database record with the latest data from the agent

func UpdateSeriesMD

func UpdateSeriesMD(series *db.Series) error

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

func ValidFile

func ValidFile(filePath string) bool

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

Types

type LibraryManager

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

LibraryManager manages all active libraries.

func NewLibraryManager

func NewLibraryManager(watcher *fsnotify.Watcher) *LibraryManager

NewLibraryManager creates a new LibraryManager with a pool worker that can process episode information.

func (*LibraryManager) AddWatcher

func (man *LibraryManager) AddWatcher(filePath string)

AddWatcher adds a fsnotify watcher to the given path.

func (*LibraryManager) CheckRemovedFiles

func (man *LibraryManager) CheckRemovedFiles()

CheckRemovedFiles 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) IdentifyUnidentMovies

func (man *LibraryManager) IdentifyUnidentMovies(library *db.Library) error

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

func (*LibraryManager) IdentifyUnidentSeries

func (man *LibraryManager) IdentifyUnidentSeries(library *db.Library) error

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

func (*LibraryManager) Probe

func (man *LibraryManager) Probe(library *db.Library)

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

func (*LibraryManager) ProbeFile

func (man *LibraryManager) ProbeFile(library *db.Library, filePath string) error

ProbeFile goes over the given file and tries to attempt to find out more information based on the filename.

func (*LibraryManager) RefreshAll

func (man *LibraryManager) RefreshAll()

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

func (*LibraryManager) UpdateEpisodesMD

func (man *LibraryManager) UpdateEpisodesMD() error

UpdateEpisodesMD loops over all episode with no tmdb information yet and attempts to retrieve the metadata.

func (*LibraryManager) UpdateMD

func (man *LibraryManager) UpdateMD(library *db.Library)

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

func (*LibraryManager) UpdateSeasonMD

func (man *LibraryManager) UpdateSeasonMD() error

UpdateSeasonMD loops over all seasons with no tmdb information yet and attempts to retrieve the metadata.

Jump to

Keyboard shortcuts

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