Documentation
¶
Index ¶
- Variables
- func GetCandidates(source string, exts []string, opts ...FileOptions) []string
- func GetTmpFilename(source string) (string, error)
- func MoveToMusicFolder(ctx context.Context, source, dest string, exts []string, ...) error
- func PickRandomFile(source string, exts []string, opts ...FileOptions) (path string, total int, err error)
- type FileOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingArtist = errors.New("missing artist")
View Source
var ErrMissingAudio = errors.New("no audio stream")
View Source
var ErrNoFilesFound = errors.New("no files found")
Functions ¶
func GetCandidates ¶
func GetCandidates(source string, exts []string, opts ...FileOptions) []string
func GetTmpFilename ¶
func MoveToMusicFolder ¶ added in v0.3.0
func PickRandomFile ¶
func PickRandomFile(source string, exts []string, opts ...FileOptions) (path string, total int, err error)
PickRandomFile returns a random file from source which has an extension matching one of exts. It returns the random file, and the total number of files. If no files are found the error will be ErrNoFilesFound.
Types ¶
type FileOptions ¶ added in v0.4.2
type FileOptions func(*fileOpts)
var ( WithoutRecursion FileOptions = func(fo *fileOpts) { fo.recurse = false } MostRecent FileOptions = func(fo *fileOpts) { fo.sort = sortRecent } Oldest FileOptions = func(fo *fileOpts) { fo.sort = sortOldest } )
func ChooseFrom ¶ added in v0.4.2
func ChooseFrom(num int) FileOptions
Click to show internal directories.
Click to hide internal directories.