mirror of https://github.com/jetkvm/kvm.git
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:
parent
887a3997b1
commit
509cea64fa
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue