about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-28 19:48:44 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-28 19:48:44 +0100
commite82dad535bd0e55427841a1d0b56a1194d0be0c6 (patch)
tree42be5668e06736620ff90a02e3bec14fb0ddb60e
parent94f2ed4c705d59787c7004138a28decd0ac6257a (diff)
downloadchawan-e82dad535bd0e55427841a1d0b56a1194d0be0c6.tar.gz
loader: fix missing newline in downloads
-rw-r--r--src/server/loader.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/loader.nim b/src/server/loader.nim
index 753c3161..2faadd3a 100644
--- a/src/server/loader.nim
+++ b/src/server/loader.nim
@@ -1125,7 +1125,9 @@ proc formatDuration(dur: Duration): string =
     result &= $parts[it]
 
 proc makeProgress(it: DownloadItem; now: Time): string =
-  result = "  "
+  result = it.displayUrl.htmlEscape() & '\n'
+  result &= "  -> " & it.path & '\n'
+  result &= "  "
   #TODO implement progress element and use that
   var rat = 0u64
   if it.contentLen == uint64.high and it.sent > 0 and it.output == nil:
@@ -1205,8 +1207,6 @@ proc loadDownload(ctx: LoaderContext; handle: InputHandle; request: Request) =
     let now = getTime()
     var refresh = false
     for i, it in ctx.downloadList.mpairs:
-      body &= it.displayUrl.htmlEscape()
-      body &= "\n  --> " & it.path
       if it.output != nil:
         it.sent = it.output.bytesSent
         if it.output.stream == nil: