Add /Api/GamesToRedeemInBackground

P.S. Not tested yet, too lazy to do so as of now.
This commit is contained in:
JustArchi
2018-02-14 19:14:33 +01:00
parent ca1fcf33d8
commit 3b234f0a4d
2 changed files with 103 additions and 12 deletions

View File

@@ -307,6 +307,15 @@ namespace ArchiSteamFarm {
return await BotDatabase.MobileAuthenticator.HandleConfirmations(confirmations, accept).ConfigureAwait(false);
}
internal async Task AddGamesToRedeemInBackground(IReadOnlyDictionary<string, string> gamesToRedeemInBackground) {
if ((gamesToRedeemInBackground == null) || (gamesToRedeemInBackground.Count == 0)) {
ArchiLogger.LogNullError(nameof(gamesToRedeemInBackground));
return;
}
await BotDatabase.AddGamesToRedeemInBackground(gamesToRedeemInBackground).ConfigureAwait(false);
}
internal async Task<bool> DeleteAllRelatedFiles() {
try {
await BotDatabase.MakeReadOnly().ConfigureAwait(false);
@@ -1350,7 +1359,7 @@ namespace ArchiSteamFarm {
gamesToRedeemInBackground[key] = game;
}
await BotDatabase.AddGamesToRedeemInBackground(gamesToRedeemInBackground).ConfigureAwait(false);
await AddGamesToRedeemInBackground(gamesToRedeemInBackground).ConfigureAwait(false);
File.Delete(filePath);
}
} catch (Exception e) {