Final version bumps and todos

Ready for release
This commit is contained in:
Felisp 2024-08-13 17:45:31 +02:00
parent 533dcc9924
commit 2266ecae35
4 changed files with 8 additions and 7 deletions

View file

@ -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"

View file

@ -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

View file

@ -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"}

View file

@ -78,12 +78,14 @@
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
(println "Refreshed cache for " board)
(reset! (get @chod-threads-cache board)
(build-cache to-index pages-total threads-per-page threads-total))))