Files
Libation/Source/LibationUiBase/ProcessQueue/BadBookSessionContext.cs
T
Allamagoosa 325af3a491 Address the remaining review points on concurrent processing
Faulted book tasks were dropped unobserved. The reaping pass removes any
completed task from the active set before the closing WhenAll can
rethrow, so an exception out of ProcessOneAsync - which can happen via
GetFailureActionAsync in its finally - went nowhere. In the sequential
loop it reached the outer catch and was logged. It is logged again.

The bad-book dialog did not survive concurrency. The license and
Widevine messages are guarded to appear once per run, but the "skip this
book?" dialog is per book and its "apply to all remaining books" answer
lands in a shared BadBookSessionContext. Three books failing together
put three modals on screen racing to set the same override. The dialog
is now serialised on the session, and each book re-checks the override
after its turn comes: if the book ahead answered "apply to all", the
question is not asked again.

Machine capability no longer overwrites the stored concurrency setting.
MaxAllowedConcurrentDownloads clamped both the getter and the setter, so
a user who chose 8 and then opened the same config on a two-core machine
read back 2 - and had 2 written over their 8. The stored value is now
bounded only by the hard limit, which is machine-independent; processor
count bounds the spinner and is applied at the point of use, where the
loop decides how many books to run.
2026-08-16 14:14:51 -07:00

19 lines
578 B
C#

using System.Threading;
using LibationFileManager;
namespace LibationUiBase.ProcessQueue;
public class BadBookSessionContext
{
public Configuration.BadBookAction? Override { get; set; }
/// <summary>
/// Serialises the "skip this book?" dialog. Several books can now fail at the same time, and the
/// answer to one of them may be "apply to all remaining books" - which has to be recorded before
/// the next book decides whether it still needs to ask.
/// </summary>
internal SemaphoreSlim DialogGate { get; } = new(1, 1);
public void Reset() => Override = null;
}