mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-11 04:38:13 +08:00
* rewrite * update submodule * make width height configurable * update dependency * update * update file * update dep * fix basic config layout * update plugin management * more stuff * add blacklist * fix todo * fix windows gethandle * update windows update guide * update windows build guide * include go mod tidy in script * update todo * fix source session * fix text output * add plugin play duration control * fix id diange not working * update todo * update version number
31 lines
539 B
Go
31 lines
539 B
Go
package liveroom
|
|
|
|
import (
|
|
"AynaLivePlayer/core/model"
|
|
"AynaLivePlayer/pkg/config"
|
|
)
|
|
|
|
type _cfg struct {
|
|
ApiServer string
|
|
LiveRoomPath string
|
|
liveRooms []model.LiveRoom
|
|
}
|
|
|
|
func (c *_cfg) Name() string {
|
|
return "LiveRoom"
|
|
}
|
|
|
|
func (c *_cfg) OnLoad() {
|
|
_ = config.LoadJson(c.LiveRoomPath, &c.liveRooms)
|
|
}
|
|
|
|
func (c *_cfg) OnSave() {
|
|
_ = config.SaveJson(c.LiveRoomPath, &c.liveRooms)
|
|
}
|
|
|
|
var cfg = &_cfg{
|
|
ApiServer: "http://localhost:9090",
|
|
LiveRoomPath: "./config/liverooms.json",
|
|
liveRooms: make([]model.LiveRoom, 0),
|
|
}
|