Add sort option "Name" for title

This commit is contained in:
Leeingnyo
2021-12-24 16:29:55 +09:00
parent d7afd0969a
commit 57683d1cfb
2 changed files with 3 additions and 0 deletions

View File

@@ -98,6 +98,8 @@ def sort_titles(titles : Array(Title), opt : SortOptions, username : String)
(a.load_percentage(username) <=> b.load_percentage(username)).or \
compare_numerically a.title, b.title
end
when .title?
ary.sort! { |a, b| compare_numerically a.title, b.title }
else
unless opt.method.auto?
Logger.warn "Unknown sorting method #{opt.not_nil!.method}. Using " \