Move entry specific method

This commit is contained in:
Leeingnyo
2021-09-04 14:13:33 +09:00
parent 0a8fd993e5
commit 9e90aa17b9
3 changed files with 42 additions and 38 deletions
+2 -2
View File
@@ -344,7 +344,7 @@ class Title
# use the default (auto, ascending)
# When `opt` is not nil, it saves the options to info.json
def sorted_entries(username, opt : SortOptions? = nil)
cache_key = SortedEntriesCache.gen_key @id, username, @entries, opt
cache_key = SortedEntriesCacheEntry.gen_key @id, username, @entries, opt
cached_entries = SortedEntriesCache.get cache_key
return cached_entries if cached_entries
@@ -451,7 +451,7 @@ class Title
end
[false, true].each do |ascend|
sorted_entries_cache_key =
SortedEntriesCache.gen_key @id, username, @entries,
SortedEntriesCacheEntry.gen_key @id, username, @entries,
SortOptions.new(SortMethod::Progress, ascend)
SortedEntriesCache.invalidate sorted_entries_cache_key
end