Only remove a LibraryBook from queue if we are trying to re-download.

This commit is contained in:
MBucari 2025-07-14 12:38:29 -06:00
parent 944645379e
commit 9f8075041b
2 changed files with 20 additions and 12 deletions

View File

@ -41,21 +41,25 @@ namespace LibationAvalonia.ViewModels
{
var item = libraryBooks[0];
void initiateSingleDownload()
{
//Remove this item from the queue if it's already present and completed.
//Only do this when adding a single book at a time to prevent accidental
//extra downloads when queueing in batches.
ProcessQueue.RemoveCompleted(item);
setQueueCollapseState(false);
}
if (item.Book.UserDefinedItem.BookStatus is LiberatedStatus.NotLiberated or LiberatedStatus.PartialDownload)
{
initiateSingleDownload();
Serilog.Log.Logger.Information("Begin single book backup of {libraryBook}", item);
setQueueCollapseState(false);
ProcessQueue.AddDownloadDecrypt(item);
}
else if (item.Book.UserDefinedItem.PdfStatus is LiberatedStatus.NotLiberated)
{
initiateSingleDownload();
Serilog.Log.Logger.Information("Begin single pdf backup of {libraryBook}", item);
setQueueCollapseState(false);
ProcessQueue.AddDownloadPdf(item);
}
else if (item.Book.Audio_Exists())

View File

@ -31,21 +31,25 @@ namespace LibationWinForms
{
var item = libraryBooks[0];
void initiateSingleDownload()
{
//Remove this item from the queue if it's already present and completed.
//Only do this when adding a single book at a time to prevent accidental
//extra downloads when queueing in batches.
processBookQueue1.RemoveCompleted(item);
SetQueueCollapseState(false);
}
if (item.Book.UserDefinedItem.BookStatus is LiberatedStatus.NotLiberated or LiberatedStatus.PartialDownload)
{
initiateSingleDownload();
Serilog.Log.Logger.Information("Begin single book backup of {libraryBook}", item);
SetQueueCollapseState(false);
processBookQueue1.AddDownloadDecrypt(item);
}
else if (item.Book.UserDefinedItem.PdfStatus is LiberatedStatus.NotLiberated)
{
initiateSingleDownload();
Serilog.Log.Logger.Information("Begin single pdf backup of {libraryBook}", item);
SetQueueCollapseState(false);
processBookQueue1.AddDownloadPdf(item);
}
else if (item.Book.Audio_Exists())