Add missing fields to ListFilesHandler response
This commit is contained in:
parent
ff34071eb4
commit
daea98f320
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user