E4: la ricerca dei video fermi riprova chi era troppo lento e non trattiene la chiusura

«Avviala dalla selezione» mandava a una selezione che saltava il video; un file in due account si cercava solo nel
primo; un avvio di video già in coda sembrava una ricerca nuova; una lettura ferma bloccava la chiusura di Febe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 18:57:57 +01:00
1 parent 9277e0a18c
commit 6dcaf30db6
10 files changed
+293 -30

No files matched your search

+12 -2
View File
@@ -42,6 +42,9 @@ namespace Febe.App;
/// </summary>
public sealed class FebeApp : IAsyncDisposable
{
/// <summary>How long a stop waits for «Cerca i video fermi» to give up the video it analyses.</summary>
private static readonly TimeSpan StillVideosWait = TimeSpan.FromSeconds(5);
private readonly FebeAppOptions _options;
private readonly IFebePlatform _platform;
private readonly CancellationTokenSource _lifetime = new();
@@ -362,6 +365,11 @@ public sealed class FebeApp : IAsyncDisposable
s.AddSingleton(new LibraryConversionQueue(Database, Clock));
s.AddSingleton(exportRoot);
s.AddSingleton<IExportDisk>(hooks.ExportDisk ?? new SystemExportDisk(exportRoot.Mounts));
if (hooks.StillVideoAnalyser is { } analyser)
{
s.AddSingleton(analyser);
}
s.AddSingleton<IEngineSessionState>(sessionState);
s.AddSingleton<IFebeStorage>(Database);
s.AddSingleton(library);
@@ -945,12 +953,14 @@ public sealed class FebeApp : IAsyncDisposable
await Quietly(() => web.StopAsync()).ConfigureAwait(false);
// «Cerca i video fermi» (tappa E4): the job gives up the video it analyses (nothing stored for it) and ends
// before the database closes; it does not resume at the next start (answer 41).
// before the database closes; it does not resume at the next start (answer 41). Not waited for without an end:
// a read stuck on a library that does not answer (a network folder) must not keep the engine and the browser
// from closing in time, and its result would not be stored anyway.
await Quietly(async () =>
{
var stills = web.Services.GetRequiredService<StillVideoService>();
stills.Dispose();
await stills.Job.ConfigureAwait(false);
await stills.Job.WaitAsync(StillVideosWait).ConfigureAwait(false);
}).ConfigureAwait(false);
}