From 35e6b6d4114a4f5a49a671840422c0fa6ce1350d Mon Sep 17 00:00:00 2001 From: shaoying Date: Mon, 1 Jun 2020 08:39:04 +0800 Subject: [PATCH] add value --- base/web/share.go | 2 ++ core/chat/action.go | 1 + core/wiki/inner.go | 2 +- core/wiki/video | 2 -- core/wiki/video.go | 7 +------ go.mod | 2 +- 6 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 core/wiki/video diff --git a/base/web/share.go b/base/web/share.go index b94ee616..11a49f2a 100644 --- a/base/web/share.go +++ b/base/web/share.go @@ -109,6 +109,7 @@ func _share_action_redirect(m *ice.Message, value map[string]interface{}, share "title", kit.Format(value["name"]), "river", kit.Value(value, "extra.river"), "storm", kit.Value(value, "extra.storm"), + kit.UnMarshal(kit.Format(kit.Value(value, "extra.tool.0.value"))), ) return true } @@ -127,6 +128,7 @@ func _share_action_list(m *ice.Message, value map[string]interface{}, river, sto m.Push("group", value["ctx"]) m.Push("index", value["cmd"]) m.Push("args", value["args"]) + m.Push("value", value["value"]) msg := m.Cmd(m.Space(value["pod"]), ice.CTX_COMMAND, value["ctx"], value["cmd"]) m.Push("name", value["cmd"]) diff --git a/core/chat/action.go b/core/chat/action.go index a0babbf3..c2a3fa2e 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -11,6 +11,7 @@ func _action_share_create(m *ice.Message, arg ...string) { arg = append(arg, "tool.0.ctx", m.Option("group")) arg = append(arg, "tool.0.cmd", m.Option("index")) arg = append(arg, "tool.0.args", m.Option("args")) + arg = append(arg, "tool.0.value", m.Option("value")) arg = append(arg, "tool.0.single", "yes") } else { m.Option(ice.MSG_RIVER, arg[5]) diff --git a/core/wiki/inner.go b/core/wiki/inner.go index 45a27e69..1a8c629c 100644 --- a/core/wiki/inner.go +++ b/core/wiki/inner.go @@ -24,7 +24,7 @@ func _inner_list(m *ice.Message, name string) { return } - m.Cmdy("nfs.dir", name, "file") + m.Cmdy("nfs.dir", name, "file size time") } func _inner_save(m *ice.Message, name, text string) { if m.Cmdy(kit.Keys(strings.TrimPrefix(path.Ext(name), "."), "save"), name, text); len(m.Resultv()) > 0 { diff --git a/core/wiki/video b/core/wiki/video deleted file mode 100644 index 3db7f700..00000000 --- a/core/wiki/video +++ /dev/null @@ -1,2 +0,0 @@ -package wiki - diff --git a/core/wiki/video.go b/core/wiki/video.go index 22979bb0..87ca5acd 100644 --- a/core/wiki/video.go +++ b/core/wiki/video.go @@ -6,7 +6,7 @@ import ( "github.com/nareix/joy4/av" "github.com/nareix/joy4/av/avutil" - "github.com/nareix/joy4/codec/h264parser" + "github.com/nareix/joy4/format" ) func init() { @@ -28,13 +28,8 @@ func init() { if streams, e := file.Streams(); m.Assert(e) { for _, stream := range streams { m.Info("what %v", kit.Formats(stream)) - if stream.Type().IsAudio() { } else if stream.Type().IsVideo() { - - m.Info("what %v", kit.Formats(stream)) - h264parser.ParseSPS(stream.RecordInfo.SPS) - vstream := stream.(av.VideoCodecData) m.Push("type", vstream.Type().String()) m.Push("width", vstream.Width()) diff --git a/go.mod b/go.mod index a69471d2..a2dd0311 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.13 require ( github.com/gorilla/websocket v1.4.1 - github.com/nareix/joy4 v0.0.0-20200507095837-05a4ffbb5369 // indirect + github.com/nareix/joy4 v0.0.0-20200507095837-05a4ffbb5369 github.com/shylinux/toolkits v0.1.5 github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 github.com/tuotoo/qrcode v0.0.0-20190222102259-ac9c44189bf2