Implement library caching TitleInfo

* Cache sum of entry progress
* Cache cover_url
* Cache display_name
* Cache sort_opt
This commit is contained in:
Leeingnyo
2021-08-22 23:36:28 +09:00
parent 00c9cc1fcd
commit 4a09aee177
6 changed files with 200 additions and 2 deletions
+3
View File
@@ -35,12 +35,15 @@ class SortOptions
end
def self.from_info_json(dir, username)
cached_opt = InfoCache.get_sort_opt dir, username
return cached_opt if cached_opt
opt = SortOptions.new
TitleInfo.new dir do |info|
if info.sort_by.has_key? username
opt = SortOptions.from_tuple info.sort_by[username]
end
end
InfoCache.set_sort_opt dir, username, opt
opt
end