summaryrefslogtreecommitdiff
path: root/agent.go
blob: 9f021f5c263980945e20a744284ccc57b4ae5587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"github.com/keuin/slbr/api/agent"
	"github.com/keuin/slbr/recording"
	"github.com/samber/lo"
)

type agentImpl struct {
	tasks *[]*recording.RunningTask
}

func (a *agentImpl) GetTasks() []agent.TaskInfo {
	return lo.Map(*a.tasks, func(t *recording.RunningTask, _ int) agent.TaskInfo {
		return agent.TaskInfo{
			LiveRoom: agent.LiveRoomInfo{
				ID:    t.RoomId,
				Title: t.GetRoomTitle(),
			},
			Status: t.GetStatus().String(),
		}
	})
}