mirror of https://codeberg.org/cage/tinmop/
- [gemini] starting download thread in ':rendering' status.
This commit is contained in:
parent
4941c21d94
commit
1c3a3d9bff
|
@ -242,7 +242,7 @@
|
|||
(%fill-buffer))))))
|
||||
(%fill-buffer))))))
|
||||
|
||||
(defun request (url)
|
||||
(defun request (url &key (enqueue nil))
|
||||
(let ((parsed-uri (quri:uri url)))
|
||||
(maybe-initialize-metadata specials:*message-window*)
|
||||
(if (null parsed-uri)
|
||||
|
@ -255,7 +255,17 @@
|
|||
(port (or (quri:uri-port parsed-uri)
|
||||
gemini-client:+gemini-default-port+)))
|
||||
(handler-case
|
||||
(flet ((get-user-input (hide-input host prompt)
|
||||
(labels ((gemini-file-stream-p (meta)
|
||||
(gemini-client:mime-gemini-p meta))
|
||||
(starting-status (meta)
|
||||
(if (gemini-file-stream-p meta)
|
||||
(if enqueue
|
||||
nil
|
||||
:rendering)
|
||||
(if enqueue
|
||||
nil
|
||||
nil)))
|
||||
(get-user-input (hide-input host prompt)
|
||||
(flet ((on-input-complete (input)
|
||||
(when (string-not-empty-p input)
|
||||
(db-utils:with-ready-database (:connect nil)
|
||||
|
@ -296,8 +306,10 @@
|
|||
((gemini-client:response-sensitive-input-p status)
|
||||
(get-user-input t host meta))
|
||||
((streamp response)
|
||||
(if (gemini-client:mime-gemini-p meta)
|
||||
(let* ((gemini-stream (make-instance 'gemini-file-stream
|
||||
(if (gemini-file-stream-p meta)
|
||||
(let* ((starting-status (starting-status meta))
|
||||
(gemini-stream (make-instance 'gemini-file-stream
|
||||
:stream-status starting-status
|
||||
:download-stream response
|
||||
:download-socket socket))
|
||||
(thread-fn
|
||||
|
|
Loading…
Reference in New Issue