网站设置增加HLS加密功能(商业版本

This commit is contained in:
刘祥超
2024-01-14 20:36:47 +08:00
parent 534cfb2180
commit 66a31f599d
5 changed files with 39 additions and 1 deletions

View File

@@ -554,6 +554,18 @@ func (this *HTTPWebDAO) ComposeWebConfig(tx *dbs.Tx, webId int64, isLocationOrGr
}
}
// hls
if IsNotNull(web.Hls) {
var hlsConfig = &serverconfigs.HLSConfig{}
err = json.Unmarshal(web.Hls, hlsConfig)
if err != nil {
return nil, err
}
if this.shouldCompose(isLocationOrGroup, forNode, hlsConfig.IsPrior, true) {
config.HLS = hlsConfig
}
}
if cacheMap != nil {
cacheMap.Put(cacheKey, config)
}
@@ -1464,6 +1476,10 @@ func (this *HTTPWebDAO) FindWebReferers(tx *dbs.Tx, webId int64) ([]byte, error)
// UpdateWebUserAgent 修改User-Agent设置
func (this *HTTPWebDAO) UpdateWebUserAgent(tx *dbs.Tx, webId int64, userAgentConfig *serverconfigs.UserAgentConfig) error {
if webId <= 0 {
return errors.New("require 'webId'")
}
if userAgentConfig == nil {
return nil
}