Fixed #7 repairer task no longer forces an update when repairing

This commit is contained in:
2022-06-11 18:44:27 -05:00
parent 9f4ca51af8
commit 7e59c984ff
3 changed files with 7 additions and 5 deletions

View File

@@ -306,7 +306,7 @@ class W3DHub
install_directory = Cache.install_path(task.application, task.channel) install_directory = Cache.install_path(task.application, task.channel)
application_data = { application_data = {
install_directory: install_directory, install_directory: install_directory,
installed_version: task.channel.current_version, installed_version: task.target_version,
install_path: "#{install_directory}/game.exe", install_path: "#{install_directory}/game.exe",
wine_prefix: task.wine_prefix wine_prefix: task.wine_prefix
} }

View File

@@ -8,7 +8,7 @@ class W3DHub
include CyberarmEngine::Common include CyberarmEngine::Common
attr_reader :app_id, :release_channel, :application, :channel, attr_reader :app_id, :release_channel, :application, :channel, :target_version,
:manifests, :packages, :files, :wine_prefix, :status :manifests, :packages, :files, :wine_prefix, :status
def initialize(app_id, release_channel) def initialize(app_id, release_channel)
@@ -20,6 +20,8 @@ class W3DHub
@application = Store.applications.games.find { |g| g.id == app_id } @application = Store.applications.games.find { |g| g.id == app_id }
@channel = @application.channels.find { |c| c.id == release_channel } @channel = @application.channels.find { |c| c.id == release_channel }
@target_version = type == :repairer ? Store.settings[:games][:"#{app_id}_#{@channel.id}"][:installed_version] : @channel.current_state
@packages_to_download = [] @packages_to_download = []
@total_bytes_to_download = -1 @total_bytes_to_download = -1
@bytes_downloaded = -1 @bytes_downloaded = -1
@@ -203,8 +205,8 @@ class W3DHub
@status.step = :fetching_manifests @status.step = :fetching_manifests
if fetch_manifest("games", app_id, "manifest.xml", @channel.current_version) if fetch_manifest("games", app_id, "manifest.xml", @target_version)
manifest = load_manifest("games", app_id, "manifest.xml", @channel.current_version) manifest = load_manifest("games", app_id, "manifest.xml", @target_version)
@manifests << manifest @manifests << manifest
until(manifest.full?) until(manifest.full?)

View File

@@ -33,7 +33,7 @@ class W3DHub
stack(margin_left: 8, width: 0.75) do stack(margin_left: 8, width: 0.75) do
@application_name_label = tagline "#{task.application.name}" @application_name_label = tagline "#{task.application.name}"
@application_version_label = inscription "Version: #{task.channel.current_version} (#{task.channel.id})" @application_version_label = inscription "Version: #{task.target_version} (#{task.channel.id})"
end end
end end