Always schedule package for refresh on token change

This commit is contained in:
JustArchi 2020-06-13 13:03:13 +02:00
parent 0d8753f44e
commit 73014c71a1
2 changed files with 4 additions and 3 deletions

View file

@ -2381,9 +2381,10 @@ namespace ArchiSteamFarm {
if (!ASF.GlobalDatabase.PackageAccessTokensReadOnly.TryGetValue(license.PackageID, out ulong packageAccessToken) || (packageAccessToken != license.AccessToken)) {
packageAccessTokens[license.PackageID] = license.AccessToken;
}
if (!ASF.GlobalDatabase.PackagesDataReadOnly.TryGetValue(license.PackageID, out (uint ChangeNumber, HashSet<uint> AppIDs) packageData) || (packageData.ChangeNumber < license.LastChangeNumber)) {
// Package is always due to refresh with access token change
packagesToRefresh[license.PackageID] = (uint) license.LastChangeNumber;
} else if (!ASF.GlobalDatabase.PackagesDataReadOnly.TryGetValue(license.PackageID, out (uint ChangeNumber, HashSet<uint> AppIDs) packageData) || (packageData.ChangeNumber < license.LastChangeNumber)) {
packagesToRefresh[license.PackageID] = (uint) license.LastChangeNumber;
}
}

View file

@ -204,7 +204,7 @@ namespace ArchiSteamFarm {
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)) {
if (PackagesData.TryGetValue(packageID, out (uint ChangeNumber, HashSet<uint> AppIDs) previousData) && (packageData.ChangeNumber < previousData.ChangeNumber)) {
continue;
}