summaryrefslogtreecommitdiff
path: root/recording/runner.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-29 21:20:12 +0800
committerKeuin <[email protected]>2023-07-29 21:20:12 +0800
commit110301a975e43739192577166d089e28c22ae266 (patch)
treee655e00876b0140aa9ad431824765cd1c8371899 /recording/runner.go
parente72342b0027752dc93e57ebec99c4eb9a8aa8efe (diff)
Add API server
Diffstat (limited to 'recording/runner.go')
-rw-r--r--recording/runner.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/recording/runner.go b/recording/runner.go
index 9be78c9..7bf3790 100644
--- a/recording/runner.go
+++ b/recording/runner.go
@@ -175,7 +175,9 @@ func tryRunTask(t *RunningTask) error {
var err error
run := true
for run {
- err = record(t.ctx, bi, &t.TaskConfig, t.logger)
+ err = record(t.ctx, bi, &t.TaskConfig, t.logger, func(resp types.RoomProfileResponse) {
+ t.roomTitle.Store(&resp.Data.Title)
+ })
if err == nil {
// live is ended
t.logger.Info("The live is ended. Restarting current task...")
@@ -247,6 +249,7 @@ func record(
bi *bilibili.Bilibili,
task *TaskConfig,
logger logging.Logger,
+ profileConsumer func(types.RoomProfileResponse),
) error {
logger.Info("Getting room profile...")
@@ -265,6 +268,8 @@ func record(
return errs.NewError(errs.GetRoomInfo, err)
}
+ profileConsumer(profile)
+
logger.Info("Getting stream url...")
urlInfo, err := AutoRetryWithConfig(
ctx,