Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AddAlbum func(albumTitle string, genre string, year int, artistID int, directoryPath string) int
AddAlbum adds the album with given metadata to database. Returns the created albumID.
var AddArtist func(artistName string, directoryPath string) int
AddArtist adds the artist with given name to database. Returns the created artistID.
var AddDirectory func(directoryPath string) int
AddDirectory adds the directory path to the database. Returns the corresponding database directoryID.
var AddSong func( songTitle string, duration int, size int64, trackNo int, path string, bitrate int64, ext string, albumID int, directoryPath string, )
AddSong adds the song with the given metadata to the database.
var GetAlbumsFromDirID func(directoryID int) []util.Album
GetAlbumsFromDirID returns array of albums in the given directory.
var GetArtistsFromDirID func(directoryID int) []util.Artist
GetArtistsFromDirID returns array of artists in the given directory.
var GetDirectoryID func(directoryPath string) int
GetDirectoryID returns the directoryID corresponding to the given path.
var GetSongsFromDirID func(directoryID int) []util.Song
GetSongsFromDirID returns array of songs in the given directory.
Functions ¶
func GetLastScannedTime ¶
GetLastScannedTime returns the time the directory was last scanned.
func GetMusicFolders ¶
func GetMusicFolders() []string
GetMusicFolders returns the music folders added to the database.
func Init ¶
Init creates the database tables and prepares access sql statements. Returns the opened db.
func SetLastScannedTime ¶
func SetLastScannedTime()
SetLastScannedTime inserts or updates the current time into Datetime. The time format is YYYY-MM-DD HH:MM:SS.
Types ¶
type GenreCounts ¶
type GenreCounts map[string]counts
GenreCounts is a map from genre to the number of albums and songs in the genre
func GetGenres ¶
func GetGenres() GenreCounts
GetGenres returns a map of {genre: {songCount, albumCount}}.