Documentation
¶
Index ¶
- Variables
- func CountTracks(crates []CrateFolder) int
- func FindTrackIDs(db mixxxdb.MixxxDB, tracks []TrackFile) ([]int, error)
- func IsTrackFile(filename string) bool
- func NameCrate(relpath string) string
- func UpdateCrateInDB(db mixxxdb.MixxxDB, crate CrateFolder) error
- type CrateFolder
- type TrackFile
Constants ¶
This section is empty.
Variables ¶
var ErrTrackNotFound = errors.New("track not found in MixxxDB")
Functions ¶
func CountTracks ¶
func CountTracks(crates []CrateFolder) int
Counts the total number of tracks in the given array of CrateFolders.
func FindTrackIDs ¶
FindTrackIDs searches the DB to find the track IDs corresponding to the given track files. Returns an error wrapping one or multiple `ErrTrackNotFound`s if there are tracks that cannot be found in Mixxx's DB.
func IsTrackFile ¶
IsTrackFile detects if a file at the given path is indeed a track that can be played by Mixxx. Returns true iff the filename has an extension that is supported by Mixxx. See https://manual.mixxx.org/2.0/en/chapters/configuration.html#importing-your-audio-files for the list of supported files
func NameCrate ¶
NameCrate creates a name for a crate based on its path relative to the music library. Replaces folder separators with - E.g. House/90's becomes House - 90's
func UpdateCrateInDB ¶
func UpdateCrateInDB(db mixxxdb.MixxxDB, crate CrateFolder) error
UpdateCrateInDB ...
Types ¶
type CrateFolder ¶
func FindCrateFolders ¶
func FindCrateFolders(libfolder string, ignore *ignore.GitIgnore) ([]CrateFolder, error)
FindCrateFolders searches the given folder for music tracks that Mixxx can play. When it finds a folder with at least track in it, it will make a crate with the name of the path to that folder and the tracks that are directly inside the folder. Respects the ignore patterns specified with the github.com/sabhiram/go-gitignore library. Note: Tracks will not have any database IDs.
type TrackFile ¶
type TrackFile string
TrackFile is a filepath to a music file that can be played by Mixxx. See `IsTrackFile` to see what types of files qualify.
func FindTrackFiles ¶
FindTrackFiles finds all tracks that can be played by Mixxx in a given folder. Respects the ignore patterns specified with the github.com/sabhiram/go-gitignore library. Note: Does *not* search recursively.