mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-05 07:06:57 +08:00
refactor: 分离解析推流和转发流
This commit is contained in:
@@ -11,19 +11,20 @@ import (
|
||||
func PreparePublishSource(source Source, hook bool) (*http.Response, utils.HookState) {
|
||||
var response *http.Response
|
||||
|
||||
if err := SourceManager.Add(source); err != nil {
|
||||
return nil, utils.HookStateOccupy
|
||||
}
|
||||
|
||||
if hook && AppConfig.Hooks.IsEnablePublishEvent() {
|
||||
rep, state := HookPublishEvent(source)
|
||||
if utils.HookStateOK != state {
|
||||
_, _ = SourceManager.Remove(source.GetID())
|
||||
return rep, state
|
||||
}
|
||||
|
||||
response = rep
|
||||
}
|
||||
|
||||
if err := SourceManager.Add(source); err != nil {
|
||||
return nil, utils.HookStateOccupy
|
||||
}
|
||||
|
||||
source.SetCreateTime(time.Now())
|
||||
|
||||
urls := GetStreamPlayUrls(source.GetID())
|
||||
|
Reference in New Issue
Block a user