Fix download prioritization

This commit is contained in:
Hugo Peixoto 2023-08-01 01:14:16 +01:00
parent aa8a920288
commit 95c8b982bf

View File

@ -60,7 +60,7 @@ get '/videos.json' do
videos = Video
.left_outer_joins(:downloads)
.group("randname")
.order("COUNT(1) ASC, RANDOM()")
.order("COUNT(downloads.video_id) ASC, RANDOM()")
.limit(amount)
.pluck(:randname)