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

@ -74,6 +74,7 @@ func getSettingsFromDB() {
TVShowPath string
TVShowEnabled bool
FullDeleteEnabled bool
RandomNR uint32
}
regexMatchUrl := regexp.MustCompile("^http(|s)://([0-9]){1,3}\\.([0-9]){1,3}\\.([0-9]){1,3}\\.([0-9]){1,3}:[0-9]{1,5}")
@ -90,6 +91,7 @@ func getSettingsFromDB() {
TVShowPath: serverTVShowPath,
TVShowEnabled: !config.GetConfig().Features.DisableTVSupport,
FullDeleteEnabled: config.GetConfig().Features.FullyDeletableVideos,
RandomNR: sett.RandomNR,
}
context.Json(res)
@ -127,12 +129,13 @@ func saveSettingsToDB() {
password=?,
mediacenter_name=?,
TMDB_grabbing=?,
DarkMode=?
DarkMode=?,
random_nr=?
WHERE 1`
// todo avoid conversion
context.Text(string(database.SuccessQuery(query,
args.VideoPath, args.EpisodePath, args.Password,
args.MediacenterName, args.TMDBGrabbing, args.DarkMode)))
args.MediacenterName, args.TMDBGrabbing, args.DarkMode, args.RandomNR)))
})
}

View File

@ -48,6 +48,7 @@ type SettingsType struct {
PasswordEnabled bool
TMDBGrabbing bool
DarkMode bool
RandomNR uint32
}
type SettingsSizeType struct {