if !file.New(v+"0.csv", 0, true).IsExist() {
w.WriteHeader(http.StatusNotFound)
return
+ } else if !file.New(v+"0.xml", 0, true).IsExist() {
+ type empty struct{}
+ if e := comp.Run(comp.Sign[empty](`SerF.player.ws`), context.Background(), &v); e != nil {
+ msglog.L(`E: `, e)
+ }
}
if s, closeF := PlayRecDanmu(v + "0.csv"); s == nil {
func init() {
var linkMap = map[string][]string{
"github.com/qydysky/bili_danmu/Reply.startRecDanmu.stop": {
- comp.Sign[danmuXml.Sign](),
+ comp.Sign[danmuXml.Sign](`toXml`),
+ },
+ "github.com/qydysky/bili_danmu/Reply.SerF.player.ws": {
+ comp.Sign[danmuXml.Sign](`toXml`),
},
"github.com/qydysky/bili_danmu/Reply.preparing": {
- comp.Sign[liveOver.Sign](),
+ comp.Sign[liveOver.Sign](`sumup`),
},
}
if e := comp.Link(linkMap); e != nil {
file "github.com/qydysky/part/file"
)
-type Sign struct{}
+type Sign struct {
+ // path: csv所在目录,末尾无
+ toXml func(ctx context.Context, path *string) error
+}
func init() {
- if e := comp.Put[string](comp.Sign[Sign](), toXml); e != nil {
+ sign := Sign{
+ toXml: toXml,
+ }
+ if e := comp.Put[string](comp.Sign[Sign](`toXml`), sign.toXml); e != nil {
panic(e)
}
}
comp "github.com/qydysky/part/component"
)
-type Sign struct{}
+type Sign struct {
+ // 下播总结
+ sumup func(ctx context.Context, ptr *c.Common) error
+}
func init() {
- if e := comp.Put[c.Common](comp.Sign[Sign](), sumup); e != nil {
+ sign := Sign{
+ sumup: sumup,
+ }
+ if e := comp.Put[c.Common](comp.Sign[Sign](`sumup`), sign.sumup); e != nil {
panic(e)
}
}