fix(settings): restore before the index opens; archive rows edit only their archive; parallelism follows the brief

Index restore (ENG-06, UI-09):
- A staged restore now runs on the files before the index is opened, so it also
  recovers an index that no longer opens; Settings > Advanced > Restore works
  without an open index (the current one is shown as unreadable).
- The staged copy passes PRAGMA quick_check (before migration, in a scratch copy)
  ahead of any backup: a damaged copy is set aside as .failed and never renews the
  daily copies. The index it replaces is kept as a VACUUM INTO copy, or, when it
  cannot be read, copied whole with its WAL as titano-replaced-<stamp>.db outside the
  rotation. The staged file is renamed over the index, so it is never applied twice.
- Archive > Maintenance gains Restore database..., which opens Settings > Advanced.

Archive settings (UI-03, ENG-03):
- An archive.json with an empty or overlong name (drive roots) can be edited again:
  the name read is made usable as at creation.
- Proxy and thumbnail sizes outside the presets (an admin's 3840) are listed and
  shown with their number.
- Changing the archive folder retargets the rows: an archive there is registered
  and rescanned; with none, the rows edit only the defaults of new archives. The
  rows never fall back to another archive of the index.
- Reset all and Import settings no longer rewrite the shared archive.json; Archive >
  Reset section asks first, naming the archive.
- PUT /api/v1/archive/settings: 409 archive_busy on a lease conflict, 409
  archive_manifest for a damaged, newer or foreign archive.json (was 500).

Parallelism (UI-02):
- Auto is the job engine's default, half the logical cores (BRIEF 14.6), with each
  job's own decode and analysis threads; a value the user sets is the number of
  workers and caps those threads. The memory budget is shared: each job's frame
  window gets budget / workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 11:06:27 +00:00
1 parent 3e146c9f9f
commit 56aa4da674
63 files changed
+484 -179

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S
|---|---|
| `Sqlite`, `Postgres` | SQLite P/Invoke binding (winsqlite3 / libsqlite3), in-house PostgreSQL wire protocol v3 client with pool and LISTEN |
| `Migrations/{sqlite,postgres}/NNNN_name.sql` | Embedded, applied in one transaction at open (`MigrationRunner`) |
| `Repositories` | `TitanoDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit; `DatabaseBackups` (daily `VACUUM INTO` copies of an SQLite index kept ×3, restore staged for the next open) |
| `Repositories` | `TitanoDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit; `DatabaseBackups` (daily `VACUUM INTO` copies of an SQLite index kept ×3, restore staged for the next start and carried out before the index opens, so it also recovers one that no longer opens) |
| `Jobs` | `JobEngine` (its number of workers can change while it runs), `IJobHandler`, `IJobHandlerProvider`, `JobContext` (progress, checkpoints, follow-up jobs) |
| `Archiving` | `ArchiveService` (create/adopt/open, archive settings written to `archive.json` then the index), `ArchiveIndexer` (scan, rebuild), `ArchiveIngest` (uploads and imports), `ImportService`, `ArchiveVerifier`, `ArchiveImages`, `ArchiveMaintenance`, `MassRenamer`, `SequenceTrash` (delete into the archive's hidden trash with a dry run, restore; the folder moves back when the index step fails), job handlers |
| `Processing` | `ProcessingService`, `SequenceAnalyser`, `SequenceRender`, `ProjectStore`, `RenderNodeClient`, job handlers |
-2
View File
@@ -566,8 +566,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>الخادم الافتراضي، وعقدة التصيير، والشهادات الموثوقة</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>مجلد التخزين المؤقت، والصور المصغرة في الذاكرة، وحد التخزين المؤقت</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>التحقق من التحديثات عند البدء</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>تلقائي: عدد الأنوية ناقص أربعة لتبقى الواجهة سريعة الاستجابة</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>العودة إلى «تلقائي»: عدد الأنوية ناقص أربعة</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>مفعّل عند وجود portable.txt بجانب Titano.exe: تبقى كل البيانات في مجلد البيانات الخاص به</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>استخدام مرمّز عتادي عندما يدعم الإعداد المسبق، وإلا فالمرمّز البرمجي</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>أول ثلاثة أسماء لاستيراد تجريبي بهذه القوالب</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Сървър по подразбиране, възел за рендериране, доверени сертификати</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Папка на кеша, миниатюри в паметта, лимит на кеша</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Проверка за актуализации при стартиране</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Авто: броят ядра минус четири, за да остане интерфейсът отзивчив</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Връщане към „Авто“: броят ядра минус четири</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Включен, когато portable.txt е до Titano.exe: всички данни остават в неговата папка с данни</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Използва хардуерен кодер, когато някой поддържа пресета; иначе софтуерен</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Първите три имена от примерно импортиране с тези шаблони</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Výchozí server, renderovací uzel, důvěryhodné certifikáty</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Složka mezipaměti, miniatury v paměti, limit mezipaměti</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Kontrola aktualizací při spuštění</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: počet jader minus čtyři, aby rozhraní zůstalo svižné</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Zpět na Auto: počet jader minus čtyři</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Zapnuto, když vedle souboru Titano.exe leží portable.txt: všechna data zůstávají v jeho datové složce</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Použije hardwarový kodér, pokud předvolbu podporuje; jinak softwarový</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>První tři názvy ukázkového importu s těmito šablonami</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Standardserver, renderingsnode, betroede certifikater</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cachemappe, miniaturer i hukommelsen, cachegrænse</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Søg efter opdateringer ved start</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: antal kerner minus fire, så brugerfladen forbliver responsiv</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Tilbage til Auto: antal kerner minus fire</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Til, når portable.txt ligger ved siden af Titano.exe: alle data bliver i programmets datamappe</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Brug en hardwareencoder, når en understøtter forudindstillingen; ellers software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>De tre første navne fra en prøveimport med disse skabeloner</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Standardserver, Render-Knoten, vertrauenswürdige Zertifikate</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cache-Ordner, Miniaturansichten im Arbeitsspeicher, Cache-Limit</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Updateprüfung beim Start</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: Kerne minus vier, damit die Oberfläche reaktionsfähig bleibt</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Zurück zu Auto: Kerne minus vier</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Aktiv, wenn portable.txt neben Titano.exe liegt: Alle Daten bleiben im Datenordner daneben</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Einen Hardware-Encoder verwenden, wenn einer die Vorgabe unterstützt, sonst Software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Die ersten drei Namen eines Beispielimports mit diesen Vorlagen</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Προεπιλεγμένος διακομιστής, κόμβος απόδοσης, αξιόπιστα πιστοποιητικά</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Φάκελος κρυφής μνήμης, μικρογραφίες στη μνήμη, όριο κρυφής μνήμης</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Έλεγχος για ενημερώσεις κατά την εκκίνηση</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Αυτόματο: πυρήνες μείον τέσσερις, ώστε το περιβάλλον εργασίας να ανταποκρίνεται</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Επαναφορά σε Αυτόματο: πυρήνες μείον τέσσερις</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Ενεργή όταν το portable.txt βρίσκεται δίπλα στο Titano.exe: όλα τα δεδομένα μένουν στον φάκελο δεδομένων του</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Χρήση κωδικοποιητή υλικού όταν κάποιος υποστηρίζει την προρύθμιση, διαφορετικά κωδικοποιητή λογισμικού</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Τα τρία πρώτα ονόματα μιας δοκιμαστικής εισαγωγής με αυτά τα πρότυπα</value></data>
+1
View File
@@ -140,6 +140,7 @@
<data name="Archive.Maintenance.DryRun" xml:space="preserve"><value>Dry run</value></data>
<data name="Archive.Maintenance.Proxies" xml:space="preserve"><value>Rebuild proxies</value></data>
<data name="Archive.Maintenance.Relink" xml:space="preserve"><value>Relink moved archive…</value></data>
<data name="Archive.Maintenance.Restore" xml:space="preserve"><value>Restore database…</value></data>
<data name="Archive.Maintenance.Run" xml:space="preserve"><value>Run maintenance</value></data>
<data name="Archive.Maintenance.Trash" xml:space="preserve"><value>Trash…</value></data>
<data name="Archive.Orphans.Count.one" xml:space="preserve"><value>{0:N0} issue</value></data>
+2
View File
@@ -26,6 +26,8 @@
<data name="Server.Disconnect" xml:space="preserve"><value>Disconnect</value></data>
<data name="Server.Empty" xml:space="preserve"><value>Not connected to a server</value></data>
<data name="Server.Error.AccountLocked" xml:space="preserve"><value>Too many failed sign-ins; the account is locked for a while.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveBusy" xml:space="preserve"><value>Another program is changing the archive's settings; try again shortly.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveManifest" xml:space="preserve"><value>The archive's archive.json is damaged, from a newer Titano or of another archive; check the archive folder.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveOffline" xml:space="preserve"><value>The archive is offline or read-only; try again when it is back.</value><comment>long</comment></data>
<data name="Server.Error.ArchiveRoot" xml:space="preserve"><value>Its photos are the archive's root folder, which never moves to the trash.</value><comment>long</comment></data>
<data name="Server.Error.BadCredentials" xml:space="preserve"><value>Wrong user name or password.</value><comment>long</comment></data>
+4
View File
@@ -35,6 +35,7 @@
<data name="Settings.Advanced.RestorePending" xml:space="preserve"><value>Waiting for restart</value></data>
<data name="Settings.Advanced.RestoreStaged" xml:space="preserve"><value>Restore ready</value></data>
<data name="Settings.Advanced.RestoreTitle" xml:space="preserve"><value>Restore the index of {0}?</value><comment>long</comment></data>
<data name="Settings.Advanced.RestoreUnreadable" xml:space="preserve"><value>Now: unreadable</value></data>
<data name="Settings.Advanced.Restored" xml:space="preserve"><value>Index restored from a backup</value><comment>long</comment></data>
<data name="Settings.Analysis.AfterImport" xml:space="preserve"><value>After import</value></data>
<data name="Settings.Analysis.AfterScan" xml:space="preserve"><value>After a scan</value></data>
@@ -55,6 +56,9 @@
<data name="Settings.Archive.Polling" xml:space="preserve"><value>Rescan every</value></data>
<data name="Settings.Archive.Preview" xml:space="preserve"><value>Preview</value></data>
<data name="Settings.Archive.Proxies" xml:space="preserve"><value>Proxy size</value></data>
<data name="Settings.Archive.ResetAction" xml:space="preserve"><value>Reset archive</value></data>
<data name="Settings.Archive.ResetMessage" xml:space="preserve"><value>Its naming templates, proxy size and thumbnail size return to their defaults for every PC and server that uses it. Folders and files already in the archive keep their names.</value><comment>long</comment></data>
<data name="Settings.Archive.ResetTitle" xml:space="preserve"><value>Reset the settings of {0}?</value><comment>long; {0} archive name</comment></data>
<data name="Settings.Archive.Root" xml:space="preserve"><value>Archive folder</value></data>
<data name="Settings.Archive.Thumbnails" xml:space="preserve"><value>Thumbnail size</value></data>
<data name="Settings.BackToAuto" xml:space="preserve"><value>Back to Auto</value></data>
+5 -2
View File
@@ -74,6 +74,7 @@
<data name="Tooltips.Archive.RebuildStart" xml:space="preserve"><value>Queue the rebuild · the archive stays usable meanwhile</value></data>
<data name="Tooltips.Archive.Relink" xml:space="preserve"><value>Choose the new folder of an archive you moved; its sequences follow</value></data>
<data name="Tooltips.Archive.RenameApply" xml:space="preserve"><value>Make exactly these changes to folders, sidecars and index · resumes after a crash</value></data>
<data name="Tooltips.Archive.Restore" xml:space="preserve"><value>Choose a daily backup of the index in Settings › Advanced; it replaces the index at the next start</value></data>
<data name="Tooltips.Archive.RetagApply" xml:space="preserve"><value>Change the tags of these sequences in sidecars and index</value></data>
<data name="Tooltips.Archive.Retry" xml:space="preserve"><value>Run the same action again</value></data>
<data name="Tooltips.Archive.Scan" xml:space="preserve"><value>Incremental scan: new, changed and removed files by modification time and size</value></data>
@@ -530,6 +531,7 @@
<data name="Tooltips.Settings.Import" xml:space="preserve"><value>Load settings from a JSON file; the session and the window layout stay as they are</value></data>
<data name="Tooltips.Settings.Install" xml:space="preserve"><value>Open the Microsoft Store page of this free or paid extension; Re-detect after installing it</value></data>
<data name="Tooltips.Settings.InterfacePriority" xml:space="preserve"><value>While Titano is in front, its interface runs ahead of the jobs so it stays fluid during renders and analyses</value></data>
<data name="Tooltips.Settings.KeepArchiveSettings" xml:space="preserve"><value>Leave this archive's settings as they are</value></data>
<data name="Tooltips.Settings.KeepCache" xml:space="preserve"><value>Keep the cache as it is</value></data>
<data name="Tooltips.Settings.KeepIndex" xml:space="preserve"><value>Keep the index as it is</value></data>
<data name="Tooltips.Settings.KeepSettings" xml:space="preserve"><value>Keep every setting as it is</value></data>
@@ -551,8 +553,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Default server, render node, trusted certificates</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cache folder, thumbnails in memory, cache limit</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Update check on start</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: cores minus four so the interface stays responsive</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Back to Auto: cores minus four</value></data>
<data name="Tooltips.Settings.Polling" xml:space="preserve"><value>How often Titano rescans the archive for changes made elsewhere, such as by a server sharing it</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>On when portable.txt sits next to Titano.exe: all data stays in its data folder</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Use a hardware encoder when one supports the preset; software otherwise</value></data>
@@ -563,6 +563,7 @@
<data name="Tooltips.Settings.Redetect" xml:space="preserve"><value>List the encoders again after a driver or codec install</value></data>
<data name="Tooltips.Settings.RedetectFormats" xml:space="preserve"><value>Look for codec extensions again after installing one; the next jobs use them</value></data>
<data name="Tooltips.Settings.ResetAll" xml:space="preserve"><value>Return every setting of this PC to its default; asks first</value></data>
<data name="Tooltips.Settings.ResetArchiveConfirm" xml:space="preserve"><value>Write the default templates and sizes into this archive's archive.json now</value></data>
<data name="Tooltips.Settings.ResetConfirm" xml:space="preserve"><value>Reset every setting now</value></data>
<data name="Tooltips.Settings.ResetSection" xml:space="preserve"><value>Return every control of this section to its default</value></data>
<data name="Tooltips.Settings.Restore" xml:space="preserve"><value>Compare the chosen backup with the index, then restore it at the next start; asks first</value></data>
@@ -584,6 +585,8 @@
<data name="Tooltips.Settings.Tier.Unavailable" xml:space="preserve"><value>No decoder on this PC reads its pixels; such frames are left out of renders</value></data>
<data name="Tooltips.Settings.UsageCounts" xml:space="preserve"><value>Send a daily anonymous count of versions and languages in use; nothing else, off by default</value></data>
<data name="Tooltips.Settings.Workers" xml:space="preserve"><value>Jobs and frames processed at once; fewer leave more room to other programs · Enter applies, Esc reverts</value></data>
<data name="Tooltips.Settings.WorkersAuto" xml:space="preserve"><value>Auto: half the logical cores run jobs at once, each with its own number of threads</value></data>
<data name="Tooltips.Settings.WorkersReset" xml:space="preserve"><value>Back to Auto: half the logical cores</value></data>
<data name="Tooltips.Setup.AllUsers" xml:space="preserve"><value>Install in Program Files for every account · asks for administrator approval</value></data>
<data name="Tooltips.Setup.Back" xml:space="preserve"><value>Return to the options without changing anything</value></data>
<data name="Tooltips.Setup.Browse" xml:space="preserve"><value>Choose the installation folder</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Servidor predeterminado, nodo de renderizado, certificados de confianza</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Carpeta de caché, miniaturas en memoria, límite de caché</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Búsqueda de actualizaciones al iniciar</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: núcleos menos cuatro para que la interfaz siga respondiendo</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Volver a Auto: núcleos menos cuatro</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Activado cuando portable.txt está junto a Titano.exe: todos los datos se quedan en su carpeta de datos</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Usa un codificador por hardware cuando alguno admite el preajuste; si no, por software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Primeros tres nombres de una importación de ejemplo con estas plantillas</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Vaikeserver, renderdussõlm, usaldatud sertifikaadid</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Vahemälu kaust, pisipildid mälus, vahemälu piirang</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Värskenduste otsimine käivitamisel</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: tuumade arv miinus neli, et liides jääks reageerivaks</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Tagasi režiimile Auto: tuumade arv miinus neli</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Sees, kui portable.txt asub Titano.exe kõrval: kõik andmed jäävad selle andmekausta</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Kasutab riistvarakodeerijat, kui see toetab eelseadistust; muul juhul tarkvara</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Nende mallidega näidisimpordi kolm esimest nime</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Oletuspalvelin, renderöintisolmu, luotetut varmenteet</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Välimuistikansio, pikkukuvat muistissa, välimuistin raja</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Päivitysten tarkistus käynnistettäessä</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Automaattinen: ytimet miinus neljä, jotta käyttöliittymä pysyy reagoivana</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Palauta automaattinen: ytimet miinus neljä</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Käytössä, kun portable.txt on Titano.exe-tiedoston vieressä: kaikki tiedot pysyvät sen datakansiossa</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Käytä laitteistokooderia, kun jokin tukee esiasetusta; muuten ohjelmistoa</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Näillä malleilla tehdyn esimerkkituonnin kolme ensimmäistä nimeä</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Serveur par défaut, nœud de rendu, certificats approuvés</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Dossier du cache, miniatures en mémoire, limite du cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Recherche de mises à jour au démarrage</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto : nombre de cœurs moins quatre, pour que l'interface reste réactive</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Revenir à Auto : nombre de cœurs moins quatre</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Activé quand portable.txt se trouve à côté de Titano.exe : toutes les données restent dans son dossier de données</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Utiliser un encodeur matériel s'il prend en charge le préréglage, sinon l'encodeur logiciel</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Trois premiers noms d'un exemple d'importation avec ces modèles</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>שרת ברירת מחדל, צומת רינדור, תעודות מהימנות</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>תיקיית מטמון, תמונות ממוזערות בזיכרון, מגבלת מטמון</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>בדיקת עדכונים בעת ההפעלה</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>אוטומטי: מספר הליבות פחות ארבע, כדי שהממשק יישאר מגיב</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>חזרה לאוטומטי: מספר הליבות פחות ארבע</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>פעיל כאשר portable.txt נמצא לצד Titano.exe: כל הנתונים נשמרים בתיקיית הנתונים שלו</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>שימוש במקודד חומרה כאשר יש כזה שתומך בפריסט; אחרת, קידוד בתוכנה</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>שלושת השמות הראשונים בייבוא לדוגמה עם התבניות האלה</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>डिफ़ॉल्ट सर्वर, रेंडर नोड, विश्वसनीय प्रमाणपत्र</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>कैश फ़ोल्डर, मेमोरी में थंबनेल, कैश सीमा</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>शुरू होने पर अपडेट की जाँच</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>ऑटो: कोर की संख्या में से चार कम, ताकि इंटरफ़ेस प्रतिक्रियाशील रहे</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>ऑटो पर लौटें: कोर की संख्या में से चार कम</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>जब portable.txt, Titano.exe के बगल में हो तब चालू: सारा डेटा उसके डेटा फ़ोल्डर में रहता है</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>जब कोई हार्डवेयर एनकोडर प्रीसेट को सपोर्ट करे तो उसका उपयोग करें; अन्यथा सॉफ़्टवेयर</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>इन टेम्पलेट के साथ नमूना आयात के पहले तीन नाम</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Zadani poslužitelj, čvor za renderiranje, pouzdani certifikati</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Mapa predmemorije, minijature u memoriji, ograničenje predmemorije</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Provjera ažuriranja pri pokretanju</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: broj jezgri umanjen za četiri kako bi sučelje ostalo responzivno</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Vraća na Auto: broj jezgri umanjen za četiri</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Uključeno kada se portable.txt nalazi pokraj datoteke Titano.exe: svi podaci ostaju u njezinoj mapi data</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Upotrebljava hardverski koder kada podržava preset; inače softverski</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Prva tri naziva oglednog uvoza s ovim predlošcima</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Alapértelmezett szerver, renderelő csomópont, megbízható tanúsítványok</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Gyorsítótár mappája, miniatűrök a memóriában, gyorsítótár korlátja</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Frissítések keresése indításkor</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: a magok száma mínusz négy, így a felület gyorsan reagál</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Vissza Auto értékre: a magok száma mínusz négy</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Bekapcsolva, ha a portable.txt a Titano.exe mellett van: minden adat a saját data mappájában marad</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Hardveres kódolót használ, ha valamelyik támogatja az előbeállítást; egyébként szoftverest</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Egy mintaimportálás első három neve ezekkel a sablonokkal</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Server default, node render, sertifikat tepercaya</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Folder cache, gambar mini di memori, batas cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Pemeriksaan pembaruan saat mulai</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Otomatis: jumlah inti dikurangi empat agar antarmuka tetap responsif</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Kembali ke Otomatis: jumlah inti dikurangi empat</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Aktif bila portable.txt berada di samping Titano.exe: semua data tetap di folder data miliknya</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Gunakan encoder perangkat keras jika ada yang mendukung preset; jika tidak, gunakan perangkat lunak</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Tiga nama pertama dari contoh impor dengan templat ini</value></data>
+1
View File
@@ -135,6 +135,7 @@
<data name="Archive.Maintenance.DryRun" xml:space="preserve"><value>Simulazione</value></data>
<data name="Archive.Maintenance.Proxies" xml:space="preserve"><value>Ricrea proxy</value></data>
<data name="Archive.Maintenance.Relink" xml:space="preserve"><value>Ricollega archivio spostato…</value></data>
<data name="Archive.Maintenance.Restore" xml:space="preserve"><value>Ripristina database…</value></data>
<data name="Archive.Maintenance.Run" xml:space="preserve"><value>Esegui manutenzione</value></data>
<data name="Archive.Maintenance.Trash" xml:space="preserve"><value>Cestino…</value></data>
<data name="Archive.Orphans.Count.one" xml:space="preserve"><value>{0:N0} problema</value></data>
+2
View File
@@ -24,6 +24,8 @@
<data name="Server.Disconnect" xml:space="preserve"><value>Disconnetti</value></data>
<data name="Server.Empty" xml:space="preserve"><value>Non connesso a un server</value></data>
<data name="Server.Error.AccountLocked" xml:space="preserve"><value>Troppi accessi falliti; l'account è bloccato per un po'.</value></data>
<data name="Server.Error.ArchiveBusy" xml:space="preserve"><value>Un altro programma sta modificando le impostazioni dell'archivio; riprova tra poco.</value></data>
<data name="Server.Error.ArchiveManifest" xml:space="preserve"><value>Il file archive.json dell'archivio è danneggiato, di un Titano più recente o di un altro archivio; controlla la cartella dell'archivio.</value></data>
<data name="Server.Error.ArchiveOffline" xml:space="preserve"><value>L'archivio non è raggiungibile o è di sola lettura; riprova quando torna disponibile.</value></data>
<data name="Server.Error.ArchiveRoot" xml:space="preserve"><value>Le sue foto sono la cartella principale dell'archivio, che non va mai nel cestino.</value></data>
<data name="Server.Error.BadCredentials" xml:space="preserve"><value>Nome utente o password errati.</value></data>
+4
View File
@@ -35,6 +35,7 @@
<data name="Settings.Advanced.RestorePending" xml:space="preserve"><value>In attesa di riavvio</value></data>
<data name="Settings.Advanced.RestoreStaged" xml:space="preserve"><value>Ripristino pronto</value></data>
<data name="Settings.Advanced.RestoreTitle" xml:space="preserve"><value>Ripristinare l'indice del {0}?</value></data>
<data name="Settings.Advanced.RestoreUnreadable" xml:space="preserve"><value>Ora: illeggibile</value></data>
<data name="Settings.Advanced.Restored" xml:space="preserve"><value>Indice ripristinato da una copia</value></data>
<data name="Settings.Analysis.AfterImport" xml:space="preserve"><value>Dopo l'importazione</value></data>
<data name="Settings.Analysis.AfterScan" xml:space="preserve"><value>Dopo una scansione</value></data>
@@ -55,6 +56,9 @@
<data name="Settings.Archive.Polling" xml:space="preserve"><value>Riscansiona ogni</value></data>
<data name="Settings.Archive.Preview" xml:space="preserve"><value>Anteprima</value></data>
<data name="Settings.Archive.Proxies" xml:space="preserve"><value>Dimensione proxy</value></data>
<data name="Settings.Archive.ResetAction" xml:space="preserve"><value>Reimposta archivio</value></data>
<data name="Settings.Archive.ResetMessage" xml:space="preserve"><value>I modelli di nome, la dimensione dei proxy e quella delle miniature tornano ai valori predefiniti per ogni PC e server che lo usa. Le cartelle e i file già nell'archivio mantengono i loro nomi.</value></data>
<data name="Settings.Archive.ResetTitle" xml:space="preserve"><value>Reimpostare le impostazioni di {0}?</value></data>
<data name="Settings.Archive.Root" xml:space="preserve"><value>Cartella archivio</value></data>
<data name="Settings.Archive.Thumbnails" xml:space="preserve"><value>Dimensione miniature</value></data>
<data name="Settings.BackToAuto" xml:space="preserve"><value>Torna ad Auto</value></data>
+5 -2
View File
@@ -74,6 +74,7 @@
<data name="Tooltips.Archive.RebuildStart" xml:space="preserve"><value>Metti in coda la ricostruzione · l'archivio resta utilizzabile</value></data>
<data name="Tooltips.Archive.Relink" xml:space="preserve"><value>Scegli la nuova cartella di un archivio spostato; le sequenze lo seguono</value></data>
<data name="Tooltips.Archive.RenameApply" xml:space="preserve"><value>Applica esattamente queste modifiche a cartelle, sidecar e indice · riprende dopo un arresto</value></data>
<data name="Tooltips.Archive.Restore" xml:space="preserve"><value>Scegli una copia giornaliera dell'indice in Impostazioni › Avanzate; sostituisce l'indice al prossimo avvio</value></data>
<data name="Tooltips.Archive.RetagApply" xml:space="preserve"><value>Cambia i tag di queste sequenze in sidecar e indice</value></data>
<data name="Tooltips.Archive.Retry" xml:space="preserve"><value>Esegui di nuovo la stessa azione</value></data>
<data name="Tooltips.Archive.Scan" xml:space="preserve"><value>Scansione incrementale: file nuovi, modificati e rimossi per data e dimensione</value></data>
@@ -530,6 +531,7 @@
<data name="Tooltips.Settings.Import" xml:space="preserve"><value>Carica le impostazioni da un file JSON; la sessione e la disposizione della finestra restano invariate</value></data>
<data name="Tooltips.Settings.Install" xml:space="preserve"><value>Apri la pagina del Microsoft Store di questa estensione, gratuita o a pagamento; dopo averla installata premi Rileva di nuovo</value></data>
<data name="Tooltips.Settings.InterfacePriority" xml:space="preserve"><value>Mentre Titano è in primo piano, l'interfaccia ha la precedenza sulle attività e resta fluida durante rendering e analisi</value></data>
<data name="Tooltips.Settings.KeepArchiveSettings" xml:space="preserve"><value>Lascia le impostazioni dell'archivio come sono</value></data>
<data name="Tooltips.Settings.KeepCache" xml:space="preserve"><value>Lascia la cache com'è</value></data>
<data name="Tooltips.Settings.KeepIndex" xml:space="preserve"><value>Lascia l'indice com'è</value></data>
<data name="Tooltips.Settings.KeepSettings" xml:space="preserve"><value>Lascia ogni impostazione com'è</value></data>
@@ -551,8 +553,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Server predefinito, nodo di rendering, certificati attendibili</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cartella della cache, miniature in memoria, limite della cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Controllo degli aggiornamenti all'avvio</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: core meno quattro, così l'interfaccia resta reattiva</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Torna ad Auto: core meno quattro</value></data>
<data name="Tooltips.Settings.Polling" xml:space="preserve"><value>Ogni quanto Titano riscansiona l'archivio per le modifiche fatte altrove, per esempio da un server che lo condivide</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Attiva quando portable.txt si trova accanto a Titano.exe: tutti i dati restano nella sua cartella data</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Usa un encoder hardware quando supporta il preset; altrimenti il software</value></data>
@@ -563,6 +563,7 @@
<data name="Tooltips.Settings.Redetect" xml:space="preserve"><value>Elenca di nuovo gli encoder dopo l'installazione di un driver o di un codec</value></data>
<data name="Tooltips.Settings.RedetectFormats" xml:space="preserve"><value>Cerca di nuovo le estensioni codec dopo averne installata una; le prossime attività le usano</value></data>
<data name="Tooltips.Settings.ResetAll" xml:space="preserve"><value>Riporta ogni impostazione di questo PC al valore predefinito; chiede prima</value></data>
<data name="Tooltips.Settings.ResetArchiveConfirm" xml:space="preserve"><value>Scrivi ora i modelli e le dimensioni predefiniti nel file archive.json dell'archivio</value></data>
<data name="Tooltips.Settings.ResetConfirm" xml:space="preserve"><value>Reimposta ora ogni impostazione</value></data>
<data name="Tooltips.Settings.ResetSection" xml:space="preserve"><value>Riporta ogni controllo di questa sezione al valore predefinito</value></data>
<data name="Tooltips.Settings.Restore" xml:space="preserve"><value>Confronta la copia scelta con l'indice, poi la ripristina al prossimo avvio; chiede prima</value></data>
@@ -584,6 +585,8 @@
<data name="Tooltips.Settings.Tier.Unavailable" xml:space="preserve"><value>Nessun decodificatore su questo PC ne legge i pixel; questi fotogrammi restano fuori dai rendering</value></data>
<data name="Tooltips.Settings.UsageCounts" xml:space="preserve"><value>Invia ogni giorno un conteggio anonimo di versioni e lingue in uso; nient'altro, disattivato per impostazione predefinita</value></data>
<data name="Tooltips.Settings.Workers" xml:space="preserve"><value>Attività e fotogrammi elaborati insieme; meno lasciano più spazio agli altri programmi · Invio applica, Esc annulla</value></data>
<data name="Tooltips.Settings.WorkersAuto" xml:space="preserve"><value>Auto: metà dei core logici esegue attività insieme, ognuna con il proprio numero di thread</value></data>
<data name="Tooltips.Settings.WorkersReset" xml:space="preserve"><value>Torna ad Auto: metà dei core logici</value></data>
<data name="Tooltips.Setup.AllUsers" xml:space="preserve"><value>Installa in Programmi per tutti gli account · chiede l'autorizzazione di amministratore</value></data>
<data name="Tooltips.Setup.Back" xml:space="preserve"><value>Torna alle opzioni senza modificare nulla</value></data>
<data name="Tooltips.Setup.Browse" xml:space="preserve"><value>Scegli la cartella di installazione</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>既定のサーバー、レンダリングノード、信頼済みの証明書</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>キャッシュフォルダー、メモリ内のサムネイル、キャッシュの上限</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>起動時のアップデート確認</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>自動: インターフェイスの応答性を保つため、コア数から 4 を引いた値</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>自動に戻す: コア数から 4 を引いた値</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Titano.exe と同じ場所に portable.txt があるとオンになります。すべてのデータはそのデータフォルダーに保存されます。</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>プリセットに対応するハードウェアエンコーダーがあればそれを使用し、なければソフトウェアを使用します。</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>これらのテンプレートでインポートした場合の、最初の 3 つの名前の例</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>기본 서버, 렌더링 노드, 신뢰하는 인증서</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>캐시 폴더, 메모리 내 썸네일, 캐시 한도</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>시작할 때 업데이트 확인</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>자동: 인터페이스가 원활하도록 코어 수에서 4를 뺀 값</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>자동으로 되돌리기: 코어 수에서 4를 뺀 값</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Titano.exe 옆에 portable.txt가 있으면 켜집니다. 모든 데이터가 해당 데이터 폴더에 보관됩니다.</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>프리셋을 지원하는 하드웨어 인코더가 있으면 사용하고, 없으면 소프트웨어를 사용합니다.</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>이 템플릿으로 가져올 때의 처음 세 이름 예시</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Numatytasis serveris, atvaizdavimo mazgas, patikimi sertifikatai</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Talpyklos aplankas, miniatiūros atmintyje, talpyklos riba</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Naujinimų tikrinimas paleidžiant</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: branduolių skaičius minus keturi, kad sąsaja greitai reaguotų</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Grįžti į Auto: branduolių skaičius minus keturi</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Įjungta, kai šalia Titano.exe yra portable.txt: visi duomenys lieka programos duomenų aplanke</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Naudoti aparatinį koduotuvą, kai jis palaiko išankstinę nuostatą; kitu atveju – programinį</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Pirmieji trys pavyzdinio importavimo pavadinimai pagal šiuos šablonus</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Noklusējuma serveris, renderēšanas mezgls, uzticamie sertifikāti</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Kešatmiņas mape, sīktēli atmiņā, kešatmiņas ierobežojums</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Atjauninājumu pārbaude startējot</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: kodoli mīnus četri, lai saskarne paliktu atsaucīga</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Atpakaļ uz Auto: kodoli mīnus četri</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Ieslēgts, ja blakus Titano.exe atrodas portable.txt: visi dati paliek tā datu mapē</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Izmantot aparatūras kodētāju, ja kāds atbalsta priekšiestatījumu; citādi programmatūras</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Pirmie trīs nosaukumi parauga importēšanai ar šīm veidnēm</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Pelayan lalai, nod render, sijil dipercayai</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Folder cache, lakaran kecil dalam memori, had cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Semakan kemas kini semasa mula</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: bilangan teras tolak empat supaya antara muka kekal responsif</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Kembali ke Auto: bilangan teras tolak empat</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Hidup apabila portable.txt terletak di sebelah Titano.exe: semua data kekal dalam folder datanya</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Gunakan pengekod perkakasan apabila ada yang menyokong praset; jika tidak, gunakan perisian</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Tiga nama pertama bagi contoh import dengan templat ini</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Standardserver, renderingsnode, klarerte sertifikater</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Hurtigbuffermappe, miniatyrbilder i minnet, hurtigbuffergrense</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Se etter oppdateringer ved oppstart</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: antall kjerner minus fire, slik at grensesnittet reagerer raskt</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Tilbake til Auto: antall kjerner minus fire</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>På når portable.txt ligger ved siden av Titano.exe: alle data blir liggende i programmets egen datamappe</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Bruk en maskinvarekoder når en støtter forhåndsinnstillingen, ellers programvare</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>De tre første navnene fra en eksempelimport med disse malene</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Standaardserver, renderknooppunt, vertrouwde certificaten</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cachemap, miniaturen in geheugen, cachelimiet</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Controleren op updates bij starten</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: aantal kernen min vier, zodat de interface responsief blijft</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Terug naar Auto: aantal kernen min vier</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Aan wanneer portable.txt naast Titano.exe staat: alle gegevens blijven in de bijbehorende gegevensmap</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Gebruik een hardware-encoder als die de voorinstelling ondersteunt; anders software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Eerste drie namen van een voorbeeldimport met deze sjablonen</value></data>
-2
View File
@@ -566,8 +566,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Serwer domyślny, węzeł renderowania, zaufane certyfikaty</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Folder pamięci podręcznej, miniatury w pamięci, limit pamięci podręcznej</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Sprawdzanie aktualizacji przy uruchomieniu</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: liczba rdzeni minus cztery, aby interfejs pozostał responsywny</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Przywróć Auto: liczba rdzeni minus cztery</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Włączony, gdy obok Titano.exe znajduje się plik portable.txt: wszystkie dane pozostają w jego folderze danych</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Używaj enkodera sprzętowego, jeśli obsługuje on preset; w przeciwnym razie programowego</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Pierwsze trzy nazwy przykładowego importu z tymi szablonami</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Servidor padrão, nó de renderização, certificados confiáveis</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Pasta do cache, miniaturas na memória, limite do cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Verificação de atualizações ao iniciar</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: núcleos menos quatro, para a interface continuar responsiva</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Volta para Auto: núcleos menos quatro</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Ativado quando portable.txt está ao lado de Titano.exe: todos os dados ficam na pasta data dele</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Usa um codificador de hardware quando algum suporta a predefinição; caso contrário, software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Os três primeiros nomes de uma importação de exemplo com estes modelos</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Servidor predefinido, nó de renderização, certificados fidedignos</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Pasta da cache, miniaturas em memória, limite da cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Verificação de atualizações ao iniciar</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: número de núcleos menos quatro, para que a interface continue a responder</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Voltar a Auto: número de núcleos menos quatro</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Ativado quando o portable.txt está junto ao Titano.exe: todos os dados ficam na respetiva pasta de dados</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Utilizar um codificador de hardware quando algum suporta a predefinição; caso contrário, software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Os três primeiros nomes de uma importação de exemplo com estes modelos</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Server implicit, nod de randare, certificate de încredere</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Folderul cache, miniaturi în memorie, limita cache</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Verificarea actualizărilor la pornire</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: numărul de nuclee minus patru, pentru ca interfața să rămână receptivă</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Revenire la Auto: numărul de nuclee minus patru</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Activat când portable.txt se află lângă Titano.exe: toate datele rămân în folderul său de date</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Folosiți un codificator hardware când acesta acceptă presetarea; altfel, software</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Primele trei nume ale unui import de probă cu aceste șabloane</value></data>
-2
View File
@@ -566,8 +566,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Сервер по умолчанию, узел рендеринга, доверенные сертификаты</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Папка кэша, эскизы в памяти, лимит кэша</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Проверка обновлений при запуске</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Авто: число ядер минус четыре, чтобы интерфейс оставался отзывчивым</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Вернуть «Авто»: число ядер минус четыре</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Включён, если рядом с Titano.exe лежит portable.txt: все данные хранятся в его папке данных</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Использовать аппаратный кодировщик, если он поддерживает пресет; иначе программный</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Первые три имени примерного импорта с этими шаблонами</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Predvolený server, renderovací uzol, dôveryhodné certifikáty</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Priečinok vyrovnávacej pamäte, miniatúry v pamäti, limit vyrovnávacej pamäte</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Kontrola aktualizácií pri spustení</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: počet jadier mínus štyri, aby rozhranie pohotovo reagovalo</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Späť na Auto: počet jadier mínus štyri</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Zapnutý, keď je vedľa Titano.exe súbor portable.txt: všetky údaje zostávajú v jeho priečinku údajov</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Použije hardvérový kodér, ak niektorý podporuje predvoľbu; inak softvérový</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Prvé tri názvy vzorového importu s týmito šablónami</value></data>
-2
View File
@@ -551,8 +551,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Privzeti strežnik, vozlišče za upodabljanje, zaupanja vredna potrdila</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Mapa predpomnilnika, miniature v pomnilniku, omejitev predpomnilnika</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Preverjanje posodobitev ob zagonu</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Samodejno: jedra minus štiri, da se vmesnik še naprej odziva</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Nazaj na samodejno: jedra minus štiri</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Vklopljeno, ko je portable.txt poleg Titano.exe: vsi podatki ostanejo v njegovi mapi s podatki</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Uporabi strojni kodirnik, kadar podpira prednastavitev, sicer programskega</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Prva tri imena vzorčnega uvoza s temi predlogami</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Standardserver, renderingsnod, betrodda certifikat</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Cachemapp, miniatyrer i minnet, cachegräns</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Sök efter uppdateringar vid start</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Auto: antal kärnor minus fyra så att gränssnittet förblir responsivt</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Tillbaka till Auto: antal kärnor minus fyra</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>På när portable.txt ligger bredvid Titano.exe: alla data stannar i dess datamapp</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Använd en maskinvarukodare när någon stöder förinställningen; annars programvara</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>De tre första namnen i en exempelimport med de här mallarna</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>เซิร์ฟเวอร์เริ่มต้น โหนดเรนเดอร์ ใบรับรองที่เชื่อถือ</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>โฟลเดอร์แคช ภาพขนาดย่อในหน่วยความจำ ขีดจำกัดแคช</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>ตรวจหาการอัปเดตเมื่อเริ่มต้น</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>อัตโนมัติ: จำนวนคอร์ลบสี่ เพื่อให้อินเทอร์เฟซตอบสนองได้ดี</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>กลับเป็นอัตโนมัติ: จำนวนคอร์ลบสี่</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>เปิดเมื่อมี portable.txt อยู่ข้าง Titano.exe: ข้อมูลทั้งหมดจะอยู่ในโฟลเดอร์ข้อมูลของโปรแกรม</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>ใช้ตัวเข้ารหัสฮาร์ดแวร์เมื่อมีตัวที่รองรับพรีเซ็ต มิฉะนั้นใช้ซอฟต์แวร์</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>สามชื่อแรกของการนำเข้าตัวอย่างด้วยเทมเพลตเหล่านี้</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Varsayılan sunucu, işleme düğümü, güvenilen sertifikalar</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Önbellek klasörü, bellekteki küçük resimler, önbellek sınırı</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Başlangıçta güncelleme denetimi</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Otomatik: arayüz duyarlı kalsın diye çekirdek sayısı eksi dört</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Otomatiğe dön: çekirdek sayısı eksi dört</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Titano.exe dosyasının yanında portable.txt varsa açıktır: tüm veriler onun veri klasöründe kalır</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Hazır ayarı destekleyen bir donanım kodlayıcısı varsa onu, yoksa yazılımı kullanır</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Bu şablonlarla örnek bir içe aktarmanın ilk üç adı</value></data>
-2
View File
@@ -566,8 +566,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Сервер за замовчуванням, вузол рендерингу, довірені сертифікати</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Папка кешу, мініатюри в пам’яті, ліміт кешу</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Перевірка оновлень під час запуску</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Авто: кількість ядер мінус чотири, щоб інтерфейс залишався чутливим</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Повернути «Авто»: кількість ядер мінус чотири</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Увімкнено, коли portable.txt лежить поруч із Titano.exe: усі дані зберігаються в його папці даних</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Використовувати апаратний кодувальник, якщо він підтримує пресет; інакше — програмний</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Перші три імені зразкового імпорту з цими шаблонами</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>Máy chủ mặc định, nút kết xuất, chứng chỉ tin cậy</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>Thư mục bộ nhớ đệm, hình thu nhỏ trong bộ nhớ, giới hạn bộ nhớ đệm</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>Kiểm tra cập nhật khi khởi động</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>Tự động: số lõi trừ bốn để giao diện luôn phản hồi nhanh</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>Về Tự động: số lõi trừ bốn</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>Bật khi có portable.txt nằm cạnh Titano.exe: mọi dữ liệu nằm trong thư mục dữ liệu của nó</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>Dùng bộ mã hóa phần cứng khi có bộ hỗ trợ cài đặt sẵn; nếu không thì dùng phần mềm</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>Ba tên đầu tiên của một lượt nhập mẫu với các mẫu này</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>默认服务器、渲染节点、受信任的证书</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>缓存文件夹、内存中的缩略图、缓存上限</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>启动时检查更新</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>自动:核心数减四,使界面保持响应</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>恢复自动:核心数减四</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>当 portable.txt 与 Titano.exe 位于同一文件夹时开启:所有数据都保存在其数据文件夹中</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>有硬件编码器支持该预设时使用硬件编码器,否则使用软件编码</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>使用这些模板时示例导入的前三个名称</value></data>
-2
View File
@@ -536,8 +536,6 @@
<data name="Tooltips.Settings.Page.Server" xml:space="preserve"><value>預設伺服器、算圖節點、信任的憑證</value></data>
<data name="Tooltips.Settings.Page.Storage" xml:space="preserve"><value>快取資料夾、記憶體中的縮圖、快取上限</value></data>
<data name="Tooltips.Settings.Page.Updates" xml:space="preserve"><value>啟動時檢查更新</value></data>
<data name="Tooltips.Settings.ParallelismAuto" xml:space="preserve"><value>自動:核心數減四,讓介面保持回應</value></data>
<data name="Tooltips.Settings.ParallelismReset" xml:space="preserve"><value>恢復自動:核心數減四</value></data>
<data name="Tooltips.Settings.Portable" xml:space="preserve"><value>當 portable.txt 與 Titano.exe 位於同一資料夾時開啟:所有資料都保留在其 data 資料夾中</value></data>
<data name="Tooltips.Settings.PreferHardware" xml:space="preserve"><value>預設集支援時使用硬體編碼器;否則使用軟體</value></data>
<data name="Tooltips.Settings.Preview" xml:space="preserve"><value>以這些範本進行範例匯入時的前三個名稱</value></data>
+8 -2
View File
@@ -10,8 +10,14 @@ public static class CurrentArchive
{
if (archives.Count == 0) return null;
if (string.IsNullOrWhiteSpace(lastRoot)) return archives[0];
var wanted = Normalize(lastRoot);
return archives.FirstOrDefault(a => string.Equals(Normalize(a.RootPath), wanted, StringComparison.OrdinalIgnoreCase)) ?? archives[0];
return At(archives, lastRoot) ?? archives[0];
}
/// <summary>The archive indexed at <paramref name="root"/>; null when none is (Settings › Archive never edits another one).</summary>
public static Core.Model.Archive? At(IReadOnlyList<Core.Model.Archive> archives, string root)
{
var wanted = Normalize(root);
return archives.FirstOrDefault(a => string.Equals(Normalize(a.RootPath), wanted, StringComparison.OrdinalIgnoreCase));
}
public static async Task<Core.Model.Archive?> FindAsync(TitanoDatabase db, string? lastRoot, CancellationToken cancellationToken = default) =>
+12 -8
View File
@@ -188,7 +188,7 @@ public sealed class AppServices : IAsyncDisposable
if (_pollTimer is { } timer && timer.Period != ScanInterval) timer.Period = ScanInterval;
}
/// <summary>Workers of this PC's job engine (Settings › Rendering › Parallelism, Auto: cores minus four).</summary>
/// <summary>Workers of this PC's job engine (Settings › Rendering › Parallelism, Auto: half the logical cores).</summary>
public int Parallelism => ProcessingTuning.Parallelism(Settings, System.Environment.ProcessorCount);
/// <summary>Starts, restarts or stops the render node to match the opt-in, the server session and the trusted certificates (BRIEF §14.7).</summary>
@@ -206,10 +206,12 @@ public sealed class AppServices : IAsyncDisposable
/// <summary>
/// Opens (or creates) the index at <paramref name="databasePath"/>, migrates it (after a restore staged in Settings ›
/// Advanced replaced it), starts the job engine and the daily backups.
/// Advanced replaced it, which needs no open index: it also recovers one that no longer opens), starts the job engine
/// and the daily backups.
/// </summary>
public async Task OpenAsync(string databasePath, CancellationToken ct = default)
{
await RestoreStagedAsync(databasePath, ct);
try
{
Database = await Task.Run(() => TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(databasePath), ct), ct);
@@ -221,7 +223,6 @@ public sealed class AppServices : IAsyncDisposable
Log.Error("app", "The index could not be opened", ex);
return;
}
await RestoreStagedAsync(Database, ct);
await StartJobsAsync(Database, startEngine: true, ct);
Thumbnails = new ThumbnailService(Database, Settings.ThumbnailMemoryItems);
Devices.Start();
@@ -286,15 +287,18 @@ public sealed class AppServices : IAsyncDisposable
}
}
/// <summary>A restore staged in Settings › Advanced replaces the index before anything reads it (<see cref="StagedRestore"/>).</summary>
private async Task RestoreStagedAsync(TitanoDatabase database, CancellationToken ct)
/// <summary>
/// A restore staged in Settings › Advanced replaces the index file before the index is opened, so it also recovers an
/// index that no longer opens (<see cref="StagedRestore"/>).
/// </summary>
private async Task RestoreStagedAsync(string databasePath, CancellationToken ct)
{
try
{
if (await Task.Run(() => DatabaseBackups.RestoreStagedAsync(database, Environment.BackupDirectory, ct), ct))
if (await Task.Run(() => DatabaseBackups.RestoreStagedAsync(databasePath, Environment.BackupDirectory, ct), ct))
{
StagedRestore = StagedRestoreResult.Restored;
Log.Info("app", $"Index restored (schema {database.SchemaVersion})");
Log.Info("app", $"Index at {databasePath} restored from the staged copy");
}
}
catch (InvalidDataException ex)
@@ -302,7 +306,7 @@ public sealed class AppServices : IAsyncDisposable
StagedRestore = StagedRestoreResult.Unreadable;
Log.Error("app", "The staged index copy failed its checks; it was set aside and the index kept", ex);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or DatabaseException)
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or DatabaseException or DllNotFoundException)
{
StagedRestore = StagedRestoreResult.Deferred;
Log.Error("app", "The staged index restore could not run; the index was kept and the restore stays staged", ex);
+1 -1
View File
@@ -125,7 +125,7 @@ public sealed class AppSettings
/// <summary>Frame memory budget in GB; null = Auto (a quarter of installed memory).</summary>
public int? MemoryBudgetGb { get; set; }
/// <summary>Worker threads; null = Auto (cores minus four, at least one).</summary>
/// <summary>Jobs run at once, also capping their decode and analysis threads; null = Auto (half the logical cores, at least one, with the jobs' own thread counts).</summary>
public int? Parallelism { get; set; }
public bool BackgroundPriority { get; set; } = true;
@@ -68,11 +68,12 @@ public static class ArchiveActions
}
/// <summary>
/// Why creating or opening an archive failed: the archive's own sentences for files, access and the index
/// (<see cref="ArchiveFailures"/>), otherwise <see cref="Shell.ErrorText"/> (a catalog sentence, or "Something went wrong").
/// Why creating, opening or changing an archive failed: the archive's own sentences for files (an unreadable
/// archive.json included), access and the index (<see cref="ArchiveFailures"/>), otherwise <see cref="Shell.ErrorText"/>
/// (a catalog sentence, or "Something went wrong").
/// </summary>
public static string Cause(Exception ex) =>
ex is IOException or UnauthorizedAccessException or Data.DatabaseException ? ArchiveFailures.Cause(ex) : Shell.ErrorText.For(ex);
ex is IOException or InvalidDataException or UnauthorizedAccessException or Data.DatabaseException ? ArchiveFailures.Cause(ex) : Shell.ErrorText.For(ex);
}
/// <summary>Archive roots offered by default and their free space.</summary>
+1
View File
@@ -85,6 +85,7 @@
<MenuItem Header="{l:Loc Archive.Maintenance.DryRun}" Command="{Binding MaintenanceDryRunCommand}" ToolTip="{l:Loc Tooltips.Archive.MaintenanceDryRun}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Proxies}" Command="{Binding RebuildProxiesCommand}" ToolTip="{Binding RebuildProxiesToolTip}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Backup}" Command="{Binding BackupCommand}" ToolTip="{l:Loc Tooltips.Archive.Backup}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Restore}" Command="{Binding RestoreCommand}" ToolTip="{l:Loc Tooltips.Archive.Restore}" />
<MenuItem Header="{l:Loc Archive.Maintenance.Trash}" Command="{Binding TrashCommand}" ToolTip="{l:Loc Tooltips.Archive.Trash}" ToolTipService.ShowOnDisabled="True" />
<Separator />
<MenuItem Header="{l:Loc Archive.Maintenance.Relink}" Command="{Binding RelinkCommand}" ToolTip="{l:Loc Tooltips.Archive.Relink}" ToolTipService.ShowOnDisabled="True" />
@@ -83,6 +83,11 @@ public sealed class ArchiveViewModel : SectionViewModel
AdoptCommand = new AsyncRelayCommand(AdoptAsync);
CopyFolderCommand = new RelayCommand(CopyFolder, () => _archive is not null);
BackupCommand = new AsyncRelayCommand(BackupAsync, () => Services.Database is not null);
RestoreCommand = new RelayCommand(() =>
{
Shell.Settings.Page = Titano.App.Settings.SettingsPage.Advanced;
Shell.Navigate(SectionKey.Settings);
});
MaintenanceCommand = new AsyncRelayCommand(() => QueueAsync(a => ArchiveJobs.Maintenance(a)), IsOnline);
MaintenanceDryRunCommand = new AsyncRelayCommand(() => QueueAsync(a => ArchiveJobs.Maintenance(a, dryRun: true)), () => _archive is not null);
RebuildProxiesCommand = new AsyncRelayCommand(() => QueueSetAsync(ids => ArchiveJobs.Proxies(ids, _archive!.Name, force: true), All()), IsOnline);
@@ -176,6 +181,10 @@ public sealed class ArchiveViewModel : SectionViewModel
public ICommand CopyFolderCommand { get; }
public ICommand BackupCommand { get; }
/// <summary>"Maintenance ▾ › Restore database…" (BRIEF §12.5): Settings › Advanced, where a daily copy is compared and restored (§6.2).</summary>
public ICommand RestoreCommand { get; }
public ICommand MaintenanceCommand { get; }
public ICommand MaintenanceDryRunCommand { get; }
public ICommand RebuildProxiesCommand { get; }
+2 -2
View File
@@ -283,11 +283,11 @@
<TextBox Style="{StaticResource TextBox.SettingNumber}" Text="{Binding Parallelism.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
shell:EditBehavior.Field="{Binding Parallelism}" ToolTip="{Binding Parallelism.ToolTip}" AutomationProperties.Name="{l:Loc Settings.Rendering.Parallelism}" />
<TextBlock Style="{StaticResource Text.Hint}" Text="{Binding CoresText}" Margin="12,0,0,0" />
<Border Style="{StaticResource Pill.Auto}" Margin="12,0,0,0" VerticalAlignment="Center" ToolTip="{l:Loc Tooltips.Settings.ParallelismAuto}"
<Border Style="{StaticResource Pill.Auto}" Margin="12,0,0,0" VerticalAlignment="Center" ToolTip="{l:Loc Tooltips.Settings.WorkersAuto}"
Visibility="{Binding IsParallelismAuto, Converter={StaticResource BoolToVisibility}}">
<TextBlock Style="{StaticResource Text.AutoPill}" Text="{Binding ParallelismAutoText}" />
</Border>
<Button Style="{StaticResource Button.Reset}" Margin="12,0,0,0" Command="{Binding ResetParallelismCommand}" ToolTip="{l:Loc Tooltips.Settings.ParallelismReset}"
<Button Style="{StaticResource Button.Reset}" Margin="12,0,0,0" Command="{Binding ResetParallelismCommand}" ToolTip="{l:Loc Tooltips.Settings.WorkersReset}"
AutomationProperties.Name="{l:Loc Settings.BackToAuto}"
Visibility="{Binding IsParallelismAuto, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" />
<CheckBox Content="{l:Loc Settings.Rendering.Background}" IsChecked="{Binding BackgroundPriority}" ToolTip="{l:Loc Tooltips.Settings.InterfacePriority}"
+109 -30
View File
@@ -80,6 +80,7 @@ public sealed class SettingsViewModel : SectionViewModel
_s.LastArchivePath = v.Length == 0 ? null : Path.GetFullPath(v);
Save();
UpdateArchiveFree();
_ = RetargetArchiveAsync();
}, () => Loc.L("Tooltips.Settings.ArchiveRoot"));
FolderTemplate = new EditableField(_s.FolderTemplate, v => NamingPreview.Validate(v, isFolder: true), v =>
{
@@ -334,12 +335,13 @@ public sealed class SettingsViewModel : SectionViewModel
private set => Set(ref _previewNames, value);
}
/// <summary>BRIEF §8.5: 1280, 1920 (default), 2560 or full size; no proxies is what a server admin may also choose.</summary>
/// <summary>
/// BRIEF §8.5: 1280, 1920 (default), 2560 or full size; no proxies is what a server admin may also choose. A size the
/// archive got elsewhere (the admin panel also offers 3840) is listed with its number, never shown as another size.
/// </summary>
public IReadOnlyList<SettingsOption<int>> ProxySizes =>
[
new(1280, "1280"),
new(1920, "1920"),
new(2560, "2560"),
.. Sizes([1280, 1920, 2560], _s.ProxyLongEdge is ProxyPolicy.FullSize or ProxyPolicy.Disabled ? null : _s.ProxyLongEdge),
new(ProxyPolicy.FullSize, Loc.L("Settings.Archive.FullSize")),
new(ProxyPolicy.Disabled, Loc.L("Settings.Archive.NoProxies")),
];
@@ -347,7 +349,7 @@ public sealed class SettingsViewModel : SectionViewModel
/// <summary>The open archive's proxy size (archive.json), and the one of new archives.</summary>
public SettingsOption<int> SelectedProxySize
{
get => ProxySizes.FirstOrDefault(p => p.Value == _s.ProxyLongEdge) ?? ProxySizes[1];
get => ProxySizes.First(p => p.Value == _s.ProxyLongEdge);
set
{
if (value is null || value.Value == _s.ProxyLongEdge) return;
@@ -358,12 +360,13 @@ public sealed class SettingsViewModel : SectionViewModel
}
}
public IReadOnlyList<SettingsOption<int>> ThumbnailSizes => [.. new[] { 240, 320, 480, 640 }.Select(n => new SettingsOption<int>(n, n.ToString(CultureInfo.InvariantCulture)))];
/// <summary>240, 320 (default), 480 or 640; another size of the archive (160 to 1024 are valid) is listed with its number.</summary>
public IReadOnlyList<SettingsOption<int>> ThumbnailSizes => Sizes([240, 320, 480, 640], _s.ThumbnailLongEdge);
/// <summary>The open archive's thumbnail size (archive.json), and the one of new archives.</summary>
public SettingsOption<int> SelectedThumbnailSize
{
get => ThumbnailSizes.FirstOrDefault(p => p.Value == _s.ThumbnailLongEdge) ?? ThumbnailSizes[1];
get => ThumbnailSizes.First(p => p.Value == _s.ThumbnailLongEdge);
set
{
if (value is null || value.Value == _s.ThumbnailLongEdge) return;
@@ -549,7 +552,7 @@ public sealed class SettingsViewModel : SectionViewModel
public int LogicalCores => Environment.ProcessorCount;
/// <summary>Auto: cores minus four so the UI stays responsive.</summary>
/// <summary>Auto: half the logical cores, the job engine's default (BRIEF §14.6).</summary>
public int ParallelismAuto => ProcessingTuning.ParallelismAuto(LogicalCores);
private int EffectiveParallelism => _s.Parallelism ?? ParallelismAuto;
@@ -713,7 +716,8 @@ public sealed class SettingsViewModel : SectionViewModel
/// <summary>A restore waits for the next start of Titano.</summary>
public bool IsRestoreStaged => DatabaseBackups.HasStagedRestore(Shell.Services.Environment.DatabasePath);
private bool CanRestore => !_isRestoring && _selectedBackup is not null && Shell.Services.Database is not null && !IsRestoreStaged;
/// <summary>Also while the index cannot be opened: that is the case a restore exists for (BRIEF §6.2).</summary>
private bool CanRestore => !_isRestoring && _selectedBackup is not null && !IsRestoreStaged;
public ICommand RestoreDatabaseCommand { get; }
public ICommand CancelRestoreCommand { get; }
@@ -840,14 +844,17 @@ public sealed class SettingsViewModel : SectionViewModel
/// <summary>
/// Shows the open archive's own templates, proxy size and thumbnail size (its archive.json; the index's while it is
/// offline) unless a field holds an edit; they also become the defaults of new archives.
/// offline) unless a field holds an edit; they also become the defaults of new archives. The open archive is the one
/// at the archive folder of this PC, never another one of the index: with none registered there, the rows edit only
/// this PC's defaults.
/// </summary>
private async Task LoadArchiveAsync()
{
if (Shell.Services.Database is not { } db || Shell.Services.Archives is not { } archives) return;
try
{
var archive = await CurrentArchive.FindAsync(db, _s.LastArchivePath);
var registered = await db.Archives.ListAsync();
var archive = _s.LastArchivePath is { Length: > 0 } root ? CurrentArchive.At(registered, root) : CurrentArchive.Pick(registered, null);
_archive = archive;
if (archive is null) return;
var settings = await Task.Run(() => archives.GetSettingsAsync(archive.Id));
@@ -860,6 +867,9 @@ public sealed class SettingsViewModel : SectionViewModel
_s.ProxyLongEdge = settings.Proxies.LongEdge;
_s.ThumbnailLongEdge = settings.Thumbnails.LongEdge;
if (changed) Save();
// The lists first: a size the archive got elsewhere joins them before it is selected.
OnPropertyChanged(nameof(ProxySizes));
OnPropertyChanged(nameof(ThumbnailSizes));
OnPropertyChanged(nameof(SelectedProxySize));
OnPropertyChanged(nameof(SelectedThumbnailSize));
UpdatePreview();
@@ -879,9 +889,12 @@ public sealed class SettingsViewModel : SectionViewModel
if (_archive is not { } archive || Shell.Services.Archives is not { } archives) return;
try
{
_archive = await Task.Run(() => archives.UpdateSettingsAsync(archive.Id, edit));
var updated = await Task.Run(() => archives.UpdateSettingsAsync(archive.Id, edit));
// The archive folder may have changed meanwhile: the rows then belong to another archive.
if (_archive?.Id == updated.Id) _archive = updated;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or InvalidDataException or DatabaseException)
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or InvalidDataException or NewerFormatException
or DatabaseException)
{
Log.Warning("settings", "The archive settings were not saved", ex);
Shell.Notify(Loc.L("Settings.Archive.NotSaved"), ArchiveActions.Cause(ex), isError: true);
@@ -889,7 +902,7 @@ public sealed class SettingsViewModel : SectionViewModel
}
}
/// <summary>All of Settings › Archive into the open archive (after a reset or an import of settings).</summary>
/// <summary>Every archive row into the open archive: Archive › Reset section, after the user confirmed it for that archive.</summary>
private Task PushArchiveSettingsAsync() => UpdateArchiveAsync(a => a with
{
Templates = a.Templates with { Folder = _s.FolderTemplate, File = _s.FileTemplate },
@@ -897,6 +910,45 @@ public sealed class SettingsViewModel : SectionViewModel
Thumbnails = a.Thumbnails with { LongEdge = _s.ThumbnailLongEdge },
});
/// <summary>
/// The archive folder changed: an archive already there is registered as at start (relinked when it moved) and given
/// its rescan, and the rows show its settings; any other folder leaves them with this PC's defaults for new archives.
/// Later edits never reach the archive shown before.
/// </summary>
private async Task RetargetArchiveAsync()
{
_archive = null;
if (_s.LastArchivePath is { } root && Shell.Services.Archives is { } archives)
{
try
{
var opened = await Task.Run(async () => File.Exists(new ArchivePaths(root).ManifestPath) ? await archives.OpenAsync(root) : null);
if (opened is not null) await Shell.Services.QueueScanAsync(opened, full: false);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or DatabaseException)
{
Log.Warning("settings", $"The archive at {root} could not be opened", ex);
Shell.Notify(Loc.L("Errors.Archive.Open"), ArchiveActions.Cause(ex), isError: true);
}
}
await LoadArchiveAsync();
}
/// <summary>
/// Archive › Reset section with an archive open writes the defaults into that archive's archive.json, which the server
/// and the other PCs share: the user confirms it for that archive by name first.
/// </summary>
private bool ConfirmArchiveReset(Archive archive) => Shell.Services.Dialogs.Confirm(new ConfirmRequest
{
Heading = Loc.L("Settings.Archive.ResetTitle", archive.Name),
Message = Loc.L("Settings.Archive.ResetMessage"),
SafeText = Loc.L("Settings.Storage.Keep"),
SafeToolTip = Loc.L("Tooltips.Settings.KeepArchiveSettings"),
ActionText = Loc.L("Settings.Archive.ResetAction"),
ActionToolTip = Loc.L("Tooltips.Settings.ResetArchiveConfirm"),
IsDestructive = true,
});
private void OnServerChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
LoadCertificates();
@@ -911,6 +963,13 @@ public sealed class SettingsViewModel : SectionViewModel
ArchiveFreeText = ArchiveLocations.FreeSpace(path) is { } free ? Loc.L("Settings.Archive.Free", Formatting.Bytes(free)) : null;
}
/// <summary>The preset sizes in order, with <paramref name="current"/> among them when it is none of them.</summary>
private static IReadOnlyList<SettingsOption<int>> Sizes(int[] presets, int? current)
{
var values = current is { } size && !presets.Contains(size) ? presets.Append(size) : presets;
return [.. values.Order().Select(n => new SettingsOption<int>(n, n.ToString(CultureInfo.InvariantCulture)))];
}
private string? ValidateParallelism(string text) => ValidateInt(text, 1, Math.Max(1, LogicalCores * 2));
private static string? ValidateInt(string text, int min, int max) =>
@@ -1104,24 +1163,24 @@ public sealed class SettingsViewModel : SectionViewModel
}
/// <summary>
/// Restore (BRIEF §6.2, §12.8): a dry run reads what the chosen copy holds against the index now; after the user's
/// destructive confirmation the copy is staged beside the index for the next start, where the index as it is then is
/// backed up first (<see cref="DatabaseBackups.RestoreStagedAsync"/>; the staged copy is out of reach of the pruning
/// to three copies). Nothing replaces the index while Titano runs.
/// Restore (BRIEF §6.2, §12.8): a dry run reads what the chosen copy holds against the index now (shown as unreadable
/// when the index did not open, the case a restore exists for); after the user's destructive confirmation the copy is
/// staged beside the index for the next start, where the index as it is then is kept first and replaced before it is
/// opened (<see cref="DatabaseBackups.RestoreStagedAsync"/>; the staged copy is out of reach of the pruning to three
/// copies). Nothing replaces the index while Titano runs.
/// </summary>
private async Task RestoreDatabaseAsync()
{
if (_selectedBackup is not { } option || Shell.Services.Database is not { } db) return;
if (_selectedBackup is not { } option) return;
var backup = option.Backup;
var environment = Shell.Services.Environment;
_isRestoring = true;
CommandManager.InvalidateRequerySuggested();
try
{
DatabaseSummary current, restored;
DatabaseSummary restored;
try
{
current = await DatabaseBackups.SummarizeAsync(db);
restored = await Task.Run(() => DatabaseBackups.SummarizeBackupAsync(backup.Path, environment.DataDirectory));
}
catch (Exception ex) when (ex is InvalidDataException or IOException or UnauthorizedAccessException or DatabaseException)
@@ -1130,13 +1189,28 @@ public sealed class SettingsViewModel : SectionViewModel
Shell.Notify(Loc.L("Errors.Backup.Unreadable"), isError: true);
return;
}
DatabaseSummary? current = null;
if (Shell.Services.Database is { } db)
{
try
{
current = await DatabaseBackups.SummarizeAsync(db);
}
catch (DatabaseException ex)
{
// A damaged index may open and still fail to count: it is shown as unreadable, and the restore remains possible.
Log.Warning("settings", "The current index could not be summarized", ex);
}
}
var currentLine = current is { } now
? Loc.L("Settings.Advanced.RestoreCurrent", Formatting.Count(now.Sequences), Formatting.Count(now.Photos))
: Loc.L("Settings.Advanced.RestoreUnreadable");
var confirmed = Shell.Services.Dialogs.Confirm(new ConfirmRequest
{
Heading = Loc.L("Settings.Advanced.RestoreTitle", option.Label),
Message = Loc.L("Settings.Advanced.RestoreMessage"),
Detail = string.Join(Environment.NewLine,
Loc.L("Settings.Advanced.RestoreBackup", Formatting.Count(restored.Sequences), Formatting.Count(restored.Photos)),
Loc.L("Settings.Advanced.RestoreCurrent", Formatting.Count(current.Sequences), Formatting.Count(current.Photos))),
Loc.L("Settings.Advanced.RestoreBackup", Formatting.Count(restored.Sequences), Formatting.Count(restored.Photos)), currentLine),
IsDetailMonospaced = false,
DetailToolTip = Formatting.LeftToRight(backup.Path),
SafeText = Loc.L("Settings.Storage.Keep"),
@@ -1193,6 +1267,9 @@ public sealed class SettingsViewModel : SectionViewModel
UiLanguage.Apply(null);
break;
case SettingsPage.Archive:
// The rows are the open archive's own: resetting them changes it for everyone sharing it, so only when confirmed.
var open = _archive;
if (open is not null && !ConfirmArchiveReset(open)) return;
_s.FolderTemplate = defaults.FolderTemplate;
_s.FileTemplate = defaults.FileTemplate;
_s.ProxyLongEdge = defaults.ProxyLongEdge;
@@ -1201,7 +1278,7 @@ public sealed class SettingsViewModel : SectionViewModel
FolderTemplate.Load(_s.FolderTemplate);
FileTemplate.Load(_s.FileTemplate);
UpdatePreview();
_ = PushArchiveSettingsAsync();
if (open is not null) _ = PushArchiveSettingsAsync();
break;
case SettingsPage.Import:
_s.ImportSessionGapMinutes = defaults.ImportSessionGapMinutes;
@@ -1264,9 +1341,10 @@ public sealed class SettingsViewModel : SectionViewModel
}
/// <summary>
/// Advanced › Reset: every preference back to its default after a destructive confirmation. What identifies this PC's
/// data and session stays: the archive folder, the server, its session and trusted certificates, the window and the
/// first-run choice. The open archive takes the default templates and sizes.
/// Advanced › Reset: every preference of this PC back to its default after a destructive confirmation. What identifies
/// this PC's data and session stays: the archive folder, the server, its session and trusted certificates, the window
/// and the first-run choice. The open archive's own settings (archive.json, shared with the server and other PCs) are
/// not touched: the Archive rows show them again (with no archive open, they show the reset defaults of new archives).
/// </summary>
private void ResetAll()
{
@@ -1294,7 +1372,7 @@ public sealed class SettingsViewModel : SectionViewModel
JobsClearedAt = _s.JobsClearedAt,
};
ApplyAll(defaults);
_ = PushArchiveSettingsAsync();
_ = LoadArchiveAsync();
Log.Info("settings", "Every setting reset to its default");
Shell.Notify(Loc.L("Settings.Advanced.ResetDone"));
}
@@ -1363,8 +1441,9 @@ public sealed class SettingsViewModel : SectionViewModel
imported.Window = _s.Window;
imported.FirstRunCompleted = _s.FirstRunCompleted;
ApplyAll(imported);
// The imported templates and sizes become the open archive's, as when typed in Settings › Archive.
_ = PushArchiveSettingsAsync();
// Settings of a PC never rewrite the shared archive.json: the imported templates and sizes are the defaults of new
// archives, and the rows show the own settings of the archive at the (possibly imported) archive folder.
_ = RetargetArchiveAsync();
Shell.Notify(Loc.L("Settings.Import.Done"));
}
+17 -12
View File
@@ -31,38 +31,43 @@ public static class ProcessingTuning
/// <summary>Frames decoded ahead of the render position, per quality profile (Best keeps more in flight, within the budget).</summary>
public static int ReadAhead(QualityProfile quality) => quality == QualityProfile.Best ? 8 : 4;
/// <summary>Auto parallelism: logical cores minus four, so the interface stays responsive (at least one).</summary>
public static int ParallelismAuto(int logicalCores) => int.Max(1, logicalCores - 4);
/// <summary>Auto parallelism: the job engine's default, half the logical cores (BRIEF §14.6), at least one.</summary>
public static int ParallelismAuto(int logicalCores) => int.Max(1, logicalCores / 2);
/// <summary>Workers and threads this PC's jobs use: the user's value, or Auto.</summary>
/// <summary>Workers of this PC's job engine: the user's value, or Auto.</summary>
public static int Parallelism(AppSettings settings, int logicalCores) => settings.Parallelism is { } n and > 0 ? n : ParallelismAuto(logicalCores);
/// <summary>The frame memory budget in bytes: the user's GB, or Auto (a quarter of <paramref name="installedBytes"/>).</summary>
/// <summary>The frame memory budget of this PC in bytes: the user's GB, or Auto (a quarter of <paramref name="installedBytes"/>).</summary>
public static long MemoryBudget(AppSettings settings, long installedBytes) =>
settings.MemoryBudgetGb is { } gb ? gb * (1L << 30) : long.Max(1L << 30, installedBytes / 4);
/// <summary><paramref name="basis"/> with the user's current Rendering and Analysis settings.</summary>
/// <summary>
/// <paramref name="basis"/> with the user's current Rendering and Analysis settings. The memory budget is shared by the
/// jobs that can run at once: each job's frame window gets its share (budget ÷ workers). Auto keeps the engine's own
/// thread counts per job; a value the user set also caps the background decodes and the deep analysis's threads.
/// </summary>
public static ProcessingOptions Apply(ProcessingOptions basis, AppSettings settings, long installedBytes, int logicalCores, string spillDirectory)
{
var parallelism = Parallelism(settings, logicalCores);
var workers = Parallelism(settings, logicalCores);
int? cap = settings.Parallelism is { } n and > 0 ? n : null;
var analysis = settings.DeepAnalysis(basis.DeepAnalysis);
return basis with
{
FrameWindow = basis.FrameWindow with
{
MemoryBudget = MemoryBudget(settings, installedBytes),
MemoryBudget = long.Max(1, MemoryBudget(settings, installedBytes) / workers),
SpillDirectory = spillDirectory,
Ahead = ReadAhead(settings.Quality),
MaxConcurrentLoads = int.Clamp(parallelism, 1, basis.FrameWindow.MaxConcurrentLoads),
MaxConcurrentLoads = cap is { } loads ? int.Clamp(loads, 1, basis.FrameWindow.MaxConcurrentLoads) : basis.FrameWindow.MaxConcurrentLoads,
},
Render = basis.Render with
{
AnalysisLongEdge = PreparationLongEdge(settings.Quality),
DefaultFlowQuality = FlowQuality(settings.Quality),
},
DeepAnalysis = settings.DeepAnalysis(basis.DeepAnalysis) with
{
MaxDegreeOfParallelism = int.Clamp(parallelism, 1, DeepAnalysisOptions.Default.MaxDegreeOfParallelism),
},
DeepAnalysis = cap is { } threads
? analysis with { MaxDegreeOfParallelism = int.Clamp(threads, 1, DeepAnalysisOptions.Default.MaxDegreeOfParallelism) }
: analysis,
};
}
}
+15 -3
View File
@@ -79,8 +79,7 @@ public sealed class ArchiveService : IJobHandlerProvider
{
ArgumentNullException.ThrowIfNull(settings);
var paths = new ArchivePaths(root);
var name = string.IsNullOrWhiteSpace(settings.Name) ? Path.GetFileName(paths.Root) is { Length: > 0 } folder ? folder : paths.Root : settings.Name.Trim();
settings = settings with { Name = name.Length > ArchiveSettings.MaxNameLength ? name[..ArchiveSettings.MaxNameLength] : name };
settings = WithUsableName(settings, paths);
if (settings.Problem() is { } field) throw new ArgumentException($"The archive setting {field} is invalid.", field);
if (File.Exists(paths.ManifestPath)) throw new InvalidOperationException($"{paths.Root} already is a Titano archive.");
Directory.CreateDirectory(paths.MetaDirectory);
@@ -166,6 +165,8 @@ public sealed class ArchiveService : IJobHandlerProvider
/// <paramref name="edit"/> receives the settings read from the file under the archive's settings lease, so a server and
/// a client sharing the archive never undo each other's change; the file is replaced atomically. Folders and files
/// already in the archive keep their names: templates and policies apply to the next imports, proxies and thumbnails.
/// A blank or overlong name in the file (archives made at a drive root, or before names were checked) is made usable
/// as <see cref="CreateAsync(string, ArchiveSettings, CancellationToken)"/> does, instead of failing every edit.
/// </summary>
/// <exception cref="ArgumentException">An edited setting is invalid (<see cref="ArgumentException.ParamName"/> names it).</exception>
/// <exception cref="ArchiveOfflineException">The archive is offline or read-only.</exception>
@@ -182,7 +183,8 @@ public sealed class ArchiveService : IJobHandlerProvider
{
var current = ManifestStore.ReadArchive(paths.ManifestPath);
if (current.Id != archive.Id) throw new InvalidDataException($"{paths.ManifestPath} belongs to archive {current.Id}, not {archive.Id}.");
var settings = edit(ArchiveSettings.Of(current));
// The name read is made usable before the edit sees it; a name the edit sets is checked as given.
var settings = edit(WithUsableName(ArchiveSettings.Of(current), paths));
if (settings.Problem() is { } field) throw new ArgumentException($"The archive setting {field} is invalid.", field);
manifest = current with
{
@@ -296,6 +298,16 @@ public sealed class ArchiveService : IJobHandlerProvider
await Imports.PlanEraseAsync(await LoadArchiveAsync(archiveId, cancellationToken).ConfigureAwait(false), cardId, sourceRoot, progress,
cancellationToken).ConfigureAwait(false);
/// <summary>
/// <paramref name="settings"/> with a name an archive can keep: a blank one becomes the folder's name (the root itself
/// for a drive root), one longer than <see cref="ArchiveSettings.MaxNameLength"/> is shortened.
/// </summary>
private static ArchiveSettings WithUsableName(ArchiveSettings settings, ArchivePaths paths)
{
var name = string.IsNullOrWhiteSpace(settings.Name) ? Path.GetFileName(paths.Root) is { Length: > 0 } folder ? folder : paths.Root : settings.Name.Trim();
return settings with { Name = name.Length > ArchiveSettings.MaxNameLength ? name[..ArchiveSettings.MaxNameLength] : name };
}
private async Task<Archive> RegisterAsync(ArchivePaths paths, ArchiveManifest manifest, CancellationToken cancellationToken)
{
var archive = new Archive
+63 -19
View File
@@ -16,8 +16,8 @@ public sealed record DatabaseSummary(int SchemaVersion, int Archives, int Sequen
/// Backups of the SQLite index (BRIEF §6.2): a <c>VACUUM INTO</c> copy made once a day while the host runs (at start
/// when the newest copy is a day old, then checked every hour), the three newest kept; and their restore from
/// Settings › Advanced. A restore never swaps the file under a running host: the chosen copy is staged next to the
/// index and replaces it the next time the host opens it, before anything reads it and after a fresh copy of the index
/// it replaces.
/// index and replaces it at the next start, before the host opens the index (so it also recovers an index that no
/// longer opens), once the index it replaces has been kept.
/// </summary>
public static partial class DatabaseBackups
{
@@ -101,10 +101,11 @@ public static partial class DatabaseBackups
}
/// <summary>
/// The restore's dry run: what <paramref name="backupPath"/> holds, read from a scratch copy in
/// <paramref name="scratchDirectory"/> (opened and migrated there, so the backup itself is never written).
/// The restore's dry run and check: what <paramref name="backupPath"/> holds, read from a scratch copy in
/// <paramref name="scratchDirectory"/> (so the backup itself is never written) that first passes
/// <c>PRAGMA quick_check</c>, then opens and migrates.
/// </summary>
/// <exception cref="InvalidDataException">The file is not a readable Titano index.</exception>
/// <exception cref="InvalidDataException">The file is not a sound Titano index this build can open.</exception>
public static async Task<DatabaseSummary> SummarizeBackupAsync(string backupPath, string scratchDirectory, CancellationToken cancellationToken = default)
{
var folder = Path.Combine(scratchDirectory, "restore-check-" + Guid.NewGuid().ToString("N")[..8]);
@@ -115,6 +116,8 @@ public static partial class DatabaseBackups
File.Copy(backupPath, copy);
try
{
// Before the migration writes to it: a damaged page in a table the counts never read must not pass.
await CheckIntegrityAsync(copy, cancellationToken).ConfigureAwait(false);
await using var db = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(copy), cancellationToken).ConfigureAwait(false);
return await SummarizeAsync(db, cancellationToken).ConfigureAwait(false);
}
@@ -167,22 +170,25 @@ public static partial class DatabaseBackups
public static void CancelStagedRestore(string databasePath) => File.Delete(StagedPath(databasePath));
/// <summary>
/// Carries out a staged restore on the index the host has just opened, before anything else uses it: the staged copy
/// is checked (it opens in a scratch copy and passes <c>quick_check</c>), the index as it is now is copied into
/// <paramref name="backupDirectory"/>, and only then is it replaced by the staged copy, migrated to this build's
/// schema. False when none was staged.
/// Carries out a staged restore before the host opens the index at <paramref name="databasePath"/>, so it also
/// recovers an index that no longer opens. The staged copy is checked first (<see cref="SummarizeBackupAsync"/>:
/// <c>quick_check</c>, open, migration). The index as it is now is kept in <paramref name="backupDirectory"/>: as a
/// fresh <c>VACUUM INTO</c> copy among the daily ones, or, when it cannot be read, copied there whole (with its WAL) as
/// <c>&lt;name&gt;-replaced-&lt;stamp&gt;.db</c>, outside the rotation, so it never pushes a good copy out. Only then is
/// the staged copy renamed over the index: the rename consumes it, so it is never applied twice. The host's open then
/// migrates it to this build's schema. False when none was staged.
/// </summary>
/// <exception cref="InvalidDataException">The staged copy failed its checks; it is set aside as <c>.failed</c> and the index is unchanged.</exception>
/// <exception cref="IOException">The index could not be backed up or replaced (also <see cref="UnauthorizedAccessException"/>,
/// <see cref="DatabaseException"/>): it is unchanged and the restore stays staged for the next start.</exception>
public static async Task<bool> RestoreStagedAsync(TitanoDatabase db, string backupDirectory, CancellationToken cancellationToken = default)
/// <exception cref="IOException">The index could not be kept or replaced (also <see cref="UnauthorizedAccessException"/>):
/// the restore stays staged for the next start.</exception>
public static async Task<bool> RestoreStagedAsync(string databasePath, string backupDirectory, CancellationToken cancellationToken = default)
{
if (db.Database is not SqliteDatabase { Path: { } path }) return false;
var path = Path.GetFullPath(databasePath);
var staged = StagedPath(path);
if (!File.Exists(staged)) return false;
try
{
// A copy this build cannot open (damaged, or made by a newer Titano) must never replace a working index.
// A copy this build cannot open (damaged, or made by a newer Titano) must never replace the index.
await SummarizeBackupAsync(staged, Path.GetDirectoryName(path) ?? ".", cancellationToken).ConfigureAwait(false);
}
catch (InvalidDataException)
@@ -190,14 +196,52 @@ public static partial class DatabaseBackups
File.Move(staged, staged + ".failed", overwrite: true);
throw;
}
// What the index holds up to this start stays recoverable: no restore without a fresh copy first.
var before = await db.BackupAsync(backupDirectory, Keep, cancellationToken).ConfigureAwait(false);
await db.RestoreAsync(staged, cancellationToken).ConfigureAwait(false);
File.Delete(staged);
Log.Info("backup", $"Index restored from the staged copy; the index it replaced is {before}");
// What the index holds up to this start stays recoverable: no restore without keeping it first.
var kept = File.Exists(path) ? await KeepAsync(path, backupDirectory, cancellationToken).ConfigureAwait(false) : null;
// A WAL left behind belongs to the replaced file and would be replayed onto the restored one.
File.Delete(path + "-wal");
File.Delete(path + "-shm");
AtomicFile.Commit(staged, path);
Log.Info("backup", kept is null ? "Index restored from the staged copy" : $"Index restored from the staged copy; the index it replaced is {kept}");
return true;
}
/// <summary>
/// The index about to be replaced, kept in <paramref name="backupDirectory"/>: a <c>VACUUM INTO</c> copy when it opens,
/// else the file itself with its WAL, set aside under a name the pruning of the daily copies never matches.
/// </summary>
private static async Task<string> KeepAsync(string path, string backupDirectory, CancellationToken cancellationToken)
{
try
{
await using var current = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), cancellationToken).ConfigureAwait(false);
return await current.BackupAsync(backupDirectory, Keep, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex) when (ex is DatabaseException or SchemaTooNewException)
{
Log.Warning("backup", $"The index at {path} cannot be read; it is set aside whole", ex);
}
Directory.CreateDirectory(backupDirectory);
var target = Path.Combine(backupDirectory, string.Create(CultureInfo.InvariantCulture,
$"{Path.GetFileNameWithoutExtension(path)}-replaced-{DateTime.UtcNow:yyyyMMdd-HHmmss-fff}.db"));
// Copied, not moved: should the swap fail, the index stays where the next start looks for it.
File.Copy(path, target);
// SQLite finds a WAL by the database's name: copied alongside, the file set aside keeps its last transactions.
if (File.Exists(path + "-wal")) File.Copy(path + "-wal", target + "-wal");
return target;
}
/// <summary><c>PRAGMA quick_check</c> of the SQLite file at <paramref name="path"/>, opened without migrating it.</summary>
/// <exception cref="InvalidDataException">The check reported damage.</exception>
/// <exception cref="DatabaseException">The file is not a database SQLite can read.</exception>
private static async Task CheckIntegrityAsync(string path, CancellationToken cancellationToken)
{
await using var database = DatabaseFactory.Open(DatabaseOptions.Sqlite(path));
await using var session = await database.OpenAsync(cancellationToken).ConfigureAwait(false);
var result = await session.ScalarAsync<string>("PRAGMA quick_check", [], cancellationToken).ConfigureAwait(false);
if (result != "ok") throw new InvalidDataException($"The copy failed its integrity check: {result}");
}
[GeneratedRegex(@"^(?<stem>.+)-(?<at>\d{8}-\d{6}-\d{3})\.db$", RegexOptions.CultureInvariant)]
private static partial Regex Stamp();
}
+7 -2
View File
@@ -66,7 +66,8 @@ public static class ArchiveEndpoints
/// <summary>
/// Writes the name, templates and proxy policy into the archive's <c>archive.json</c> through the archive engine (so a
/// restart and the proxy jobs see them), then into the index. 503 <c>archive_offline</c> while the archive cannot be
/// written; 409 <c>sequence_busy</c> while another process holds its settings.
/// written; 409 <c>archive_busy</c> while another process holds its settings; 409 <c>archive_manifest</c> when its
/// archive.json is damaged, written by a newer Titano or of another archive (nothing is written).
/// </summary>
private static async Task<IResult> UpdateAsync(HttpContext context, Caller caller, ArchiveSettingsDto request, TitanoDatabase db, ServerArchive archive,
[FromServices] ArchiveService? archives, AuditLog audit)
@@ -92,7 +93,11 @@ public static class ArchiveEndpoints
}
catch (LeaseUnavailableException)
{
return ApiErrors.Conflict(context, "sequence_busy");
return ApiErrors.Conflict(context, "archive_busy");
}
catch (Exception ex) when (ex is InvalidDataException or NewerFormatException)
{
return ApiErrors.Conflict(context, "archive_manifest");
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
@@ -50,4 +50,47 @@ public sealed class AppServicesTests
environment.DeleteCaptureData();
}
}
/// <summary>BRIEF §6.2: a restore staged in Settings › Advanced recovers an index that no longer opens.</summary>
[Test]
[WindowsOnly]
public void AStagedRestoreRecoversAnIndexThatNoLongerOpens()
{
var environment = AppEnvironment.ForCapture();
try
{
SingleThreadedContext.Run(async () =>
{
await using (var db = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(environment.DatabasePath)))
{
await db.Archives.UpsertAsync(new Archive { Id = Guid.CreateVersion7(), Name = "Kept", RootPath = @"C:\Kept", Created = DateTimeOffset.UtcNow });
var backup = await db.BackupAsync(environment.BackupDirectory, DatabaseBackups.Keep);
await DatabaseBackups.StageRestoreAsync(backup, environment.DatabasePath);
}
// The index is damaged beyond opening ("file is not a database").
File.Delete(environment.DatabasePath + "-wal");
File.Delete(environment.DatabasePath + "-shm");
await File.WriteAllBytesAsync(environment.DatabasePath, [.. Enumerable.Repeat((byte)0x5A, 8192)]);
var services = new AppServices(environment, new AppSettings { Language = "en" }, () => { }, new NoDialogs());
try
{
await services.OpenAsync(environment.DatabasePath);
Assert.Null(services.OpenError);
Assert.Equal(StagedRestoreResult.Restored, services.StagedRestore);
Assert.SequenceEqual(["Kept"], (await services.Database!.Archives.ListAsync()).Select(a => a.Name));
Assert.False(DatabaseBackups.HasStagedRestore(environment.DatabasePath));
}
finally
{
Assert.True(services.DisposeAsync().AsTask().Wait(TimeSpan.FromSeconds(10)), "services stopped");
}
});
}
finally
{
environment.DeleteCaptureData();
}
}
}
@@ -181,27 +181,35 @@ public sealed class SettingsLogicTests
var settings = new Titano.App.Infrastructure.AppSettings { Quality = Titano.App.Infrastructure.QualityProfile.Best, Parallelism = 3, MemoryBudgetGb = 6 };
var basis = new Titano.Data.Processing.ProcessingOptions();
// Three jobs at once share the 6 GB: 2 GB each; the user's 3 also caps the decodes and the analysis threads.
var best = ProcessingTuning.Apply(basis, settings, 64L << 30, 16, @"C:\cache");
Assert.Equal((6L << 30, @"C:\cache", 8, 2), (best.FrameWindow.MemoryBudget, best.FrameWindow.SpillDirectory, best.FrameWindow.Ahead, best.FrameWindow.MaxConcurrentLoads));
Assert.Equal((2L << 30, @"C:\cache", 8, 2), (best.FrameWindow.MemoryBudget, best.FrameWindow.SpillDirectory, best.FrameWindow.Ahead, best.FrameWindow.MaxConcurrentLoads));
Assert.Equal((1024, Titano.Core.Project.FlowQualitySetting.Best), (best.Render.AnalysisLongEdge, best.Render.DefaultFlowQuality));
Assert.Equal(int.Min(3, Titano.Core.Analysis.Deep.DeepAnalysisOptions.Default.MaxDegreeOfParallelism), best.DeepAnalysis.MaxDegreeOfParallelism);
settings.Parallelism = 1;
var single = ProcessingTuning.Apply(basis, settings, 64L << 30, 16, @"C:\cache");
Assert.Equal((6L << 30, 1, 1), (single.FrameWindow.MemoryBudget, single.FrameWindow.MaxConcurrentLoads, single.DeepAnalysis.MaxDegreeOfParallelism));
// Auto: a quarter of 32 GB shared by the engine's 8 workers on 16 cores; the jobs keep their own thread counts.
settings.Quality = Titano.App.Infrastructure.QualityProfile.Fast;
settings.MemoryBudgetGb = null;
settings.Parallelism = null;
var fast = ProcessingTuning.Apply(basis, settings, 32L << 30, 16, @"C:\cache");
Assert.Equal((8L << 30, 4), (fast.FrameWindow.MemoryBudget, fast.FrameWindow.Ahead));
Assert.Equal((1L << 30, 4), (fast.FrameWindow.MemoryBudget, fast.FrameWindow.Ahead));
Assert.Equal((basis.FrameWindow.MaxConcurrentLoads, basis.DeepAnalysis.MaxDegreeOfParallelism), (fast.FrameWindow.MaxConcurrentLoads, fast.DeepAnalysis.MaxDegreeOfParallelism));
Assert.Equal((256, Titano.Core.Project.FlowQualitySetting.Draft), (fast.Render.AnalysisLongEdge, fast.Render.DefaultFlowQuality));
Assert.Equal(512, ProcessingTuning.PreparationLongEdge(Titano.App.Infrastructure.QualityProfile.Balanced));
}
[Test]
public void ParallelismAutoLeavesFourCoresToTheInterface()
public void ParallelismAutoIsTheJobEnginesDefault()
{
Assert.Equal(12, ProcessingTuning.ParallelismAuto(16));
Assert.Equal(1, ProcessingTuning.ParallelismAuto(4));
Assert.Equal(1, ProcessingTuning.ParallelismAuto(2));
Assert.Equal(12, ProcessingTuning.Parallelism(new Titano.App.Infrastructure.AppSettings(), 16));
// BRIEF §14.6: workers default to half the cores; a 4-core laptop keeps two, so a long render never blocks a scan.
Assert.Equal(8, ProcessingTuning.ParallelismAuto(16));
Assert.Equal(2, ProcessingTuning.ParallelismAuto(4));
Assert.Equal(1, ProcessingTuning.ParallelismAuto(1));
Assert.Equal(new Titano.Data.Jobs.JobEngineOptions().Workers, ProcessingTuning.ParallelismAuto(Environment.ProcessorCount));
Assert.Equal(8, ProcessingTuning.Parallelism(new Titano.App.Infrastructure.AppSettings(), 16));
Assert.Equal(5, ProcessingTuning.Parallelism(new Titano.App.Infrastructure.AppSettings { Parallelism = 5 }, 16));
}
@@ -249,6 +257,18 @@ public sealed class SettingsLogicTests
Assert.Null((new Titano.App.Infrastructure.AppSettings().ArchiveDefaults() with { Name = "Archive" }).Problem());
}
[Test]
public void TheArchiveRowsEditOnlyTheArchiveAtTheArchiveFolder()
{
var main = new Titano.Core.Model.Archive { Id = Guid.CreateVersion7(), Name = "Main", RootPath = "/archive", Created = DateTimeOffset.UtcNow };
var travel = new Titano.Core.Model.Archive { Id = Guid.CreateVersion7(), Name = "Travel", RootPath = "/media/travel", Created = DateTimeOffset.UtcNow };
Assert.Equal(travel.Id, Titano.App.Archiving.CurrentArchive.At([main, travel], "/media/travel/")!.Id);
// A folder no archive of the index is at: no archive at all, never the first one (its archive.json is someone else's).
Assert.Null(Titano.App.Archiving.CurrentArchive.At([main, travel], "/media/new"));
Assert.Equal(main.Id, Titano.App.Archiving.CurrentArchive.Pick([main, travel], "/media/new")!.Id);
}
[Test]
public void SettingsSurviveARoundTripWithTheNewSections()
{
@@ -117,6 +117,22 @@ public sealed class SettingsScreenSmokeTests
await WaitAsync(() => Titano.Core.Archiving.ManifestStore.ReadArchive(manifestPath).ThumbnailPolicy.LongEdge == 480, "written into archive.json");
Assert.Equal(480, shell.Services.Settings.ThumbnailLongEdge);
// A proxy size the admin panel set (3840 is none of the presets) is shown as it is, not as 1920.
manifest = Titano.Core.Archiving.ManifestStore.ReadArchive(manifestPath);
Titano.Core.Archiving.ManifestStore.WriteArchive(manifestPath, manifest with { ProxyPolicy = manifest.ProxyPolicy with { LongEdge = 3840 } });
shell.Navigate(SectionKey.Library);
shell.Navigate(SectionKey.Settings);
await WaitAsync(() => settings.SelectedProxySize.Value == 3840, "the archive's own proxy size is shown");
Assert.Equal("3840", settings.SelectedProxySize.Label);
Assert.SequenceEqual([1280, 1920, 2560, 3840, Titano.Core.Archiving.ProxyPolicy.FullSize, Titano.Core.Archiving.ProxyPolicy.Disabled],
settings.ProxySizes.Select(s => s.Value));
// Reset section on Archive changes the archive everyone shares: it asks first, and a "no" leaves archive.json alone.
settings.ResetSectionCommand.Execute(null);
Assert.Equal((480, 3840), (Titano.Core.Archiving.ManifestStore.ReadArchive(manifestPath).ThumbnailPolicy.LongEdge,
Titano.Core.Archiving.ManifestStore.ReadArchive(manifestPath).ProxyPolicy.LongEdge));
Assert.Equal(480, settings.SelectedThumbnailSize.Value);
// Import: the defaults of new cards.
settings.Page = SettingsPage.Import;
await app.ExpectAsync<SettingsView>("settings-import");
@@ -62,6 +62,25 @@ public sealed class ArchiveSettingsTests(TestContext context)
Assert.Equal("{date}_{n:0000}", (string)written["layoutTemplates"]!["file"]!);
}
[Test]
public async Task AnArchiveWhoseFileHasNoUsableNameCanStillBeEdited()
{
await using var fx = await ArchiveFixture.CreateAsync(context);
var folder = Path.GetFileName(fx.Paths.Root);
// Archives made at a drive root before names were checked carry an empty name; others one over the limit.
foreach (var (stored, expected) in new[] { (string.Empty, folder), (new string('n', ArchiveSettings.MaxNameLength + 20), new string('n', ArchiveSettings.MaxNameLength)) })
{
var json = JsonNode.Parse(await File.ReadAllTextAsync(fx.Paths.ManifestPath, fx.Ct))!.AsObject();
json["name"] = stored;
await File.WriteAllTextAsync(fx.Paths.ManifestPath, json.ToJsonString(), fx.Ct);
var updated = await fx.Service.UpdateSettingsAsync(fx.Archive.Id, s => s with { Templates = s.Templates with { File = "{date}_{n:0000}" } }, fx.Ct);
Assert.Equal((expected, "{date}_{n:0000}"), (updated.Name, updated.FileTemplate));
Assert.Equal(expected, ManifestStore.ReadArchive(fx.Paths.ManifestPath).Name);
}
}
[Test]
public async Task InvalidSettingsAreRefusedAndNothingIsWritten()
{
@@ -6,7 +6,8 @@ namespace Titano.Data.Tests.Sqlite;
/// <summary>
/// BRIEF §6.2: a VACUUM INTO copy of the SQLite index once a day, the newest three kept, and a restore from Settings ›
/// Advanced that waits for the next start, checks the copy first and never replaces a working index with a broken one.
/// Advanced that waits for the next start, runs before the index opens (so it recovers one that no longer opens), checks
/// the copy first (quick_check included) and never replaces a working index with a broken one.
/// </summary>
[Category("sqlite")]
public sealed class DatabaseBackupsTests(TestContext context)
@@ -106,50 +107,127 @@ public sealed class DatabaseBackupsTests(TestContext context)
Assert.True(DatabaseBackups.HasStagedRestore(path));
await db.DisposeAsync();
// The next start: the index as it was is copied first, then it is the chosen copy and the staged file is gone.
// The next start, before the index opens: the index as it was is copied first, then it is the chosen copy and
// the staged file is gone (consumed by the swap, so it can never be applied twice).
Assert.True(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation));
await using var reopened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation);
Assert.True(await DatabaseBackups.RestoreStagedAsync(reopened, directory, context.Cancellation));
Assert.SequenceEqual(["kept"], (await reopened.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
Assert.False(DatabaseBackups.HasStagedRestore(path));
var copies = DatabaseBackups.List(directory, path);
Assert.Count(2, copies);
var replaced = await DatabaseBackups.SummarizeBackupAsync(copies[0].Path, context.CreateTempDirectory("scratch"), context.Cancellation);
Assert.Equal(2, replaced.Archives);
Assert.False(await DatabaseBackups.RestoreStagedAsync(reopened, directory, context.Cancellation), "nothing staged any more");
Assert.False(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation), "nothing staged any more");
}
[Test]
public async Task AStagedRestoreRecoversAnIndexThatNoLongerOpens()
{
var (db, path) = await OpenAsync();
var directory = context.CreateTempDirectory("backups");
await AddArchiveAsync(db, "kept");
await db.BackupAsync(directory, DatabaseBackups.Keep, context.Cancellation);
var newest = await db.BackupAsync(directory, DatabaseBackups.Keep, context.Cancellation);
var daily = DatabaseBackups.List(directory, path).Select(b => b.Path).ToList();
await DatabaseBackups.StageRestoreAsync(newest, path, context.Cancellation);
await db.DisposeAsync();
// The index is damaged beyond opening ("file is not a database").
File.Delete(path + "-wal");
File.Delete(path + "-shm");
var garbage = new byte[16384];
new Random(7).NextBytes(garbage);
await File.WriteAllBytesAsync(path, garbage, context.Cancellation);
await Assert.ThrowsAsync<DatabaseException>(async () => await (await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation)).DisposeAsync());
Assert.True(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation));
await using var reopened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation);
Assert.SequenceEqual(["kept"], (await reopened.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
Assert.False(DatabaseBackups.HasStagedRestore(path));
// The damaged index is kept whole beside the daily copies, outside their rotation: none of them was pushed out.
Assert.SequenceEqual(daily, DatabaseBackups.List(directory, path).Select(b => b.Path));
var aside = Assert.Contains(Directory.GetFiles(directory), f => Path.GetFileName(f).StartsWith("titano-replaced-", StringComparison.Ordinal));
Assert.SequenceEqual(garbage, await File.ReadAllBytesAsync(aside, context.Cancellation));
}
[Test]
public async Task ABrokenStagedCopyIsSetAsideAndTheIndexKept()
{
var (db, path) = await OpenAsync();
await using var _ = db;
await AddArchiveAsync(db, "current");
await db.DisposeAsync();
await File.WriteAllTextAsync(DatabaseBackups.StagedPath(path), "this is not a database", context.Cancellation);
var backups = context.CreateTempDirectory("backups");
await Assert.ThrowsAsync<InvalidDataException>(() => DatabaseBackups.RestoreStagedAsync(db, backups, context.Cancellation));
await Assert.ThrowsAsync<InvalidDataException>(() => DatabaseBackups.RestoreStagedAsync(path, backups, context.Cancellation));
Assert.False(DatabaseBackups.HasStagedRestore(path));
Assert.FileExists(DatabaseBackups.StagedPath(path) + ".failed");
Assert.Empty(DatabaseBackups.List(backups, path));
Assert.SequenceEqual(["current"], (await db.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
Assert.Empty(Directory.GetFiles(backups));
await using var reopened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation);
Assert.SequenceEqual(["current"], (await reopened.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
await Assert.ThrowsAsync<InvalidDataException>(() =>
DatabaseBackups.SummarizeBackupAsync(DatabaseBackups.StagedPath(path) + ".failed", context.CreateTempDirectory("scratch"), context.Cancellation));
}
[Test]
public async Task AStagedCopyThatFailsItsIntegrityCheckIsSetAsideBeforeAnyCopyIsMade()
{
var (db, path) = await OpenAsync();
var directory = context.CreateTempDirectory("backups");
await AddArchiveAsync(db, "current");
// A table the summary never reads, filled so its pages come last in a VACUUM INTO copy.
await using (var session = await db.Database.OpenAsync(context.Cancellation))
{
await session.ExecuteScriptAsync("""
CREATE TABLE filler (id INTEGER PRIMARY KEY, data BLOB);
WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 200) INSERT INTO filler (data) SELECT randomblob(1000) FROM n;
""", context.Cancellation);
}
for (var i = 0; i < DatabaseBackups.Keep; i++) await db.BackupAsync(directory, DatabaseBackups.Keep, context.Cancellation);
var daily = DatabaseBackups.List(directory, path).Select(b => b.Path).ToList();
await db.DisposeAsync();
// One damaged page in the filler table of the copy: the header, the schema and every counted table are intact.
var damaged = Path.Combine(context.CreateTempDirectory("damaged"), "copy.db");
File.Copy(daily[0], damaged);
var bytes = await File.ReadAllBytesAsync(damaged, context.Cancellation);
var pageSize = (bytes[16] << 8) | bytes[17];
if (pageSize == 1) pageSize = 65536;
bytes[bytes.Length - pageSize] = 0xFF;
await File.WriteAllBytesAsync(damaged, bytes, context.Cancellation);
// Opening, migrating and counting do not notice it: only quick_check does.
var probe = Path.Combine(context.CreateTempDirectory("probe"), "titano.db");
File.Copy(damaged, probe);
await using (var opened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(probe), context.Cancellation))
Assert.Equal(1, (await DatabaseBackups.SummarizeAsync(opened, context.Cancellation)).Archives);
await Assert.ThrowsAsync<InvalidDataException>(() => DatabaseBackups.SummarizeBackupAsync(damaged, context.CreateTempDirectory("scratch"), context.Cancellation));
await DatabaseBackups.StageRestoreAsync(damaged, path, context.Cancellation);
await Assert.ThrowsAsync<InvalidDataException>(() => DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation));
Assert.False(DatabaseBackups.HasStagedRestore(path), "set aside: the next start neither retries it nor makes another copy");
Assert.FileExists(DatabaseBackups.StagedPath(path) + ".failed");
Assert.SequenceEqual(daily, DatabaseBackups.List(directory, path).Select(b => b.Path));
Assert.False(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation));
await using var reopened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation);
Assert.SequenceEqual(["current"], (await reopened.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
}
[Test]
public async Task CancellingAStagedRestoreKeepsTheIndex()
{
var (db, path) = await OpenAsync();
await using var _ = db;
var directory = context.CreateTempDirectory("backups");
var backup = await db.BackupAsync(directory, DatabaseBackups.Keep, context.Cancellation);
await DatabaseBackups.StageRestoreAsync(backup, path, context.Cancellation);
await db.DisposeAsync();
DatabaseBackups.CancelStagedRestore(path);
Assert.False(DatabaseBackups.HasStagedRestore(path));
Assert.False(await DatabaseBackups.RestoreStagedAsync(db, directory, context.Cancellation));
Assert.False(await DatabaseBackups.RestoreStagedAsync(path, directory, context.Cancellation));
Assert.FileExists(backup);
}
@@ -157,17 +235,18 @@ public sealed class DatabaseBackupsTests(TestContext context)
public async Task ARestoreWaitsWhenTheIndexCannotBeBackedUpFirst()
{
var (db, path) = await OpenAsync();
await using var _ = db;
var backup = await db.BackupAsync(context.CreateTempDirectory("backups"), DatabaseBackups.Keep, context.Cancellation);
await AddArchiveAsync(db, "since the backup");
await DatabaseBackups.StageRestoreAsync(backup, path, context.Cancellation);
await db.DisposeAsync();
// The backups folder cannot be created: a file is in its way.
var blocked = Path.Combine(context.CreateTempDirectory("blocked"), "backups");
await File.WriteAllTextAsync(blocked, "not a folder", context.Cancellation);
await Assert.ThrowsAsync<IOException>(() => DatabaseBackups.RestoreStagedAsync(db, blocked, context.Cancellation));
await Assert.ThrowsAsync<IOException>(() => DatabaseBackups.RestoreStagedAsync(path, blocked, context.Cancellation));
Assert.SequenceEqual(["since the backup"], (await db.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
Assert.True(DatabaseBackups.HasStagedRestore(path), "the restore stays staged for the next start");
await using var reopened = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(path), context.Cancellation);
Assert.SequenceEqual(["since the backup"], (await reopened.Archives.ListAsync(context.Cancellation)).Select(a => a.Name));
}
}
@@ -163,5 +163,19 @@ public sealed class AdminTests(TestContext context)
File.Move(path + ".away", path);
}
Assert.Equal(-1, Titano.Core.Archiving.ManifestStore.ReadArchive(path).ProxyPolicy.LongEdge);
// A damaged archive.json is reported as such (not as an internal error) and left as it is.
var saved = await File.ReadAllBytesAsync(path, context.Cancellation);
await File.WriteAllTextAsync(path, "{ not json", context.Cancellation);
try
{
using var damaged = await admin.PutAsJsonAsync("/api/v1/archive/settings", changed with { ProxyLongEdge = 1280 }, ProtocolJson.Default.ArchiveSettingsDto);
await damaged.ExpectErrorAsync(HttpStatusCode.Conflict, "archive_manifest");
Assert.Equal("{ not json", await File.ReadAllTextAsync(path, context.Cancellation));
}
finally
{
await File.WriteAllBytesAsync(path, saved, context.Cancellation);
}
}
}