Final version bumps and todos
Ready for release
This commit is contained in:
parent
533dcc9924
commit
2266ecae35
4 changed files with 8 additions and 7 deletions
|
@ -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"
|
:description "RSS based thread watcher"
|
||||||
:url "http://example.com/FIXME"
|
:url "http://example.com/FIXME"
|
||||||
:license {:name "AGPL-3.0-only"
|
:license {:name "AGPL-3.0-only"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
[rss-thread-watch.utils :as u])
|
[rss-thread-watch.utils :as u])
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
(def VERSION "0.3.8")
|
(def VERSION "0.4.0")
|
||||||
|
|
||||||
;; Internal default config
|
;; Internal default config
|
||||||
(def CONFIG-DEFAULT
|
(def CONFIG-DEFAULT
|
||||||
|
@ -99,7 +99,6 @@
|
||||||
(let [file-to-try (u/nil?-else custom-file
|
(let [file-to-try (u/nil?-else custom-file
|
||||||
"./config.edn")]
|
"./config.edn")]
|
||||||
(u/when-else (load-config file-to-try)
|
(u/when-else (load-config file-to-try)
|
||||||
|
|
||||||
CONFIG-DEFAULT))))
|
CONFIG-DEFAULT))))
|
||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
"Generates feed from matching items"
|
"Generates feed from matching items"
|
||||||
[query-vec chod-treshold repeat? cache]
|
[query-vec chod-treshold repeat? cache]
|
||||||
(let [items (filter-chod-posts 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"
|
:link "https://tools.treebrary.org/thread-watcher/feed.xml"
|
||||||
:feed-url "https://tools.treebrary.org/thread-watcher/feed.xml"
|
:feed-url "https://tools.treebrary.org/thread-watcher/feed.xml"
|
||||||
:description "RSS based thread watcher"}
|
:description "RSS based thread watcher"}
|
||||||
|
|
|
@ -78,14 +78,16 @@
|
||||||
pages-total (count catalog)
|
pages-total (count catalog)
|
||||||
;; universal calculation for total number of threads:
|
;; universal calculation for total number of threads:
|
||||||
;; (pages-total -1) * threadsPerPage + threadsOnLastpage ;;accounts for boards which have stickied threads making them have 11pages
|
;; (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
|
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]
|
to-index (filter (fn [item]
|
||||||
(<= starting-page (:page item))) catalog)]
|
(<= starting-page (:page item))) catalog)]
|
||||||
;; TODO: there absolutely must be try catch for missing - not enabled boards,
|
;; 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
|
;; This will return nill and that fuck everything up
|
||||||
(reset! (get @chod-threads-cache board)
|
(println "Refreshed cache for " board)
|
||||||
(build-cache to-index pages-total threads-per-page threads-total))))
|
(reset! (get @chod-threads-cache board)
|
||||||
|
(build-cache to-index pages-total threads-per-page threads-total))))
|
||||||
|
|
||||||
(defn board-enabled?
|
(defn board-enabled?
|
||||||
"Checks whether board is enabled in config"
|
"Checks whether board is enabled in config"
|
||||||
|
|
Loading…
Reference in a new issue