bug fix: db persistence shouldn't be a side effect. the client should say when to persist in some fairly explicit way
This commit is contained in:
parent
c6ce814e1c
commit
e368e4669b
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Version>7.3.0.1</Version>
|
<Version>7.4.0.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -76,6 +76,7 @@ namespace FileLiberator
|
|||||||
return new StatusHandler { "Cannot find final audio file after decryption" };
|
return new StatusHandler { "Cannot find final audio file after decryption" };
|
||||||
|
|
||||||
libraryBook.Book.UserDefinedItem.BookStatus = LiberatedStatus.Liberated;
|
libraryBook.Book.UserDefinedItem.BookStatus = LiberatedStatus.Liberated;
|
||||||
|
ApplicationServices.LibraryCommands.UpdateUserDefinedItem(libraryBook.Book);
|
||||||
|
|
||||||
return new StatusHandler();
|
return new StatusHandler();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ namespace FileLiberator
|
|||||||
var result = verifyDownload(actualDownloadedFilePath);
|
var result = verifyDownload(actualDownloadedFilePath);
|
||||||
|
|
||||||
libraryBook.Book.UserDefinedItem.PdfStatus = result.IsSuccess ? LiberatedStatus.Liberated : LiberatedStatus.NotLiberated;
|
libraryBook.Book.UserDefinedItem.PdfStatus = result.IsSuccess ? LiberatedStatus.Liberated : LiberatedStatus.NotLiberated;
|
||||||
|
ApplicationServices.LibraryCommands.UpdateUserDefinedItem(libraryBook.Book);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\AaxDecrypter\AaxDecrypter.csproj" />
|
<ProjectReference Include="..\AaxDecrypter\AaxDecrypter.csproj" />
|
||||||
|
<ProjectReference Include="..\ApplicationServices\ApplicationServices.csproj" />
|
||||||
<ProjectReference Include="..\DataLayer\DataLayer.csproj" />
|
<ProjectReference Include="..\DataLayer\DataLayer.csproj" />
|
||||||
<ProjectReference Include="..\AudibleUtilities\AudibleUtilities.csproj" />
|
<ProjectReference Include="..\AudibleUtilities\AudibleUtilities.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -257,6 +257,8 @@ $@" Title: {libraryBook.Book.Title}
|
|||||||
if (dialogResult == SkipResult)
|
if (dialogResult == SkipResult)
|
||||||
{
|
{
|
||||||
libraryBook.Book.UserDefinedItem.BookStatus = LiberatedStatus.Error;
|
libraryBook.Book.UserDefinedItem.BookStatus = LiberatedStatus.Error;
|
||||||
|
ApplicationServices.LibraryCommands.UpdateUserDefinedItem(libraryBook.Book);
|
||||||
|
|
||||||
LogMe.Info($"Error. Skip: [{libraryBook.Book.AudibleProductId}] {libraryBook.Book.Title}");
|
LogMe.Info($"Error. Skip: [{libraryBook.Book.AudibleProductId}] {libraryBook.Book.Title}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,18 +86,18 @@ namespace LibationWinForms
|
|||||||
|
|
||||||
public async Task DownloadBook()
|
public async Task DownloadBook()
|
||||||
{
|
{
|
||||||
if (!DownloadInProgress)
|
if (DownloadInProgress)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
try
|
DownloadInProgress = true;
|
||||||
{
|
await BookLiberation.ProcessorAutomationController.BackupSingleBookAsync(LibraryBook);
|
||||||
DownloadInProgress = true;
|
UpdateLiberatedStatus();
|
||||||
await BookLiberation.ProcessorAutomationController.BackupSingleBookAsync(LibraryBook);
|
}
|
||||||
UpdateLiberatedStatus();
|
finally
|
||||||
}
|
{
|
||||||
finally
|
DownloadInProgress = false;
|
||||||
{
|
|
||||||
DownloadInProgress = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,16 +195,14 @@ namespace LibationWinForms
|
|||||||
Liberate.PdfStatus == pdfStatus)
|
Liberate.PdfStatus == pdfStatus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// set
|
// update cache
|
||||||
Book.UserDefinedItem.Tags = newTags;
|
|
||||||
|
|
||||||
_bookStatus = bookStatus;
|
_bookStatus = bookStatus;
|
||||||
_pdfStatus = pdfStatus;
|
_pdfStatus = pdfStatus;
|
||||||
|
|
||||||
|
// set + save
|
||||||
|
Book.UserDefinedItem.Tags = newTags;
|
||||||
Book.UserDefinedItem.BookStatus = bookStatus;
|
Book.UserDefinedItem.BookStatus = bookStatus;
|
||||||
Book.UserDefinedItem.PdfStatus = pdfStatus;
|
Book.UserDefinedItem.PdfStatus = pdfStatus;
|
||||||
|
|
||||||
// save
|
|
||||||
LibraryCommands.UpdateUserDefinedItem(Book);
|
LibraryCommands.UpdateUserDefinedItem(Book);
|
||||||
|
|
||||||
// notify
|
// notify
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user