Drafted async-http downloader, fixed not correctly fetching icons at startup

This commit is contained in:
2022-02-10 22:40:51 -06:00
parent e267a17c76
commit 202966fd08
3 changed files with 42 additions and 6 deletions

View File

@@ -134,9 +134,10 @@ class W3DHub
regenerate = false
if File.exist?(path)
regenerate = Digest::SHA256.new.hexdigest(File.binread(path)).upcase != package.checksum.upcase
regenerate ||= !File.exist?(generated_icon_path)
broken_or_out_dated_icon = Digest::SHA256.new.hexdigest(File.binread(path)).upcase != package.checksum.upcase if File.exist?(path)
if File.exist?(path) && !broken_or_out_dated_icon
regenerate = !File.exist?(generated_icon_path)
else
Cache.fetch_package(package, proc {})
regenerate = true