From c2a315b945e77874338a16e119e9a9045ec50d69 Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Fri, 25 Oct 2024 23:48:13 -0500 Subject: [PATCH] fix leaderboard --- app/controllers/yiff_rest/api_v2/images_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/yiff_rest/api_v2/images_controller.rb b/app/controllers/yiff_rest/api_v2/images_controller.rb index 82eb9fb..b9d2b5e 100644 --- a/app/controllers/yiff_rest/api_v2/images_controller.rb +++ b/app/controllers/yiff_rest/api_v2/images_controller.rb @@ -108,6 +108,7 @@ module YiffRest end def leaderboard + @sp = {} @list = APIImage.all_seen.sort_by(&:second).reverse.to_h @keys = @list.map(&:first) @results = APIImage.where(id: @keys).sort_by { |img| @keys.index(img.md5) }