mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Refresh token at start up now works, added a bit of a hack to populate account info by opening the login page first and having it populate the data then load the games page, added Cache, and Settings
This commit is contained in:
@@ -134,18 +134,20 @@ class W3DHub
|
||||
if news
|
||||
news.items[0..9].each do |item|
|
||||
# Cache Image
|
||||
ext = File.basename(item.image).split(".").last
|
||||
path = "#{CACHE_PATH}/#{Digest::SHA2.hexdigest(item.image)}.#{ext}"
|
||||
# ext = File.basename(item.image).split(".").last
|
||||
# path = "#{CACHE_PATH}/#{Digest::SHA2.hexdigest(item.image)}.#{ext}"
|
||||
|
||||
next if File.exist?(path)
|
||||
# next if File.exist?(path)
|
||||
|
||||
response = Excon.get(item.image)
|
||||
# response = Excon.get(item.image)
|
||||
|
||||
if response.status == 200
|
||||
File.open(path, "wb") do |f|
|
||||
f.write(response.body)
|
||||
end
|
||||
end
|
||||
# if response.status == 200
|
||||
# File.open(path, "wb") do |f|
|
||||
# f.write(response.body)
|
||||
# end
|
||||
# end
|
||||
|
||||
Cache.fetch(item.image)
|
||||
end
|
||||
|
||||
@@game_news[game.id] = news
|
||||
@@ -161,8 +163,7 @@ class W3DHub
|
||||
flow(width: 0.5, height: 128, margin: 4) do
|
||||
# background 0x88_000000
|
||||
|
||||
ext = File.basename(item.image).split(".").last
|
||||
path = "#{CACHE_PATH}/#{Digest::SHA2.hexdigest(item.image)}.#{ext}"
|
||||
path = Cache.path(item.image)
|
||||
|
||||
if File.exist?(path)
|
||||
image path, width: 0.4, padding: 4
|
||||
|
||||
Reference in New Issue
Block a user