]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix 未生成xml #86
authorqydysky <qydysky@foxmail.com>
Mon, 14 Aug 2023 22:30:49 +0000 (06:30 +0800)
committerqydysky <qydysky@foxmail.com>
Mon, 14 Aug 2023 22:30:49 +0000 (06:30 +0800)
Reply/F.go
Reply/F/comp.go
Reply/F/danmuXml/danmuXml.go
Reply/F/liveOver/liveOver.go

index 37a7faa135cb6aa858772f1fe759be1483099998..31324bb01c865ea2f7e49f720eef5068951d3093 100644 (file)
@@ -1551,6 +1551,11 @@ func init() {
                                        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 {
index d288aa4a60b5755790183be2b0fe3b6b9951f80b..863d31c1e02d734830ee4b81a2f9afcadc786b1a 100644 (file)
@@ -9,10 +9,13 @@ import (
 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 {
index a8ba0e47437c82ac3f9d2a47a3cf70b1de0e10e4..3fb189a77a913ce31a19a579fe8bbd5ab778eb6a 100644 (file)
@@ -13,10 +13,16 @@ import (
        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)
        }
 }
index 9d938efb9b7a2ca422a84da1c7c669450e84bf8e..d579ced68e73f9acf30a47ce655c75ee056f8cc8 100644 (file)
@@ -9,10 +9,16 @@ import (
        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)
        }
 }