Make entry generic

This commit is contained in:
Leeingnyo
2021-09-04 14:37:29 +09:00
parent 9e90aa17b9
commit 5e919d3e19
2 changed files with 50 additions and 14 deletions
+2 -2
View File
@@ -346,7 +346,7 @@ class Title
def sorted_entries(username, opt : SortOptions? = nil)
cache_key = SortedEntriesCacheEntry.gen_key @id, username, @entries, opt
cached_entries = SortedEntriesCache.get cache_key
return cached_entries if cached_entries
return cached_entries if cached_entries.is_a? Array(Entry)
if opt.nil?
opt = SortOptions.from_info_json @dir, username
@@ -382,7 +382,7 @@ class Title
ary.reverse! unless opt.not_nil!.ascend
if Config.current.sorted_entries_cache_enable
SortedEntriesCache.set cache_key, ary
SortedEntriesCache.set generate_cache_entry cache_key, ary
end
ary
end