// Check all the paths in MainConfig exist func (mc *Paths) Check() (err error) { // check the required directories exist // the other directories can be created by radis if _, err := directory.GetExistingPath(mc.Root); err != nil { return err } if _, err := directory.GetExistingPath(mc.MPDPlaylistDirectory); err != nil { return err } return }
// Exists finds out if a Playlist is valid or not func (p *Playlist) Exists() (isPlaylist bool, err error) { path, err := directory.GetExistingPath(p.Filename) if err != nil { return } if filepath.Ext(path) == ".m3u" { isPlaylist = true } return }