diff --git a/project.clj b/project.clj index c9a1d3b..89fb513 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject rss-thread-watch "0.3.8-SNAPSHOT" +(defproject rss-thread-watch "0.4.0-SNAPSHOT" :description "RSS based thread watcher" :url "http://example.com/FIXME" :license {:name "AGPL-3.0-only" diff --git a/src/rss_thread_watch/core.clj b/src/rss_thread_watch/core.clj index 558ba0a..7799a10 100644 --- a/src/rss_thread_watch/core.clj +++ b/src/rss_thread_watch/core.clj @@ -23,7 +23,7 @@ [rss-thread-watch.utils :as u]) (:gen-class)) -(def VERSION "0.3.8") +(def VERSION "0.4.0") ;; Internal default config (def CONFIG-DEFAULT @@ -99,7 +99,6 @@ (let [file-to-try (u/nil?-else custom-file "./config.edn")] (u/when-else (load-config file-to-try) - CONFIG-DEFAULT)))) (defn -main diff --git a/src/rss_thread_watch/feed_generator.clj b/src/rss_thread_watch/feed_generator.clj index e619965..7c6c15d 100644 --- a/src/rss_thread_watch/feed_generator.clj +++ b/src/rss_thread_watch/feed_generator.clj @@ -87,7 +87,7 @@ "Generates feed from matching items" [query-vec chod-treshold repeat? cache] (let [items (filter-chod-posts query-vec chod-treshold repeat? cache) - head {:title "RSS Thread watcher v0.1" + head {:title "RSS Thread watcher v0.4" ;TODO: hardcoded string here, remake to reference to config.clj :link "https://tools.treebrary.org/thread-watcher/feed.xml" :feed-url "https://tools.treebrary.org/thread-watcher/feed.xml" :description "RSS based thread watcher"} diff --git a/src/rss_thread_watch/watcher.clj b/src/rss_thread_watch/watcher.clj index d4844a5..93b068c 100644 --- a/src/rss_thread_watch/watcher.clj +++ b/src/rss_thread_watch/watcher.clj @@ -78,14 +78,16 @@ pages-total (count catalog) ;; universal calculation for total number of threads: ;; (pages-total -1) * threadsPerPage + threadsOnLastpage ;;accounts for boards which have stickied threads making them have 11pages - threads-per-page (count (:threads (first catalog))) + threads-per-page (count (:threads (first catalog))) ;; TODO: last could be remade to peek if it's a vector threads-total (+ (* threads-per-page (dec pages-total)) (count (:threads (last catalog)))) ;; Todo: Yeah, maybe this calculation could be refactored into let to-index (filter (fn [item] (<= starting-page (:page item))) catalog)] ;; TODO: there absolutely must be try catch for missing - not enabled boards, + ;; This is probably resolved now, but keeping it just in case ;; This will return nill and that fuck everything up - (reset! (get @chod-threads-cache board) - (build-cache to-index pages-total threads-per-page threads-total)))) + (println "Refreshed cache for " board) + (reset! (get @chod-threads-cache board) + (build-cache to-index pages-total threads-per-page threads-total)))) (defn board-enabled? "Checks whether board is enabled in config"