Documentation
¶
Overview ¶
Package database manages everything that has to do with communicating with the database.
Package database manages everything that has to do with communicating with the database.
Package database manages everything that has to do with communicating with the database.
Index ¶
- func GetFolderByID(folderid int) globals.Folder
- func GetFoldersByParentID(parentid int) []globals.Folder
- func GetPlaylistTracks(playlistid int) []globals.Track
- func GetPlaylists() []globals.Track
- func GetPopularTracks(n int) []globals.Track
- func GetRandomPath() string
- func GetRandomTracks(n int) []globals.Track
- func GetSearchResults(term string) []globals.Track
- func GetTracksByFolderID(folderid int) []globals.Track
- func IncrementPlayCounter(track_id int)
- func Index()
- func IntToSQLNullableInt(s int) sql.NullInt64
- func SavePlaylist(name string, tracks []globals.Track)
- func StringToSQLNullableString(s string) sql.NullString
- func UpdatePath(path string, track_id int)
- func Warmup() (*sql.DB, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFolderByID ¶
GetFolderByID returns the folder with the provided ID.
func GetFoldersByParentID ¶
GetFoldersByParentID returns the folders with the provided ParentID.
func GetPlaylistTracks ¶
GetPlaylistTracks return all tracks in a playlist
func GetPlaylists ¶
GetPlaylists searches the database for all playlists and return them desguised as tracks
func GetPopularTracks ¶
GetPopularTracks get n popular tracks from the database
func GetRandomTracks ¶
GetRandomTracks get n random tracks from the database
func GetSearchResults ¶
GetSearchResults searches the database for a specific term and return the results. The results are found by checking if the given search term matches the beginning of either the Title, Artist or Album name. Results are ordered by album. Tries to remove duplicates.
func GetTracksByFolderID ¶
GetTracksByFolderID returns all tracks that are in a given folder.
func IncrementPlayCounter ¶
func IncrementPlayCounter(track_id int)
IncrementPlayCounter increments the play counter of a given track by one
func Index ¶
func Index()
Index indexes every folder and playable file that is contained within the specified root folder. It ignores hidden folders entirely.
func IntToSQLNullableInt ¶
IntToSQLNullableInt converts an int into a nullable int.
func SavePlaylist ¶
SavePlaylist saves aplaylist to the database
func StringToSQLNullableString ¶
func StringToSQLNullableString(s string) sql.NullString
StringToSQLNullableString converts a string into a nullable string.
func UpdatePath ¶
updatePath changes the path of the file
Types ¶
This section is empty.