From 258775ff3fec9b4130a05bebd035440c4641a8a4 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Fri, 21 Aug 2020 11:18:10 -0400 Subject: [PATCH] Purge static current locale from API: complete --- InternalUtilities/UNTESTED/AudibleApiActions.cs | 16 ++++------------ LibationLauncher/LibationLauncher.csproj | 2 +- LibationLauncher/UNTESTED/Program.cs | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/InternalUtilities/UNTESTED/AudibleApiActions.cs b/InternalUtilities/UNTESTED/AudibleApiActions.cs index e781b231..9d5fc1c0 100644 --- a/InternalUtilities/UNTESTED/AudibleApiActions.cs +++ b/InternalUtilities/UNTESTED/AudibleApiActions.cs @@ -13,20 +13,12 @@ namespace InternalUtilities public static class AudibleApiActions { /// USE THIS from within Libation. It wraps the call with correct JSONPath - public static async Task GetApiAsync(Locale locale, ILoginCallback loginCallback = null) - { - Localization.SetLocale(Configuration.Instance.LocaleCountryCode); - - return await EzApiCreator.GetApiAsync(locale, AudibleApiStorage.AccountsSettingsFile, AudibleApiStorage.TEST_GetFirstIdentityTokensJsonPath(), loginCallback); - } + public static Task GetApiAsync(Locale locale, ILoginCallback loginCallback = null) + => EzApiCreator.GetApiAsync(locale, AudibleApiStorage.AccountsSettingsFile, AudibleApiStorage.TEST_GetFirstIdentityTokensJsonPath(), loginCallback); /// USE THIS from within Libation. It wraps the call with correct JSONPath - public static async Task GetApiAsync(Account account, ILoginCallback loginCallback = null) - { - Localization.SetLocale(Configuration.Instance.LocaleCountryCode); - - return await EzApiCreator.GetApiAsync(account.Locale, AudibleApiStorage.AccountsSettingsFile, account.GetIdentityTokensJsonPath(), loginCallback); - } + public static Task GetApiAsync(Account account, ILoginCallback loginCallback = null) + => EzApiCreator.GetApiAsync(account.Locale, AudibleApiStorage.AccountsSettingsFile, account.GetIdentityTokensJsonPath(), loginCallback); private static AsyncRetryPolicy policy { get; } = Policy.Handle() diff --git a/LibationLauncher/LibationLauncher.csproj b/LibationLauncher/LibationLauncher.csproj index b814ea93..901e37cb 100644 --- a/LibationLauncher/LibationLauncher.csproj +++ b/LibationLauncher/LibationLauncher.csproj @@ -13,7 +13,7 @@ win-x64 - 3.1.12.160 + 3.1.12.186 diff --git a/LibationLauncher/UNTESTED/Program.cs b/LibationLauncher/UNTESTED/Program.cs index bb08e5ba..a373810d 100644 --- a/LibationLauncher/UNTESTED/Program.cs +++ b/LibationLauncher/UNTESTED/Program.cs @@ -145,7 +145,6 @@ namespace LibationLauncher var localeName = jLocale.Value(); var locale = Localization.Get(localeName); - Localization.SetLocale(Configuration.Instance.LocaleCountryCode); var api = EzApiCreator.GetApiAsync(locale, AccountsSettingsFileLegacy30).GetAwaiter().GetResult(); var email = api.GetEmailAsync().GetAwaiter().GetResult();