Improved logging. Updated nuget packages
This commit is contained in:
parent
7a4bd639fb
commit
1cecd4ba2e
17 changed files with 100 additions and 59 deletions
|
|
@ -28,7 +28,7 @@ namespace InternalUtilities
|
|||
|
||||
private async Task<List<Item>> getItemsAsync(ILoginCallback callback)
|
||||
{
|
||||
var api = await getApiAsync(callback);
|
||||
var api = await EzApiCreator.GetApiAsync(AudibleApiStorage.IdentityTokensFile, callback, Configuration.Instance.LocaleCountryCode);
|
||||
var items = await AudibleApiExtensions.GetAllLibraryItemsAsync(api);
|
||||
|
||||
// remove episode parents
|
||||
|
|
@ -62,20 +62,6 @@ namespace InternalUtilities
|
|||
return items;
|
||||
}
|
||||
|
||||
private async Task<Api> getApiAsync(ILoginCallback callback)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await EzApiCreator.GetApiAsync(AudibleApiStorage.IdentityTokensFile, callback, Configuration.Instance.LocaleCountryCode);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Serilog.Log.Logger.Error(ex, "Error getting Audible API");
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static List<IValidator> getValidators()
|
||||
{
|
||||
var type = typeof(IValidator);
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ namespace InternalUtilities
|
|||
ResponseGroups = LibraryOptions.ResponseGroupOptions.ALL_OPTIONS
|
||||
});
|
||||
|
||||
string pageStr = null;
|
||||
var pageStr = page.ToString();
|
||||
|
||||
LibraryDtoV10 libResult;
|
||||
try
|
||||
{
|
||||
pageStr = page.ToString();
|
||||
// important! use this convert method
|
||||
libResult = LibraryDtoV10.FromJson(pageStr);
|
||||
}
|
||||
|
|
@ -43,6 +43,8 @@ namespace InternalUtilities
|
|||
|
||||
if (!libResult.Items.Any())
|
||||
break;
|
||||
else
|
||||
Serilog.Log.Logger.Debug($"Page {i}: {libResult.Items.Length} results");
|
||||
|
||||
allItems.AddRange(libResult.Items);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue