Documentation
¶
Index ¶
- Variables
- type Audio
- type AudioOperation
- type Database
- type Encoder
- type Entry
- func (e *Entry) AbsPath() string
- func (e *Entry) Children() []*Entry
- func (e *Entry) Data() interface{}
- func (e *Entry) Encoding() audio.Codec
- func (e *Entry) FileInfo() os.FileInfo
- func (e *Entry) Filename() string
- func (e *Entry) FilenameExt() (base string, ext string)
- func (e *Entry) IsDir() bool
- func (e *Entry) IsExists() bool
- func (e *Entry) IsIgnored() bool
- func (e *Entry) IsMusic() bool
- func (e *Entry) Key() string
- func (e *Entry) Metadata() audio.Metadata
- func (e *Entry) Parent() *Entry
- func (e *Entry) RelPath() string
- func (e *Entry) RootPath() string
- func (e *Entry) Size() int64
- func (e *Entry) Type() EntryType
- func (e *Entry) Walk(fn func(e *Entry) error) error
- type EntryType
- type ExecError
- type LibraryReader
- type MP3Encoder
- type OPUSEncoder
- type Operator
- type Planner
- type Runner
- func (o *Runner) CopyFile(src, dst string) error
- func (o *Runner) CreateDir(dst string) error
- func (o *Runner) DownscaleCover(src, dst string) error
- func (o *Runner) Error(err error) error
- func (o *Runner) Ignore(dst string) error
- func (o *Runner) Ok(dst string) error
- func (o *Runner) RemoveDir(dst string) error
- func (o *Runner) RemoveFile(dst string) error
- func (o *Runner) Transcode(src, dst string, md Audio) error
- func (o *Runner) Update(src, dst string, md Audio) error
- func (o *Runner) Warn(err error) error
- func (o *Runner) Which(src, dst Audio) AudioOperation
- func (o *Runner) WhichExt(src Audio) string
Constants ¶
This section is empty.
Variables ¶
View Source
var Skip = errors.New("skip the directory or remaining files in directory")
Functions ¶
This section is empty.
Types ¶
type AudioOperation ¶
type AudioOperation int
const ( SkipAudio AudioOperation = iota IgnoreAudio TranscodeAudio UpdateAudio CopyAudio )
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func ReadLibrary ¶
ReadLibrary reads a library using the recommended options, namely:
FollowSymlinks = true IgnoreHidden = true
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) Data ¶
func (e *Entry) Data() interface{}
Care should be taken with when Data is called, as the first call may involve reading the metadata of the associated file.
func (*Entry) FilenameExt ¶
type LibraryReader ¶
func (LibraryReader) ReadLibrary ¶
func (r LibraryReader) ReadLibrary(path string) (*Database, error)
type MP3Encoder ¶
func (*MP3Encoder) CanCopy ¶
func (e *MP3Encoder) CanCopy(src, dst Audio) bool
func (*MP3Encoder) Ext ¶
func (e *MP3Encoder) Ext() string
type OPUSEncoder ¶
func (*OPUSEncoder) CanCopy ¶
func (e *OPUSEncoder) CanCopy(src, dst Audio) bool
func (*OPUSEncoder) Ext ¶
func (e *OPUSEncoder) Ext() string
type Operator ¶
type Operator interface {
// WhichExt takes the source metadata and returns the
// expected destination extension of the file, such as ".mp3".
// If "" is returned, the extension remains unchanged.
//
// Notes:
// - This determines the destination filename that is constructed.
// Because the Operator takes care of encoding, it does not
// determine the encoding process.
WhichExt(src Audio) string
// Which returns an audio operation that should be
// performed, based on src and dst (possibly nil).
//
// Notes:
// - The Operator has full freedom in this decision.
// - Parameter src is not nil.
// - If dst == nil, then the destination file does not exist.
// - If IgnoreAudio is returned, then Operator.Ignore is called.
// - If UpdateAudio is returned, then Operator.Update is called.
// - If CopyAudio is returned, then Operator.CopyFile is called.
Which(src, dst Audio) AudioOperation
// Feedback
Ok(dst string) error
Ignore(dst string) error
Error(err error) error
Warn(err error) error
// Operations
RemoveDir(dst string) error
CreateDir(dst string) error
// RemoveFile removes a file from the destination.
// This occurs primarily when there is no corresponding source file or directory.
RemoveFile(dst string) error
CopyFile(src, dst string) error
Transcode(src, dst string, md Audio) error
Update(src, dst string, md Audio) error
DownscaleCover(src, dst string) error
}
type Planner ¶
type Planner struct {
IgnoreData bool
DataExcept map[string]bool
DeleteBefore bool
TranscodeAll bool
Concurrent int
DownscaleCover bool
CoverSource string
CoverTarget string
// contains filtered or unexported fields
}
func NewPlanner ¶
type Runner ¶
type Runner struct {
Color *color.Colorizer
Encoder Encoder
ForceTranscode bool
CopyExtensions []string
DryRun bool
Verbose bool
Strip bool
SrcPrefix string
DstPrefix string
}
func (*Runner) DownscaleCover ¶ added in v0.7.0
func (*Runner) RemoveFile ¶
func (*Runner) Which ¶
func (o *Runner) Which(src, dst Audio) AudioOperation
Directories
¶
| Path | Synopsis |
|---|---|
|
audio
|
|
|
cmd
|
|
|
lackey
command
|
|
|
rtag
command
|
|
|
Package filetype categorizes files based on their filetype, with the exception of directories, which it identifies directly.
|
Package filetype categorizes files based on their filetype, with the exception of directories, which it identifies directly. |
Click to show internal directories.
Click to hide internal directories.