From 9ac02e47f95324e6f53808becd09a7be26ed2815 Mon Sep 17 00:00:00 2001 From: Felisp Date: Sun, 27 Oct 2024 00:07:13 +0200 Subject: [PATCH] Macro todo, indent, syncing --- src/rss_thread_watch/feed_generator.clj | 11 ++++++----- src/rss_thread_watch/utils.clj | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rss_thread_watch/feed_generator.clj b/src/rss_thread_watch/feed_generator.clj index 46c58dc..40671cc 100644 --- a/src/rss_thread_watch/feed_generator.clj +++ b/src/rss_thread_watch/feed_generator.clj @@ -97,11 +97,11 @@ "Converts cached thread item to feed item which can be serialized into RSS" [t host] (let [link-url (s/replace host "{threadnum}" (str (:no 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 - :description (format "The thread: '%s' has %.2f%% chance of dying" (:title t) (:chod t)) - :link link-url - :guid (:guid 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 + :description (format "The thread: '%s' has %.2f%% chance of dying" (:title t) (:chod t)) + :link link-url + :guid (:guid t)})) (defn generate-feed "Generates feed from matching items @@ -160,6 +160,7 @@ (throw (ex-info "404" {:status 404 :header {"Content-Type" "text/plain"} :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) (throw (ex-info "403" {:status 403 :header {"Content-Type" "text/plain"} diff --git a/src/rss_thread_watch/utils.clj b/src/rss_thread_watch/utils.clj index 0106301..d96ea78 100644 --- a/src/rss_thread_watch/utils.clj +++ b/src/rss_thread_watch/utils.clj @@ -54,6 +54,8 @@ v [v])) +;; TODO: Macro that will update all keys with specified function + ;; ===== Generic functions ==== (defn indices