Add IsLiberated option to search engine. Reindex search after download and decrypt
This commit is contained in:
parent
c0e955d5ef
commit
7b966f6962
@ -13,7 +13,7 @@
|
|||||||
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
|
||||||
<Version>4.1.9.1</Version>
|
<Version>4.2.0.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -119,6 +119,10 @@ namespace LibationSearchEngine
|
|||||||
|
|
||||||
[nameof(Book.IsAbridged)] = lb => lb.Book.IsAbridged,
|
[nameof(Book.IsAbridged)] = lb => lb.Book.IsAbridged,
|
||||||
["Abridged"] = lb => lb.Book.IsAbridged,
|
["Abridged"] = lb => lb.Book.IsAbridged,
|
||||||
|
|
||||||
|
// this will only be evaluated at time of re-index. ie: state of files moved later will be out of sync until next re-index
|
||||||
|
["IsLiberated"] = lb => AudibleFileStorage.Audio.Exists(lb.Book.AudibleProductId),
|
||||||
|
["Liberated"] = lb => AudibleFileStorage.Audio.Exists(lb.Book.AudibleProductId),
|
||||||
});
|
});
|
||||||
|
|
||||||
private static bool isAuthorNarrated(LibraryBook lb)
|
private static bool isAuthorNarrated(LibraryBook lb)
|
||||||
|
|||||||
@ -81,9 +81,17 @@ namespace LibationWinForms.BookLiberation
|
|||||||
backupBook.DownloadPdf.Completed += completedAction;
|
backupBook.DownloadPdf.Completed += completedAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// enables search engine to index for things like "IsLiberated"
|
||||||
|
backupBook.DownloadBook.Completed += reindex;
|
||||||
|
backupBook.DecryptBook.Completed += reindex;
|
||||||
|
backupBook.DownloadPdf.Completed += reindex;
|
||||||
|
|
||||||
return backupBook;
|
return backupBook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static async void reindex(object sender, LibraryBook e)
|
||||||
|
=> await Task.Run(() => ApplicationServices.SearchEngineCommands.FullReIndex());
|
||||||
|
|
||||||
private static (AutomatedBackupsForm, LogMe) attachToBackupsForm(BackupBook backupBook)
|
private static (AutomatedBackupsForm, LogMe) attachToBackupsForm(BackupBook backupBook)
|
||||||
{
|
{
|
||||||
#region create form and logger
|
#region create form and logger
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user