func ListPlaylistSongs(playlist, mPoint string) ([]fuse.Dirent, error) {
	glog.Infof("Listing contents of playlist %s.\n", playlist)
	db, err := bolt.Open(config.DbPath, 0600, nil)
	if err != nil {
		return nil, err
	}
	defer db.Close()
	var a []fuse.Dirent
	err = db.View(func(tx *bolt.Tx) error {
		root := tx.Bucket([]byte("Playlists"))
		if root == nil {
			return nil
		}
		b := root.Bucket([]byte(playlist))
		if b == nil {
			return nil
		}
		c := b.Cursor()
		for k, v := c.First(); k != nil; k, v = c.Next() {
			if v != nil {
				var node fuse.Dirent
				node.Name = string(k)
				node.Type = fuse.DT_File
				a = append(a, node)
			}
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	if mPoint[len(mPoint)-1] != '/' {
		mPoint = mPoint + "/"
	}
	fullPath := mPoint + "playlists/" + playlist + "/"
	files, _ := ioutil.ReadDir(fullPath)
	for _, f := range files {
		if !f.IsDir() {
			var node fuse.Dirent
			node.Name = string(f.Name())
			node.Type = fuse.DT_File
			a = append(a, node)
		}
	}
	return a, nil
}
ListPlaylistSongs function returns all the songs inside a playlist.
The available songs are loaded from the database and also from the
temporary drop directory named after the playlist.
It receives a playlist name and returns a slice with all the
files.
package store
import (
	"bazil.org/fuse"
	"encoding/json"
	"errors"
	"github.com/boltdb/bolt"
	"github.com/dankomiocevic/mulifs/playlistmgr"
	"github.com/golang/glog"
	"io/ioutil"
	"os"
)
func GetPlaylistPath(playlist string) (string, error) {
	glog.Infof("Entered Playlist path with playlist: %s\n", playlist)
	db, err := bolt.Open(config.DbPath, 0600, nil)
	if err != nil {
		return "", err
	}
	defer db.Close()
	err = db.View(func(tx *bolt.Tx) error {
		root := tx.Bucket([]byte("Playlists"))
		if root == nil {
			return errors.New("No playlists.")
		}
		playlistBucket := root.Bucket([]byte(playlist))
		if playlistBucket == nil {
			return errors.New("Playlist not exists.")
		}
		return nil
	})
	return playlist, err
}
func GetPlaylistFilePath(playlist, song, mPoint string) (string, error) {
	glog.Infof("Entered Playlist file path with song: %s, and playlist: %s\n", song, playlist)
	returnValue, err := getPlaylistFile(playlist, song)
	if err == nil {
		return returnValue.Path, nil
	}
	if mPoint[len(mPoint)-1] != '/' {
		mPoint = mPoint + "/"
	}
	fullPath := mPoint + "playlists/" + playlist + "/" + song
	src, err := os.Stat(fullPath)
	if err != nil || src.IsDir() {
		return "", errors.New("File not exists.")
	}
	return fullPath, nil
}
func ListPlaylists() ([]fuse.Dirent, error) {
	glog.Info("Entered list playlists.")
	db, err := bolt.Open(config.DbPath, 0600, nil)
	if err != nil {
		return nil, err
	}
	defer db.Close()
	var a []fuse.Dirent
	err = db.View(func(tx *bolt.Tx) error {
		b := tx.Bucket([]byte("Playlists"))
		if b == nil {
			glog.Infof("There is no Playlists bucket.")
			return nil
		}
		c := b.Cursor()
		for k, v := c.First(); k != nil; k, v = c.Next() {
			if v == nil {
				var node fuse.Dirent
				node.Name = string(k)
				node.Type = fuse.DT_Dir
				a = append(a, node)
			}
		}
		return nil
	})
	return a, nil
}