diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2011-03-06 23:30:58 -0500 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2011-03-06 23:30:58 -0500 |
| commit | 4a51655dd1174dbb2a594c56b6c300f01872a949 (patch) | |
| tree | fac99331cc3e4d95882a6c3622280dcba3631d83 | |
| parent | d4fbaddc50de38ec7853730f8cf6211d510dc2f3 (diff) | |
Fix favscore nick lookup, clean up front page redirection
| -rw-r--r-- | src/datalayer.clj | 4 | ||||
| -rw-r--r-- | src/site.clj | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/datalayer.clj b/src/datalayer.clj index 32f743f..5a9026c 100644 --- a/src/datalayer.clj +++ b/src/datalayer.clj @@ -179,7 +179,7 @@ WHERE u.nick = ANY(?)" -1 (maybe-parse-int (redis/with-server redis-server - (redis/zscore "favscores" (lower-case nick))) + (redis/zscore redis-favscores-key nick)) 0))) (defn incrby-redis-favscore! [msg incr] @@ -189,7 +189,7 @@ WHERE u.nick = ANY(?)" incr (double incr)] (with-jedis #(do - (.zincrby % "favscores" incr nick) + (.zincrby % redis-favscores-key incr nick) (when is-image? (.zincrby % (redis-daily-hall-key (:created_on msg)) incr msg-id) (.zincrby % (redis-popular-key nick) incr msg-id) diff --git a/src/site.clj b/src/site.clj index 35073e5..b6c8882 100644 --- a/src/site.clj +++ b/src/site.clj @@ -205,8 +205,8 @@ ([session dt-str] (let [today (Date.)] (if-let [[prev-date cur-date next-date] (parse-front-page-date dt-str)] - (cond (neg? (.compareTo cur-date earliest-daily-hall)) (redirect-to "/") - (pos? (.compareTo cur-date (Date.))) (redirect-to "/") + (cond (.before cur-date earliest-daily-hall) (redirect-to "/") + (.after cur-date today) (redirect-to "/") :else (let [st (fetch-template "frontpage" session) dumps (map process-message-for-output (fetch-redis-daily-hall cur-date 0 20 (:user_id session)))] |
