Libation 4.0 prep: incrementally incorporate jsonpath (1) all AccountsSettings.json access must use centralized jsonpath. For now == null
This commit is contained in:
parent
efa5cefa23
commit
f50dab94a4
@ -1,10 +1,26 @@
|
|||||||
using System.IO;
|
using Newtonsoft.Json;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace FileManager
|
namespace FileManager
|
||||||
{
|
{
|
||||||
public static class AudibleApiStorage
|
public static class AudibleApiStorage
|
||||||
{
|
{
|
||||||
// not customizable. don't move to config
|
|
||||||
public static string AccountsSettingsFile => Path.Combine(Configuration.Instance.LibationFiles, "AccountsSettings.json");
|
public static string AccountsSettingsFile => Path.Combine(Configuration.Instance.LibationFiles, "AccountsSettings.json");
|
||||||
|
|
||||||
|
public static string GetJsonPath(
|
||||||
|
//string username
|
||||||
|
////, string locale
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
|
||||||
|
|
||||||
|
//var usernameSanitized = JsonConvert.ToString(username);
|
||||||
|
|
||||||
|
////var localeSanitized = JsonConvert.ToString(locale);
|
||||||
|
////return $"$.ApiConnectionSettings[?(@.Username == '{usernameSanitized}' && @.IdentityTokens.Locale == '{localeSanitized}')].IdentityTokens";
|
||||||
|
|
||||||
|
//return $"$.ApiConnectionSettings[?(@.Username == '{usernameSanitized}')].IdentityTokens";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,13 +15,9 @@ namespace InternalUtilities
|
|||||||
/// <summary>USE THIS from within Libation. It wraps the call with correct JSONPath</summary>
|
/// <summary>USE THIS from within Libation. It wraps the call with correct JSONPath</summary>
|
||||||
public static async Task<Api> GetApiAsync(ILoginCallback loginCallback = null)
|
public static async Task<Api> GetApiAsync(ILoginCallback loginCallback = null)
|
||||||
{
|
{
|
||||||
var identityFilePath = AudibleApiStorage.AccountsSettingsFile;
|
|
||||||
|
|
||||||
// TODO: get jsonpath from ... somewhere
|
|
||||||
string jsonPath = null;
|
|
||||||
Localization.SetLocale(Configuration.Instance.LocaleCountryCode);
|
Localization.SetLocale(Configuration.Instance.LocaleCountryCode);
|
||||||
|
|
||||||
return await EzApiCreator.GetApiAsync(identityFilePath, loginCallback, jsonPath);
|
return await EzApiCreator.GetApiAsync(AudibleApiStorage.AccountsSettingsFile, AudibleApiStorage.GetJsonPath(), loginCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AsyncRetryPolicy policy { get; }
|
private static AsyncRetryPolicy policy { get; }
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
|
||||||
<Version>3.1.12.54</Version>
|
<Version>3.1.12.62</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user