add a settings entry for nr of random videos to display

This commit is contained in:
2022-05-05 19:35:46 +02:00
parent 11c1e25de5
commit 7cd9cd7d89
10 changed files with 66 additions and 17 deletions

View File

@ -20,15 +20,16 @@ type SettingsType struct {
MediacenterName string
VideoPath string
TVShowPath string
RandomNR uint32
}
func LoadSettings() *SettingsType {
query := "SELECT DarkMode, password, mediacenter_name, video_path, episode_path from settings"
query := "SELECT DarkMode, password, mediacenter_name, video_path, episode_path, random_nr from settings"
result := SettingsType{}
var darkmode uint8
err := database.QueryRow(query).Scan(&darkmode, &result.Pasword, &result.MediacenterName, &result.VideoPath, &result.TVShowPath)
err := database.QueryRow(query).Scan(&darkmode, &result.Pasword, &result.MediacenterName, &result.VideoPath, &result.TVShowPath, &result.RandomNR)
if err != nil {
fmt.Println("error while parsing db data: " + err.Error())
}