database

package
v0.0.0-...-7de4394 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var AddArtist func(artistName string, directoryPath string) int

AddArtist adds the artist with given name to database. Returns the created artistID.

View Source
var AddDirectory func(directoryPath string) int

AddDirectory adds the directory path to the database. Returns the corresponding database directoryID.

View Source
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.

View Source
var GetAlbumsFromDirID func(directoryID int) []util.Album

GetAlbumsFromDirID returns array of albums in the given directory.

View Source
var GetArtistsFromDirID func(directoryID int) []util.Artist

GetArtistsFromDirID returns array of artists in the given directory.

View Source
var GetDirectoryID func(directoryPath string) int

GetDirectoryID returns the directoryID corresponding to the given path.

View Source
var GetSongsFromDirID func(directoryID int) []util.Song

GetSongsFromDirID returns array of songs in the given directory.

Functions

func GetLastScannedTime

func GetLastScannedTime() time.Time

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

func Init() *sql.DB

Init creates the database tables and prepares access sql statements. Returns the opened db.

func PrintAlbums

func PrintAlbums()

PrintAlbums prints all the albums in the database.

func PrintArtists

func PrintArtists()

PrintArtists prints all the artists in the database.

func PrintSongs

func PrintSongs()

PrintSongs prints all the songs in the database.

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}}.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL