Macro todo, indent, syncing

This commit is contained in:
Felisp 2024-10-27 00:07:13 +02:00
parent 987a01906e
commit 9ac02e47f9
2 changed files with 8 additions and 5 deletions

View file

@ -97,11 +97,11 @@
"Converts cached thread item to feed item which can be serialized into RSS" "Converts cached thread item to feed item which can be serialized into RSS"
[t host] [t host]
(let [link-url (s/replace host "{threadnum}" (str (:no t)))] (let [link-url (s/replace host "{threadnum}" (str (:no t)))]
{:title (format "%.2f%% - %s" (:chod t) (:title t)) {:title (format "%.2f%% - %s" (:chod t) (:title t))
;; :url link-url <- this is supposed to be for images according to: https://cyber.harvard.edu/rss/rss.html ;; :url link-url <- this is supposed to be for images according to: https://cyber.harvard.edu/rss/rss.html
:description (format "The thread: '%s' has %.2f%% chance of dying" (:title t) (:chod t)) :description (format "The thread: '%s' has %.2f%% chance of dying" (:title t) (:chod t))
:link link-url :link link-url
:guid (:guid t)})) :guid (:guid t)}))
(defn generate-feed (defn generate-feed
"Generates feed from matching items "Generates feed from matching items
@ -160,6 +160,7 @@
(throw (ex-info "404" {:status 404 (throw (ex-info "404" {:status 404
:header {"Content-Type" "text/plain"} :header {"Content-Type" "text/plain"}
:body (str "404 This server has nothing but " served-filename)}))) :body (str "404 This server has nothing but " served-filename)})))
;; BUG: This also keeps hapening when board cache is nil
(when-not (contains? @boards-enabled-cache board) (when-not (contains? @boards-enabled-cache board)
(throw (ex-info "403" {:status 403 (throw (ex-info "403" {:status 403
:header {"Content-Type" "text/plain"} :header {"Content-Type" "text/plain"}

View file

@ -54,6 +54,8 @@
v v
[v])) [v]))
;; TODO: Macro that will update all keys with specified function
;; ===== Generic functions ==== ;; ===== Generic functions ====
(defn indices (defn indices