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
-5
View File
@@ -51,11 +51,6 @@ class Library
def sorted_titles(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
# Helper function from src/util/util.cr