summaryrefslogtreecommitdiff
path: root/src/redisload.clj
diff options
context:
space:
mode:
authorScott Ostler <sbsotler@gmail.com>2010-11-23 01:40:43 -0500
committerScott Ostler <sbsotler@gmail.com>2010-11-23 01:40:43 -0500
commitad83cbd56471a628cf4cd657bdea962f4f323973 (patch)
tree3a995e2674e5ad9e35db2b2c27a5287cf821a680 /src/redisload.clj
parent85e6d3994f7d547fe525fb60cb8fcc0f96066c02 (diff)
Count txt messages for favscore
Diffstat (limited to 'src/redisload.clj')
-rw-r--r--src/redisload.clj20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/redisload.clj b/src/redisload.clj
index 07c1275..31a25f0 100644
--- a/src/redisload.clj
+++ b/src/redisload.clj
@@ -49,16 +49,16 @@ WHERE
(def score-map (ref {}))
(defn update-popular [r]
- (if (and (:is_image r) (not (:admin_only r)))
- (dosync
- (let [author (:author r)
- msg-id (:message_id r)
- user-map (get @popular-map author {})
- msg-cnt (get user-map msg-id 0)
- hall-cnt (get @hall-map msg-id 0)
- usr-cnt (get @score-map author 0)]
- (alter hall-map assoc msg-id (inc hall-cnt))
- (alter score-map assoc author (inc usr-cnt))
+ (dosync
+ (let [author (:author r)
+ msg-id (:message_id r)
+ user-map (get @popular-map author {})
+ msg-cnt (get user-map msg-id 0)
+ hall-cnt (get @hall-map msg-id 0)
+ usr-cnt (get @score-map author 0)]
+ (alter score-map assoc author (inc usr-cnt))
+ (alter hall-map assoc msg-id (inc hall-cnt))
+ (if (:is_image r)
(alter popular-map assoc author
(assoc user-map msg-id (inc msg-cnt)))))))