Brought back Excon for package downloading as the method recommended by async-http is unreliable, added support for importing games, repairer and updater tasks are both now simple subclasses of installer, implemented verify_files for checking installed files to prune download package list (currently causes Api.package_details to fail..., so disabled for now), misc. changes.

This commit is contained in:
2021-12-28 17:55:40 -06:00
parent f4aa666386
commit 82add3cc9d
12 changed files with 221 additions and 132 deletions

View File

@@ -36,14 +36,14 @@ class W3DHub
@tasks.push(updater)
end
def import(app_id, channel, path)
puts "Import Request: #{app_id}-#{channel} -> #{path}"
def import(app_id, channel)
puts "Import Request: #{app_id}-#{channel}"
# Check registry for auto-import if windows
# if auto-import fails ask user for path to game exe
# mark app as imported/installed
@tasks.push(Importer.new(app_id, channel, path))
@tasks.push(Importer.new(app_id, channel))
end
def settings(app_id, channel)
@@ -238,6 +238,19 @@ class W3DHub
end
end
def imported!(task, exe_path)
application_data = {
install_directory: File.basename(exe_path),
installed_version: task.channel.current_version,
install_path: exe_path,
wine_prefix: task.wine_prefix
}
Store.settings[:games] ||= {}
Store.settings[:games][:"#{task.app_id}_#{task.release_channel}"] = application_data
Store.settings.save_settings
end
def installed!(task)
# install_dir
# installed_version