sort results by score value

This commit is contained in:
Senghan Bright 2021-01-14 13:11:22 +01:00
parent bcec7dd4b8
commit a78efd4afa

View File

@ -70,6 +70,13 @@ local function get_file_scores()
score = calculate_file_score(file_entry.count, filter_timestamps(timestamp_ages, file_entry.id)) score = calculate_file_score(file_entry.count, filter_timestamps(timestamp_ages, file_entry.id))
}) })
end end
-- sort the table
local function compare(a, b)
return a.score > b.score
end
table.sort(scores, compare)
return scores return scores
end end