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

Function build_file_metadata

apps/base/views.py:221–238  ·  view source on GitHub ↗
(file_code: FileCodes)

Source from the content-addressed store, hash-verified

219
220
221def build_file_metadata(file_code: FileCodes) -> dict:
222 is_text = file_code.text is not None
223 remaining_downloads = (
224 file_code.expired_count if file_code.expired_count > 0 else None
225 )
226 return {
227 "code": file_code.code,
228 "name": file_code.prefix + file_code.suffix,
229 "size": file_code.size,
230 "type": "text" if is_text else "file",
231 "is_text": is_text,
232 "created_at": file_code.created_at,
233 "expired_at": file_code.expired_at,
234 "expires_at": file_code.expired_at,
235 "expired_count": file_code.expired_count,
236 "used_count": file_code.used_count,
237 "remaining_downloads": remaining_downloads,
238 }
239
240
241async def build_select_detail(

Callers 3

build_select_detailFunction · 0.85
get_file_metadataFunction · 0.85
post_file_metadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected