update for new recommender service changes

This commit is contained in:
r888888888
2018-07-21 23:19:11 -07:00
parent c9092d52d7
commit a669fe361c
2 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ module RecommenderService
def available_for_post?(post) def available_for_post?(post)
return true if Rails.env.development? return true if Rails.env.development?
enabled? && CurrentUser.enable_recommended_posts? && post.created_at > Date.civil(2018, 1, 1) && post.score >= SCORE_THRESHOLD enabled? && CurrentUser.enable_recommended_posts? && post.created_at > Date.civil(2017, 1, 1) && post.fav_count >= SCORE_THRESHOLD
end end
def available_for_user? def available_for_user?
@@ -34,7 +34,7 @@ module RecommenderService
end end
def recommend_for_post(post_id) def recommend_for_post(post_id)
ids = Cache.get("rss:#{post_id}", 1.day) do ids = Cache.get("rss:#{post_id}", 1.hour) do
resp = HTTParty.get( resp = HTTParty.get(
"#{Danbooru.config.recommender_server}/similar/#{post_id}", "#{Danbooru.config.recommender_server}/similar/#{post_id}",
Danbooru.config.httparty_options.merge( Danbooru.config.httparty_options.merge(

View File

@@ -2,7 +2,7 @@
<div id="a-index"> <div id="a-index">
<h1>Recommended Posts</h1> <h1>Recommended Posts</h1>
<p>Based on your voting history, you may enjoy these posts. Vote more to get more accurate results. These recommendations update every hour.</p> <p>Based on your favorites, you may enjoy these posts. Favorite more to get more accurate results. These recommendations update every hour.</p>
<%= render partial: "show" %> <%= render partial: "show" %>
</div> </div>