From 54211e220d993a73005e4a6d0fa532e2d4260543 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 2 Feb 2025 23:53:03 +0800 Subject: [PATCH] add some --- core/wiki/feel.go | 4 +++- core/wiki/video.go | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/wiki/feel.go b/core/wiki/feel.go index 11a72278..ce5c65e3 100644 --- a/core/wiki/feel.go +++ b/core/wiki/feel.go @@ -21,6 +21,7 @@ const ( USR_IMAGE = "usr/image/" USR_COVER = "usr/cover/" USR_AVATAR = "usr/avatar/" + USR_MATERIAL = "usr/material/" USR_ICONS = "usr/icons/" USR_ICONS_AVATAR = "usr/icons/avatar.jpg" USR_ICONS_BACKGROUND = "usr/icons/background.jpg" @@ -88,11 +89,12 @@ func init() { }, chat.FavorAction(), WikiAction("", "ico|png|PNG|gif|jpg|JPG|jpeg|mp4|m4v|mov|MOV|webm|mp3"), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path,name,cover")), Hand: func(m *ice.Message, arg ...string) { if len(kit.Slice(arg, 0, 1)) == 0 { if mdb.HashSelect(m); aaa.IsTechOrRoot(m) { - m.Push(nfs.PATH, USR_AVATAR).Push(mdb.NAME, "头像库").Push(COVER, USR_ICONS_AVATAR) + // m.Push(nfs.PATH, USR_AVATAR).Push(mdb.NAME, "头像库").Push(COVER, USR_ICONS_AVATAR) m.Push(nfs.PATH, USR_LOCAL_IMAGE).Push(mdb.NAME, "私有库").Push(COVER, USR_ICONS_BACKGROUND) } m.Push(nfs.PATH, USR_IMAGE).Push(mdb.NAME, "图片库").Push(COVER, USR_ICONS_BACKGROUND) m.Push(nfs.PATH, USR_COVER).Push(mdb.NAME, "封面库").Push(COVER, USR_ICONS_BACKGROUND) + m.Push(nfs.PATH, USR_MATERIAL).Push(mdb.NAME, "素材库").Push(COVER, SRC_MAIN) m.Push(nfs.PATH, USR_ICONS).Push(mdb.NAME, "图标库").Push(COVER, SRC_MAIN) } else { if _wiki_list(m, kit.Slice(arg, 0, 1)...); arg[0] == USR_ICONS { diff --git a/core/wiki/video.go b/core/wiki/video.go index bd2ea862..e62b932c 100644 --- a/core/wiki/video.go +++ b/core/wiki/video.go @@ -1,6 +1,9 @@ package wiki import ( + "path" + "strings" + ice "shylinux.com/x/icebergs" ) @@ -8,7 +11,11 @@ const VIDEO = "video" func init() { Index.MergeCommands(ice.Commands{ - VIDEO: {Name: "video path", Help: "视频", Hand: func(m *ice.Message, arg ...string) { + VIDEO: {Name: "video path", Help: "视频", Actions: ice.Actions{ + "material": {Hand: func(m *ice.Message, arg ...string) { + m.Cmdy(VIDEO, path.Join("usr/material", strings.TrimPrefix(path.Dir(m.Option("_script")), "usr/"), arg[0])) + }}, + }, Hand: func(m *ice.Message, arg ...string) { arg = _name(m, arg) _image_show(m, arg[0], arg[1], arg[2:]...) }},