mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-01-02 10:58:43 -05:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f241806fa | ||
|
|
e417f60a36 | ||
|
|
b00f2bd908 | ||
|
|
220cda42e7 | ||
|
|
f992a7ec64 | ||
|
|
c54c45df33 | ||
|
|
a8b9e187e6 | ||
|
|
53f252e56f | ||
|
|
2827bc8904 | ||
|
|
98a775fc5a | ||
|
|
f28a729d36 | ||
|
|
00a6a4bf50 | ||
|
|
fdefa7c3bf | ||
|
|
244862299f | ||
|
|
4decf9d3b7 |
@@ -86,8 +86,16 @@ namespace DtoImporterService
|
||||
.ToList();
|
||||
|
||||
// categories are laid out for a breadcrumb. category is 1st, subcategory is 2nd
|
||||
// absence of categories is very rare, but possible
|
||||
var lastCategory = item.Categories.LastOrDefault()?.CategoryId ?? "";
|
||||
// absence of categories is also possible
|
||||
|
||||
// CATEGORY HACK: only use the 1st 2 categories
|
||||
// (real impl: var lastCategory = item.Categories.LastOrDefault()?.CategoryId ?? "";)
|
||||
var lastCategory
|
||||
= item.Categories.Length == 0 ? ""
|
||||
: item.Categories.Length == 1 ? item.Categories[0].CategoryId
|
||||
// 2+
|
||||
: item.Categories[1].CategoryId;
|
||||
|
||||
var category = DbContext.Categories.Local.SingleOrDefault(c => c.AudibleCategoryId == lastCategory);
|
||||
|
||||
var book = DbContext.Books.Add(new Book(
|
||||
|
||||
@@ -51,6 +51,10 @@ namespace DtoImporterService
|
||||
{
|
||||
for (var i = 0; i < pair.Length; i++)
|
||||
{
|
||||
// CATEGORY HACK: not yet supported: depth beyond 0 and 1
|
||||
if (i > 1)
|
||||
break;
|
||||
|
||||
var id = pair[i].CategoryId;
|
||||
var name = pair[i].CategoryName;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace FileLiberator
|
||||
|
||||
private async Task<string> downloadBookAsync(LibraryBook libraryBook, string tempAaxFilename)
|
||||
{
|
||||
var api = await AudibleApi.EzApiCreator.GetApiAsync(AudibleApiStorage.IdentityTokensFile);
|
||||
var api = await AudibleApi.EzApiCreator.GetApiAsync(AudibleApiStorage.IdentityTokensFile, null, Configuration.Instance.LocaleCountryCode);
|
||||
|
||||
var actualFilePath = await PerformDownloadAsync(
|
||||
tempAaxFilename,
|
||||
|
||||
@@ -51,9 +51,6 @@ namespace InternalUtilities
|
||||
if (distinct.Any(s => s.CategoryName is null))
|
||||
exceptions.Add(new ArgumentException($"Collection contains {nameof(Item.Categories)} with null {nameof(Ladder.CategoryName)}", nameof(items)));
|
||||
|
||||
if (items.GetCategoryPairsDistinct().Any(p => p.Length > 2))
|
||||
exceptions.Add(new ArgumentException($"Collection contains {nameof(Item.Categories)} with wrong number of categories. Expecting 0, 1, or 2 categories per title", nameof(items)));
|
||||
|
||||
return exceptions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
|
||||
<Version>3.1.7.5</Version>
|
||||
<Version>3.1.12.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -77,8 +77,23 @@ namespace LibationWinForms.Dialogs
|
||||
|
||||
private void saveBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
config.DecryptKey = this.decryptKeyTb.Text;
|
||||
config.LocaleCountryCode = this.audibleLocaleCb.Text;
|
||||
var origLocale = config.LocaleCountryCode;
|
||||
var newLocale = this.audibleLocaleCb.Text;
|
||||
|
||||
if (origLocale == newLocale)
|
||||
{
|
||||
config.DecryptKey = this.decryptKeyTb.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
// when changing locale:
|
||||
// - delete decrypt key
|
||||
// - clear/delete identity tokens file
|
||||
config.LocaleCountryCode = newLocale;
|
||||
config.DecryptKey = "";
|
||||
File.Delete(AudibleApiStorage.IdentityTokensFile);
|
||||
}
|
||||
|
||||
config.DownloadsInProgressEnum = downloadsInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
|
||||
config.DecryptInProgressEnum = decryptInProgressLibationFilesRb.Checked ? "LibationFiles" : "WinTemp";
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Libation: Liberate your Library
|
||||
|
||||
## [Download Libation](https://github.com/rmcrackan/Libation/releases)
|
||||
|
||||
# Table of Contents
|
||||
|
||||
1. [Audible audiobook manager](#audible-audiobook-manager)
|
||||
@@ -30,7 +32,7 @@
|
||||
* Powerful advanced search built on the Lucene search engine
|
||||
* Customizable saved filters for common searches
|
||||
* Open source
|
||||
* Tested on US Audible only. Should theoretically also work for Canada, UK, Germany, and France
|
||||
* Tested on US Audible only. Should theoretically also work for Canada, UK, Germany, France, and Australia
|
||||
|
||||
<a name="theBad"/>
|
||||
|
||||
@@ -53,6 +55,8 @@ I made this for myself and I want to share it with the great programming and aud
|
||||
|
||||
## Getting started
|
||||
|
||||
#### [Download Libation](https://github.com/rmcrackan/Libation/releases)
|
||||
|
||||
### Import your library
|
||||
|
||||
Select Import > Scan Library:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- begin VERSIONING ---------------------------------------------------------------------------------------------------------------------
|
||||
https://github.com/rmcrackan/Libation/releases
|
||||
|
||||
v3.1.8 : Experimental: add Australia to locale options
|
||||
v3.1.7 : Improved logging
|
||||
v3.1.6 : Bugfix: some series indexes/sequences formats cause library not to import
|
||||
v3.1.5 : Bugfix: some series indexes/sequences could cause library not to import
|
||||
|
||||
Reference in New Issue
Block a user