Documentation ¶
Index ¶
- Constants
- Variables
- func IsDir(filePath string) bool
- func RefreshAgentMetadataForUUID(UUID string) bool
- func RefreshAgentMetadataWithMissingArt()
- func RefreshAllMovieMD() error
- func RefreshAllSeriesMD() error
- func UpdateEpisodeMD(ep *db.Episode, season *db.Season, series *db.Series) error
- func UpdateMovieMD(movie *db.Movie) error
- func UpdateSeasonMD(season *db.Season, series *db.Series) error
- func UpdateSeriesMD(series *db.Series) error
- func ValidFile(filePath string) bool
- type LibraryManager
- func (man *LibraryManager) AddWatcher(filePath string)
- func (man *LibraryManager) CheckRemovedFiles()
- func (man *LibraryManager) IdentifyUnidentMovies(library *db.Library) error
- func (man *LibraryManager) IdentifyUnidentSeries(library *db.Library) error
- func (man *LibraryManager) Probe(library *db.Library)
- func (man *LibraryManager) ProbeFile(library *db.Library, filePath string) error
- func (man *LibraryManager) RefreshAll()
- func (man *LibraryManager) UpdateEpisodesMD() error
- func (man *LibraryManager) UpdateMD(library *db.Library)
- func (man *LibraryManager) UpdateSeasonMD() error
Constants ¶
const MinFileSize = 5e6 // 5MB
MinFileSize defines how big a file has to be to be indexed.
Variables ¶
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
IsDir checks whether the given path is a directory. TODO: This should probably leave in a helper function
func RefreshAgentMetadataForUUID ¶
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 ¶
UpdateEpisodeMD updates the database record with the latest data from the agent
func UpdateMovieMD ¶
UpdateMovieMD updates the database record with the latest data from the agent
func UpdateSeasonMD ¶
UpdateSeasonMD updates the database record with the latest data from the agent
func UpdateSeriesMD ¶
UpdateSeriesMD loops over all series with no tmdb information yet and attempts to retrieve the metadata.
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.