Exemplo n.º 1
0
// 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
}
Exemplo n.º 2
0
// 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
}