Add missing fields to ListFilesHandler response
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-27 20:36:42 -07:00
parent ff34071eb4
commit daea98f320

View File

@ -3473,10 +3473,12 @@ func (g *Gateway) ListFilesHandler(w http.ResponseWriter, r *http.Request) {
files := []map[string]interface{}{} files := []map[string]interface{}{}
for hash, metadata := range metadataStore { for hash, metadata := range metadataStore {
fileInfo := map[string]interface{}{ fileInfo := map[string]interface{}{
"file_hash": hash, "file_hash": hash,
"name": metadata.FileName, "name": metadata.FileName,
"size": metadata.TotalSize, "size": metadata.TotalSize,
"chunks": len(metadata.Chunks), "chunks": len(metadata.Chunks),
"storage_type": "torrent", // Default to torrent for metadataStore files
"access_level": "public", // metadataStore only contains public files
} }
// Add torrent info if available // Add torrent info if available