fix: remove asset "version check"

This commit is contained in:
goat 2020-04-27 14:51:39 +02:00
parent 6e2c55a59c
commit d4244566e8

View file

@ -27,17 +27,6 @@ namespace Dalamud.Interface
public static async Task EnsureAssets(string baseDir) { public static async Task EnsureAssets(string baseDir) {
using var client = new HttpClient(); using var client = new HttpClient();
var assetVerRemote = await client.GetStringAsync(AssetStoreUrl + "version");
var assetVerPath = Path.Combine(baseDir, "assetver");
var assetVerLocal = "0";
if (File.Exists(assetVerPath))
assetVerLocal = File.ReadAllText(assetVerPath);
var forceRedownload = assetVerLocal != assetVerRemote;
if (forceRedownload)
Log.Information("Assets need redownload");
Log.Verbose("Starting asset download"); Log.Verbose("Starting asset download");
foreach (var entry in AssetDictionary) { foreach (var entry in AssetDictionary) {
@ -45,7 +34,7 @@ namespace Dalamud.Interface
Directory.CreateDirectory(Path.GetDirectoryName(filePath)); Directory.CreateDirectory(Path.GetDirectoryName(filePath));
if (!File.Exists(filePath) || forceRedownload) { if (!File.Exists(filePath)) {
Log.Verbose("Downloading {0} to {1}...", entry.Key, entry.Value); Log.Verbose("Downloading {0} to {1}...", entry.Key, entry.Value);
try { try {
File.WriteAllBytes(filePath, await client.GetByteArrayAsync(entry.Key)); File.WriteAllBytes(filePath, await client.GetByteArrayAsync(entry.Key));
@ -56,13 +45,6 @@ namespace Dalamud.Interface
} }
} }
try {
File.WriteAllText(assetVerPath, assetVerRemote);
} catch (Exception ex) {
Log.Error(ex, "Could not write asset version.");
}
} }
} }
} }