Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // FilepathFuncMap provides standard functions to build/manipulate path in // template.Funcmap's format: // - ext : get file extension // - sanitizePath: replace special chars that don't usually work well when // use in path name // - nospace : get rid of spaces FilepathFuncMap = template.FuncMap{ "base": filepath.Base, "ext": filepath.Ext, "sanitizePath": pathSanitizer, "sanitizeFilename": filenameSanitizer, "nospace": nospaceSanitizer, } )
Functions ¶
Types ¶
type Libro ¶
type Libro struct {
// Root is the location of Libro's library.
Root string
// Verbose is the logger for providing low interest messages to the user.
Verbose *log.Logger
// Debug is the logger for providing messages supposed to help the
// developer understand his/her mistakes.
Debug *log.Logger
// UseGooglebooks, if set, will complete book's missing metadata by
// searching Googlebooks.
// Default to false (do not try fetching missing metadata)
UseGooglebooks bool
// UseGuesser, if set, tries to complete book's metadata by guessing
// missing information using media's filename and title.
// Default to false (do not try guessing missing metadata)
UseGuesser bool
// LocationTmpl is a text.Template that determines the standardized media
// files location in the collection based on their metadata.
// Default to nil (keep item location as-is)
LocationTmpl *template.Template
}
Libro represents a collection of media and its associated management facilities.
func (*Libro) Create ¶
Create inserts a new book in Libro's collection.
It determines the location in the collection by executing Libro.LocationTmpl against book's metadata. Location can be relative or absolute, relative location are relative to the Libro's root folder. Location can contain reference to environment variables that are expanded to determine the target location to store the book's file.
Create operation will fail if the target location already exists.
Click to show internal directories.
Click to hide internal directories.