public
Fork of sudara/alonetone
Description: alonetone - a damn fine musician's home. Upload mp3s, create playlists, track listens, get your widget on. (looking for dev help!)
Homepage: http://alonetone.com
Clone URL: git://github.com/taansen/alonetone.git
tweak the 'hotness' algo and fix the single mp3 flash player
sudara (author)
Wed Mar 26 11:25:12 -0700 2008
commit  325ac6ebb6630957d069775b0889ee3b7010ef83
tree    e82203d78b064f43550dd92f2f86d7652f497e18
parent  4cd5571b8b7b04d82ed535357fb6aa25380de0b3
...
176
177
178
179
 
180
181
182
...
197
198
199
200
 
201
202
 
203
204
205
...
176
177
178
 
179
180
181
182
...
197
198
199
 
200
201
 
202
203
204
205
0
@@ -176,7 +176,7 @@ 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 / 3) * age_ratio )
0
+ ratio = ((recent_listen_count.to_f) * (((unique_listener_count * 10) / User.count) + 1) * age_ratio )
0
   end
0
   
0
   def recent_listen_count(from = 7.days.ago, to = 1.hour.ago)
0
@@ -197,9 +197,9 @@ class Asset < ActiveRecord::Base
0
   
0
   def age_ratio
0
     case days_old
0
- when 0..3 then 12.0
0
+ when 0..3 then 20.0
0
       when 4..7 then 8.0
0
- when 8..15 then 4.0
0
+ when 8..15 then 3.0
0
       when 16..30 then 2.5
0
       when 31..90 then 1.0
0
       else 0.5
...
34
35
36
37
 
38
39
40
...
34
35
36
 
37
38
39
40
0
@@ -34,7 +34,7 @@ end %>
0
 <div id="flash_code_<%=id%>" style="display:none;">
0
   <div class="scriptaculous">
0
     <h3>Embedd a Flash Player</h3>
0
- <%= text_area_tag 'flash_player', "<embed src=\"#{FLASH_PLAYER}\" width=\"250\" height=\"20\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"&file=#{formatted_user_track_url(object.user, object.permalink, :mp3, :referrer => 'stream_on')}&height=20&width=250&frontcolor=0x3C3C3C&backcolor=0xf3f3f3&lightcolor=0xFF944B&screencolor=0xFF944B&showdigits=false\" />", :rows => 3, :cols =>50 %>
0
+ <%= text_area_tag 'flash_player', "<embed src=\"#{FLASH_PLAYER}\" width=\"250\" height=\"20\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"&file=#{formatted_user_track_url(object.user, object.permalink, :mp3)}&height=20&width=250&frontcolor=0x3C3C3C&backcolor=0xf3f3f3&lightcolor=0xFF944B&screencolor=0xFF944B&showdigits=false\" />", :rows => 3, :cols =>50 %>
0
     <p class="tip">(customize how it looks by visiting <%= link_to 'the setup wizard', 'http://www.jeroenwijering.com/?page=wizard&example=2'%>)
0
     </p>
0
   </div>

Comments

    No one has commented yet.