database

package
v0.0.0-...-843c29a Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFolderByID

func GetFolderByID(folderid int) globals.Folder

GetFolderByID returns the folder with the provided ID.

func GetFoldersByParentID

func GetFoldersByParentID(parentid int) []globals.Folder

GetFoldersByParentID returns the folders with the provided ParentID.

func GetPlaylistTracks

func GetPlaylistTracks(playlistid int) []globals.Track

GetPlaylistTracks return all tracks in a playlist

func GetPlaylists

func GetPlaylists() []globals.Track

GetPlaylists searches the database for all playlists and return them desguised as tracks

func GetPopularTracks

func GetPopularTracks(n int) []globals.Track

GetPopularTracks get n popular tracks from the database

func GetRandomPath

func GetRandomPath() string

GetRandomPath gets a random path from the database

func GetRandomTracks

func GetRandomTracks(n int) []globals.Track

GetRandomTracks get n random tracks from the database

func GetSearchResults

func GetSearchResults(term string) []globals.Track

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

func GetTracksByFolderID(folderid int) []globals.Track

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

func IntToSQLNullableInt(s int) sql.NullInt64

IntToSQLNullableInt converts an int into a nullable int.

func SavePlaylist

func SavePlaylist(name string, tracks []globals.Track)

SavePlaylist saves aplaylist to the database

func StringToSQLNullableString

func StringToSQLNullableString(s string) sql.NullString

StringToSQLNullableString converts a string into a nullable string.

func UpdatePath

func UpdatePath(path string, track_id int)

updatePath changes the path of the file

func Warmup

func Warmup() (*sql.DB, error)

Warmup the mysql connection pool

Types

This section is empty.

Jump to

Keyboard shortcuts

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