public
Description: The kick ass (non-commercial) home for musicians and their music
Homepage: http://alonetone.com
Clone URL: git://github.com/sudara/alonetone.git
a bit more toying with 'kicking ass' algo
sudara (author)
Thu Mar 13 08:31:09 -0700 2008
commit  a89e1d9544dabae200ee90672c816f3cc86611a6
tree    22b3b94c20ce8530bca2d9ca8914f8211d7f09e2
parent  ef80289d5ab19d8d85b37fb6881d1f41502dd479
...
176
177
178
179
 
180
181
182
 
183
184
185
...
197
198
199
200
201
202
203
204
205
 
 
 
 
 
 
206
207
208
...
176
177
178
 
179
180
181
 
182
183
184
185
...
197
198
199
 
 
 
 
 
 
200
201
202
203
204
205
206
207
208
0
@@ -176,10 +176,10 @@ class Asset < ActiveRecord::Base
0
   
0
   def calculate_hotness
0
     # hotness = listens not originating from own user within last 7 days * num of alonetoners who listened to it / age
0
- ratio = (recent_listen_count.to_f * unique_listener_count.to_f) * age_ratio * listens_per_day * (comment.size + 1)
0
+ ratio = ((recent_listen_count.to_f) * (unique_listener_count / 3) * age_ratio )
0
   end
0
   
0
- def recent_listen_count(from = 7.days.ago, to = 1.days.ago)
0
+ def recent_listen_count(from = 7.days.ago, to = 1.hour.ago)
0
    listens.count(:all, :conditions => ['listens.created_at > ? AND listens.created_at < ? AND listens.listener_id != ?',from, to, self.user_id])
0
   end
0
   
0
@@ -197,12 +197,12 @@ class Asset < ActiveRecord::Base
0
   
0
   def age_ratio
0
     case days_old
0
- when 0..3 then 6.0
0
- when 4..7 then 4.0
0
- when 8..15 then 2.0
0
- when 16..30 then 1.0
0
- when 31..90 then 0.8
0
- else 0.3
0
+ when 0..3 then 12.0
0
+ when 4..7 then 8.0
0
+ when 8..15 then 4.0
0
+ when 16..30 then 2.5
0
+ when 31..90 then 1.0
0
+ else 0.5
0
     end
0
   end
0
   

Comments

    No one has commented yet.