Do not report warning over having empty list of packagesData

It can be empty if we're not able to fetch any of given packageIDs, e.g. because of missing token.
This commit is contained in:
JustArchi
2020-06-10 22:43:06 +02:00
parent fa7bb801db
commit bdc3beb15a

View File

@@ -195,17 +195,26 @@ namespace ArchiSteamFarm {
Dictionary<uint, (uint ChangeNumber, HashSet<uint> AppIDs)> packagesData = await bot.GetPackagesData(packageIDs).ConfigureAwait(false);
if ((packagesData == null) || (packagesData.Count == 0)) {
if (packagesData == null) {
bot.ArchiLogger.LogGenericWarning(Strings.WarningFailed);
return;
}
bool save = false;
foreach ((uint packageID, (uint ChangeNumber, HashSet<uint> AppIDs) packageData) in packagesData) {
if (PackagesData.TryGetValue(packageID, out (uint ChangeNumber, HashSet<uint> AppIDs) previousData) && (packageData.ChangeNumber <= previousData.ChangeNumber)) {
continue;
}
PackagesData[packageID] = packageData;
save = true;
}
Utilities.InBackground(Save);
if (save) {
Utilities.InBackground(Save);
}
} finally {
PackagesRefreshSemaphore.Release();
}