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

Function FsArchiveListSplit

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

Source from the content-addressed store, hash-verified

154}
155
156func FsArchiveListSplit(c *gin.Context) {
157 var req ArchiveListReq
158 if err := c.ShouldBind(&req); err != nil {
159 common.ErrorResp(c, err, 400)
160 return
161 }
162 req.Validate()
163 if strings.HasPrefix(req.Path, "/@s") {
164 req.Path = strings.TrimPrefix(req.Path, "/@s")
165 SharingArchiveList(c, &req)
166 return
167 }
168 user := c.Request.Context().Value(conf.UserKey).(*model.User)
169 if user.IsGuest() && user.Disabled {
170 common.ErrorStrResp(c, "Guest user is disabled, login please", 401)
171 return
172 }
173 FsArchiveList(c, &req, user)
174}
175
176func FsArchiveList(c *gin.Context, req *ArchiveListReq, user *model.User) {
177 if !user.CanReadArchives() {

Callers

nothing calls this directly

Calls 6

ErrorRespFunction · 0.92
ErrorStrRespFunction · 0.92
SharingArchiveListFunction · 0.85
FsArchiveListFunction · 0.85
IsGuestMethod · 0.80
ValidateMethod · 0.45

Tested by

no test coverage detected