Prevent saving a sort opt unnecessarily

This commit is contained in:
Leeingnyo
2021-08-30 08:19:15 +09:00
parent 51a47b5ddd
commit 00c9cc1fcd
4 changed files with 24 additions and 13 deletions
+1 -5
View File
@@ -1,3 +1,4 @@
require "digest"
require "../archive"
class Title
@@ -329,11 +330,6 @@ class Title
def sorted_entries(username, opt : SortOptions? = nil)
if opt.nil?
opt = SortOptions.from_info_json @dir, username
else
TitleInfo.new @dir do |info|
info.sort_by[username] = opt.to_tuple
info.save
end
end
case opt.not_nil!.method