MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / select_file

Function select_file

apps/base/views.py:293–302  ·  view source on GitHub ↗
(data: SelectFileModel, ip: str = Depends(ip_limit["error"]))

Source from the content-addressed store, hash-verified

291
292@share_api.post("/select/")
293async def select_file(data: SelectFileModel, ip: str = Depends(ip_limit["error"])):
294 file_storage: FileStorageInterface = storages[settings.file_storage]()
295 has, file_code = await get_code_file_by_code(data.code)
296 if not has:
297 ip_limit["error"].add_ip(ip)
298 return APIResponse(code=404, detail=file_code)
299
300 assert isinstance(file_code, FileCodes)
301 await update_file_usage(file_code)
302 return APIResponse(detail=await build_select_detail(file_code, file_storage))
303
304
305@share_api.get("/download")

Callers

nothing calls this directly

Calls 5

APIResponseClass · 0.90
get_code_file_by_codeFunction · 0.85
update_file_usageFunction · 0.85
build_select_detailFunction · 0.85
add_ipMethod · 0.80

Tested by

no test coverage detected