fix leaderboard

This commit is contained in:
Donovan Daniels 2024-10-25 23:48:13 -05:00
parent 9b8139f5f4
commit c2a315b945
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA

View File

@ -108,6 +108,7 @@ module YiffRest
end end
def leaderboard def leaderboard
@sp = {}
@list = APIImage.all_seen.sort_by(&:second).reverse.to_h @list = APIImage.all_seen.sort_by(&:second).reverse.to_h
@keys = @list.map(&:first) @keys = @list.map(&:first)
@results = APIImage.where(id: @keys).sort_by { |img| @keys.index(img.md5) } @results = APIImage.where(id: @keys).sort_by { |img| @keys.index(img.md5) }