refactor: update stream quality factor handling in JSON-RPC

Replaced the static stream factor with a configurable video quality factor. The new implementation saves the updated quality factor to the configuration, ensuring persistence across sessions.
This commit is contained in:
Adam Shiervani 2025-10-29 15:33:49 +01:00
parent 887a3997b1
commit 509cea64fa
1 changed files with 5 additions and 4 deletions

View File

@ -177,10 +177,8 @@ func rpcReboot(force bool) error {
return hwReboot(force, nil, 0)
}
var streamFactor = 1.0
func rpcGetStreamQualityFactor() (float64, error) {
return streamFactor, nil
return config.VideoQualityFactor, nil
}
func rpcSetStreamQualityFactor(factor float64) error {
@ -190,7 +188,10 @@ func rpcSetStreamQualityFactor(factor float64) error {
return err
}
streamFactor = factor
config.VideoQualityFactor = factor
if err := SaveConfig(); err != nil {
return fmt.Errorf("failed to save config: %w", err)
}
return nil
}