List peers (from index.pck) in exported htm and gmi index

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@15 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
fox
2022-09-24 20:01:37 +00:00
parent 4f42df7037
commit ef29c97a92
5 changed files with 23 additions and 12 deletions

View File

@@ -44,12 +44,13 @@ let at_path types noindex path =
let fname = Filename.concat dir "index.pck" in
(match Header_pack.of_string @@ File_store.to_string fname with
| Error s -> prerr_endline s
| Ok { info; _ } ->
| Ok { info; peers; _ } ->
let kv = let f = Filename.concat dir ".convert.conf" in (* TODO: better place to store convert conf? *)
if Sys.file_exists f then File_store.of_kv_file f else Store.KV.empty in
let kv = if Store.KV.mem "Title" kv then kv
else Store.KV.add "Title" info.Header_pack.title kv in
let kv = Store.KV.add "Locations" (String.concat ";\n" info.Header_pack.locations) kv in
let kv = Store.KV.add "Peers" (String.concat ";\n" Header_pack.(to_str_list peers)) kv in
let cs = converters types kv in
directory cs noindex dir info.Header_pack.id kv)
| path when Sys.file_exists path ->