MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / FsArchiveMetaSplit

Function FsArchiveMetaSplit

server/handles/archive.go:74–91  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

72}
73
74func FsArchiveMetaSplit(c *gin.Context) {
75 var req ArchiveMetaReq
76 if err := c.ShouldBind(&req); err != nil {
77 common.ErrorResp(c, err, 400)
78 return
79 }
80 if strings.HasPrefix(req.Path, "/@s") {
81 req.Path = strings.TrimPrefix(req.Path, "/@s")
82 SharingArchiveMeta(c, &req)
83 return
84 }
85 user := c.Request.Context().Value(conf.UserKey).(*model.User)
86 if user.IsGuest() && user.Disabled {
87 common.ErrorStrResp(c, "Guest user is disabled, login please", 401)
88 return
89 }
90 FsArchiveMeta(c, &req, user)
91}
92
93func FsArchiveMeta(c *gin.Context, req *ArchiveMetaReq, user *model.User) {
94 if !user.CanReadArchives() {

Callers

nothing calls this directly

Calls 5

ErrorRespFunction · 0.92
ErrorStrRespFunction · 0.92
SharingArchiveMetaFunction · 0.85
FsArchiveMetaFunction · 0.85
IsGuestMethod · 0.80

Tested by

no test coverage detected