tweaks to similar posts
This commit is contained in:
@@ -6,10 +6,16 @@ module RecommenderService
|
||||
end
|
||||
|
||||
def available?(post)
|
||||
return true if Rails.env.development?
|
||||
|
||||
enabled? && CurrentUser.id == 1 && post.created_at > 6.months.ago && post.score >= 10
|
||||
end
|
||||
|
||||
def similar(post)
|
||||
if Danbooru.config.recommender_server == "development"
|
||||
return Post.order("random()").limit(6).map {|x| [x.id, "1.000"]}
|
||||
end
|
||||
|
||||
Cache.get("rss:#{post.id}", 1.day) do
|
||||
resp = HTTParty.get(
|
||||
"#{Danbooru.config.recommender_server}/similar/#{post.id}",
|
||||
|
||||
Reference in New Issue
Block a user