mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Allow omitting the name in BGR import
Naming logic also applies to ASF API, but it's userspace in charge of making use of it.
This commit is contained in:
@@ -678,8 +678,13 @@ namespace ArchiSteamFarm {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Valid formats:
|
||||
// Key (name will be the same as key and replaced from redemption result, if possible)
|
||||
// Name + Key (user provides both, if name is equal to key, above logic is used, otherwise name is kept)
|
||||
// Name + <Ignored> + Key (BGR output format, we include extra properties in the middle, those are ignored during import)
|
||||
string[] parsedArgs = line.Split(DefaultBackgroundKeysRedeemerSeparator, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parsedArgs.Length < 2) {
|
||||
|
||||
if (parsedArgs.Length < 1) {
|
||||
ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorIsInvalid, line));
|
||||
continue;
|
||||
}
|
||||
@@ -2357,6 +2362,11 @@ namespace ArchiSteamFarm {
|
||||
break;
|
||||
}
|
||||
|
||||
// If user omitted the name or intentionally provided the same name as key, replace it with the Steam result
|
||||
if (name.Equals(key) && (result.Items != null) && (result.Items.Count > 0)) {
|
||||
name = string.Join(", ", result.Items.Values);
|
||||
}
|
||||
|
||||
await BotDatabase.RemoveGameToRedeemInBackground(key).ConfigureAwait(false);
|
||||
|
||||
string logEntry = name + DefaultBackgroundKeysRedeemerSeparator + "[" + result.PurchaseResultDetail + "]" + ((result.Items != null) && (result.Items.Count > 0) ? DefaultBackgroundKeysRedeemerSeparator + string.Join(", ", result.Items) : "") + DefaultBackgroundKeysRedeemerSeparator + key;
|
||||
|
||||
Reference in New Issue
Block a user