示例#1
0
文件: paths.go 项目: barsanuphe/radis
// 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
}
示例#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
}