diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..767471fe --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +**/bin/ +**/obj/ +artifacts/ +out/ +publish/ +tests/ +docs/ +.git/ +.github/ +**/*.user diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..065e082f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{csproj,props,targets,slnx,xml,resx,xaml,json,yml,yaml,svg}] +indent_size = 2 + +[*.{js,css,html}] +indent_size = 2 + +[*.cs] +csharp_style_namespace_declarations = file_scoped:warning +csharp_using_directive_placement = outside_namespace +dotnet_sort_system_directives_first = true +csharp_prefer_braces = when_multiline:suggestion +csharp_style_var_for_built_in_types = true:silent +csharp_style_var_when_type_is_apparent = true:silent +csharp_style_expression_bodied_methods = when_on_single_line:silent +csharp_new_line_before_open_brace = all +dotnet_style_qualification_for_field = false:suggestion +dotnet_naming_rule.private_fields_underscore.symbols = private_fields +dotnet_naming_rule.private_fields_underscore.style = underscore_camel +dotnet_naming_rule.private_fields_underscore.severity = suggestion +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private +dotnet_naming_style.underscore_camel.required_prefix = _ +dotnet_naming_style.underscore_camel.capitalization = camel_case + +# Interop and codec code legitimately uses these patterns. +dotnet_diagnostic.CA1416.severity = warning +dotnet_diagnostic.CA2101.severity = none +dotnet_diagnostic.SYSLIB1054.severity = none +dotnet_diagnostic.CA1401.severity = none diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..ee132e42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Normalise to LF everywhere (matches .editorconfig); Windows checkouts keep LF. +* text=auto eol=lf + +*.png binary +*.jpg binary +*.jpeg binary +*.ico binary +*.dng binary +*.tif binary +*.tiff binary +*.cr2 binary +*.cr3 binary +*.nef binary +*.arw binary +*.raf binary +*.heic binary +*.webp binary +*.gif binary +*.mp4 binary +*.avi binary +*.zip binary +*.pfx binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..926ad0c4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,248 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +env: + DOTNET_NOLOGO: "1" + DOTNET_CLI_TELEMETRY_OPTOUT: "1" + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" + TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll + +jobs: + build: + name: Build and test (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + - name: .NET info + run: dotnet --info + + - name: Restore fixtures cache + uses: actions/cache@v4 + with: + path: tests/fixtures/external + key: fixtures-${{ hashFiles('tests/fixtures/manifest.json') }} + + - name: Build (warnings are errors) + run: dotnet build Titano.slnx -c Release + + - name: Zero-package guard + run: dotnet "$TOOLS" package-guard + + - name: Localization check + run: dotnet "$TOOLS" i18n check + + - name: XAML lint + run: dotnet "$TOOLS" xaml-lint + + - name: Format check + if: runner.os == 'Windows' + run: dotnet format whitespace Titano.slnx --verify-no-changes + + - name: Fetch CC0 fixtures + continue-on-error: true + run: | + if dotnet "$TOOLS" --help | grep -q '^ fixtures'; then dotnet "$TOOLS" fixtures; fi + + - name: Test · Core + run: dotnet run --project tests/Titano.Core.Tests -c Release --no-build -- --junit out/junit/core.xml + + - name: Test · Data (SQLite) + run: dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --junit out/junit/data.xml + + - name: Test · Server + run: dotnet run --project tests/Titano.Server.Tests -c Release --no-build -- --junit out/junit/server.xml + + - name: Test · Core.Windows + if: runner.os == 'Windows' + run: dotnet run --project tests/Titano.Core.Windows.Tests -c Release --no-build -- --junit out/junit/core-windows.xml + + - name: Test · App + if: runner.os == 'Windows' + run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml + + - name: Screenshots + if: runner.os == 'Windows' + run: | + set +e + for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do + name=$(basename "$exe" .exe) + before=$(ls out/screenshots/*.png 2>/dev/null | wc -l) + "$exe" --capture out/screenshots 2> "out/capture-$name.log" & + wait $! + code=$? + cat "out/capture-$name.log" + count=$(( $(ls out/screenshots/*.png 2>/dev/null | wc -l) - before )) + echo "$name capture exit code $code, $count screenshot(s)" + if [ "$count" -eq 0 ]; then echo "::warning title=Screenshots::$name --capture produced no images (exit $code)"; fi + done + + - name: Publish desktop programs (win-x64, self-contained single file) + if: runner.os == 'Windows' + run: | + for p in Titano.App Titano.Uploader; do + dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained \ + -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true \ + -o "out/publish/$p" + done + dotnet publish src/Titano.Server/Titano.Server.csproj -c Release -r win-x64 --self-contained \ + -p:PublishSingleFile=true -o out/publish/Titano.Server + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-${{ matrix.os }} + path: out/junit/ + if-no-files-found: ignore + + - name: Upload screenshots + if: runner.os == 'Windows' && always() + uses: actions/upload-artifact@v4 + with: + name: screenshots + path: out/screenshots/ + if-no-files-found: ignore + + - name: Upload Windows programs + if: runner.os == 'Windows' + uses: actions/upload-artifact@v4 + with: + name: titano-win-x64-${{ github.sha }} + path: out/publish/ + retention-days: 14 + + screenshots: + name: Screenshots branch + # Same-repository pull requests only: forks never get a writable token. + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + name: screenshots + path: screenshots + - name: Publish to the ci-screenshots branch (one commit, overwritten each run) + working-directory: screenshots + run: | + git init -q -b ci-screenshots + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -q -m "Screenshots of ${{ github.event.pull_request.head.sha }}" + git push -q -f "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:refs/heads/ci-screenshots + + postgres: + name: PostgreSQL ${{ matrix.pg }} integration + strategy: + fail-fast: false + matrix: + pg: ["16", "17"] + runs-on: ubuntu-latest + services: + postgres: + image: postgres:${{ matrix.pg }} + env: + POSTGRES_USER: titano + POSTGRES_PASSWORD: titano-ci + POSTGRES_DB: titano_test + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U titano -d titano_test" + --health-interval 5s --health-timeout 5s --health-retries 20 + env: + TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=titano-ci;SslMode=disable + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + - name: Test · Data (PostgreSQL) + run: dotnet run --project tests/Titano.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml + - name: Test · Server (PostgreSQL) + run: dotnet run --project tests/Titano.Server.Tests -c Release -- --junit out/junit/server-pg${{ matrix.pg }}.xml + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-pg${{ matrix.pg }} + path: out/junit/ + if-no-files-found: ignore + + docker: + name: Docker image + runs-on: ubuntu-latest + services: + postgres: + image: postgres:17 + env: + POSTGRES_USER: titano + POSTGRES_PASSWORD: titano-ci + POSTGRES_DB: titano + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U titano -d titano" + --health-interval 5s --health-timeout 5s --health-retries 20 + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: Build image + uses: docker/build-push-action@v6 + with: + context: . + file: deploy/docker/Dockerfile + platforms: linux/amd64 + load: true + push: false + tags: titano-server:ci + build-args: TITANO_VERSION=0.0.0-ci + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Smoke test (/health) + run: | + mkdir -p "$RUNNER_TEMP/archive" "$RUNNER_TEMP/data" + docker run -d --name titano --network host \ + -e TITANO_DB_HOST=127.0.0.1 -e TITANO_DB_USER=titano -e TITANO_DB_PASSWORD=titano-ci -e TITANO_DB_NAME=titano \ + -e TITANO_ADMIN_USER=admin -e TITANO_ADMIN_PASSWORD=ci-password-1234 \ + -e PUID="$(id -u)" -e PGID="$(id -g)" \ + -v "$RUNNER_TEMP/archive:/archive" -v "$RUNNER_TEMP/data:/data" titano-server:ci + for i in $(seq 1 60); do + if curl -fsS http://127.0.0.1:8080/health; then echo; break; fi + sleep 2 + done + curl -fsS http://127.0.0.1:8080/api/v1/server/info + curl -fsSk https://127.0.0.1:8443/health + test "$(docker inspect --format '{{.State.Running}}' titano)" = "true" + - name: Container logs + if: always() + run: docker logs titano || true diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..3079bf87 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,37 @@ +name: Nightly image + +on: + schedule: + - cron: "17 2 * * *" + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + nightly: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Image name + id: image + run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT" + - uses: docker/build-push-action@v6 + with: + context: . + file: deploy/docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.image.outputs.name }}:nightly + build-args: TITANO_VERSION=0.0.0-nightly.${{ github.run_number }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..03ecd78e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,206 @@ +name: Release + +on: + push: + tags: ["v*"] + workflow_dispatch: + inputs: + tag: + description: "Existing tag to (re)publish, e.g. v0.2.0" + required: true + +permissions: + contents: write + packages: write + +env: + DOTNET_NOLOGO: "1" + DOTNET_CLI_TELEMETRY_OPTOUT: "1" + # Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO variable. + RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }} + +jobs: + version: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.v.outputs.tag }} + version: ${{ steps.v.outputs.version }} + prerelease: ${{ steps.v.outputs.prerelease }} + steps: + - id: v + run: | + tag="${{ github.event.inputs.tag || github.ref_name }}" + version="${tag#v}" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + echo "version=$version" >> "$GITHUB_OUTPUT" + if [[ "$version" == *-* ]]; then echo "prerelease=true" >> "$GITHUB_OUTPUT"; else echo "prerelease=false" >> "$GITHUB_OUTPUT"; fi + + windows: + needs: version + runs-on: windows-latest + defaults: + run: + shell: bash + env: + VERSION: ${{ needs.version.outputs.version }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.version.outputs.tag }} + fetch-depth: 0 + - uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + - name: Build and test + run: | + dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION" + for t in Core Data Server Core.Windows App; do + dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml" + done + + - name: Publish self-contained programs + run: | + common="-c Release -r win-x64 --self-contained -p:TitanoVersion=$VERSION -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none" + dotnet publish src/Titano.App/Titano.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app + dotnet publish src/Titano.Uploader/Titano.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader + dotnet publish src/Titano.Server/Titano.Server.csproj $common -o out/publish/server + dotnet publish src/Titano.Setup/Titano.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup + + - name: Sign binaries + if: env.SIGN_PFX != '' + env: + SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} + SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} + shell: pwsh + run: | + $pfx = Join-Path $env:RUNNER_TEMP "sign.pfx" + [IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX)) + $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1 + Get-ChildItem out/publish -Recurse -Include *.exe | ForEach-Object { + & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName + if ($LASTEXITCODE -ne 0) { throw "signtool failed for $($_.FullName)" } + } + Remove-Item $pfx + + - name: Package installers and archives + run: | + mkdir -p out/release + tools=src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll + dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product Titano \ + --component "Titano=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \ + --version "$VERSION" --out "out/release/Titano-Setup-$VERSION.exe" + dotnet "$tools" pack-installer --setup out/publish/setup/Titano.Setup.exe --product "Titano Uploader" \ + --component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Titano-Uploader-Setup-$VERSION.exe" + (cd out/publish/server && 7z a -tzip "../../release/Titano-Server-win-x64-$VERSION.zip" . > /dev/null) + (cd out/publish/app && 7z a -tzip "../../release/Titano-win-x64-portable-$VERSION.zip" . > /dev/null) + + - name: Sign installers + if: env.SIGN_PFX != '' + env: + SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} + SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} + shell: pwsh + run: | + $pfx = Join-Path $env:RUNNER_TEMP "sign.pfx" + [IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX)) + $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1 + Get-ChildItem out/release -Filter *.exe | ForEach-Object { & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName } + Remove-Item $pfx + + - name: Release notes + run: | + tag="${{ needs.version.outputs.tag }}" + previous="$(git describe --tags --abbrev=0 "$tag^" 2>/dev/null || true)" + range="${previous:+$previous..}$tag" + git log --format='%h%x09%s' "$range" | dotnet src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll changelog --title "Titano ${{ needs.version.outputs.version }}" --out out/release-notes.md + + - uses: actions/upload-artifact@v4 + with: + name: release-windows + path: | + out/release/ + out/release-notes.md + + docker: + needs: version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.version.outputs.tag }} + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Image name + id: image + run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT" + - uses: docker/build-push-action@v6 + with: + context: . + file: deploy/docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + build-args: TITANO_VERSION=${{ needs.version.outputs.version }} + tags: | + ${{ steps.image.outputs.name }}:${{ needs.version.outputs.version }} + ${{ needs.version.outputs.prerelease == 'false' && format('{0}:latest', steps.image.outputs.name) || '' }} + cache-from: type=gha + cache-to: type=gha,mode=max + + publish: + needs: [version, windows, docker] + runs-on: ubuntu-latest + env: + TAG: ${{ needs.version.outputs.tag }} + VERSION: ${{ needs.version.outputs.version }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.version.outputs.tag }} + - uses: actions/download-artifact@v4 + with: + name: release-windows + path: out + - name: Checksums + run: | + cd out/release + sha256sum * > SHA256SUMS + cat SHA256SUMS + + - name: Create release in the public releases repository + if: env.RELEASES_TOKEN != '' + env: + RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }} + GH_TOKEN: ${{ secrets.RELEASES_TOKEN }} + run: | + flags="" + if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi + gh release create "$TAG" out/release/* --repo "$RELEASES_REPO" --title "Titano $VERSION" --notes-file out/release-notes.md $flags + # Keep the Unraid template, icon and EULA in the public repository up to date. + git clone --depth 1 "https://x-access-token:${RELEASES_TOKEN}@github.com/${RELEASES_REPO}.git" public + mkdir -p public/unraid + cp deploy/unraid/titano.xml public/unraid/titano.xml + dotnet run --project src/Titano.Tools -c Release -- make-icon --out "$RUNNER_TEMP/icons" + cp "$RUNNER_TEMP/icons/titano-server-256.png" public/unraid/titano-server.png + if [ -f docs/legal/EULA.md ]; then cp docs/legal/EULA.md public/EULA.md; fi + cd public + git config user.name "titano-release" + git config user.email "titano-release@users.noreply.github.com" + git add -A + git diff --cached --quiet || git commit -m "chore: update Unraid template and assets for $TAG" + git push + + - name: Create release in this repository (no RELEASES_TOKEN configured) + if: env.RELEASES_TOKEN == '' + env: + RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + flags="" + if [ "${{ needs.version.outputs.prerelease }}" = "true" ]; then flags="--prerelease"; fi + gh release create "$TAG" out/release/* --repo "$GITHUB_REPOSITORY" --title "Titano $VERSION" --notes-file out/release-notes.md $flags diff --git a/.gitignore b/.gitignore index d5a18dee..62b03a69 100644 --- a/.gitignore +++ b/.gitignore @@ -427,3 +427,14 @@ FodyWeavers.xsd *.msix *.msm *.msp + +# Titano +tests/fixtures/external/ +/out/ +/publish/ +/artifacts/ +*.junit.xml +TestResults/ + +# Local agent tooling +.claude/ diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..908e146a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,19 @@ +# Titano — working rules +Read docs/BRIEF.md when in doubt; it wins over these notes. +- Zero . Anything not in the .NET BCL / Microsoft shared frameworks / OS APIs is written here. +- No external processes at runtime (no ffmpeg, exiftool, powershell). Only OS dialogs listed in BRIEF §8.6. +- Titano.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. +- English identifiers, comments, commits (Conventional Commits). Prototype in docs/reference is Italian: port algorithms, not language. +- Every UI string is a resource (en source, it translation). Labels ≤ 3 words; explanations only in tooltips; every actionable control has a tooltip; no helper paragraphs. +- Destructive operations: dry-run plan first, hash verification, explicit user action. +- When the brief is silent: choose the simplest safe option, log it in docs/DECISIONS.md, continue. Ask only at phase gates or before irreversible choices. +- Definition of Done per phase: green on windows-latest + ubuntu-latest, tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". +- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Titano.Tools -- . +- Current phase and next steps: see docs/STATUS.md (update at every gate). + +## Repository specifics +- Visual target: docs/ui/DESIGN.md (tokens, controls) and docs/ui/mockups/*.html. Looks: mockup wins; behaviour: brief wins. +- Code conventions and module ownership: docs/ARCHITECTURE.md. +- Localization: keys `Area.Group.Name` in i18n/en/.resx, Italian in i18n/it/.it.resx. C# `Loc.L("Key")`, XAML `{l:Loc Key}`. +- Checks run in CI: `Titano.Tools package-guard`, `i18n check`, `xaml-lint`. +- Linux builds the Windows projects for compile checking (EnableWindowsTargeting); Windows-only tests carry [WindowsOnly]. diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..cda20b1f --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,49 @@ + + + $(MSBuildThisFileDirectory) + 0.1.0 + $(TitanoVersion) + $([System.Text.RegularExpressions.Regex]::Match($(TitanoVersion), '^\d+\.\d+\.\d+').Value).0 + $(AssemblyVersion) + $(TitanoVersion) + false + Titano + Titano + © Titano + en + + latest + enable + enable + true + true + latest + false + false + true + true + false + en;it;de;fr;es;pt-BR;pt-PT;nl;pl;cs;sk;hu;ro;sv;da;nb;fi;ru;uk;tr;el;bg;hr;sl;lt;lv;et;ja;zh-Hans;zh-Hant;ko;ar;he;hi;id;ms;vi;th + + + true + + false + true + true + false + embedded + + + + + alby96/titano-releases + + + + + + + true + + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 00000000..60f0cca3 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,42 @@ + + + + + + + + + + i18n\%(Filename)%(Extension) + + + + + + $(RepoRoot)artifacts/icons/ + + + $(TitanoIconDir)$(TitanoIconVariant).ico + + + + + + + + + + + diff --git a/Titano.slnx b/Titano.slnx new file mode 100644 index 00000000..4ba03d78 --- /dev/null +++ b/Titano.slnx @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/branding/titano-mono.svg b/branding/titano-mono.svg new file mode 100644 index 00000000..58642c70 --- /dev/null +++ b/branding/titano-mono.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branding/titano-server.svg b/branding/titano-server.svg new file mode 100644 index 00000000..7cd565b2 --- /dev/null +++ b/branding/titano-server.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branding/titano-uploader.svg b/branding/titano-uploader.svg new file mode 100644 index 00000000..31fd2675 --- /dev/null +++ b/branding/titano-uploader.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branding/titano.svg b/branding/titano.svg new file mode 100644 index 00000000..fb2f35ed --- /dev/null +++ b/branding/titano.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py new file mode 100644 index 00000000..51aa85d7 --- /dev/null +++ b/branding/ui-icons/icons.py @@ -0,0 +1,153 @@ +"""Titano UI icon set (DESIGN.md §5): 16-px grid, 1.5-px strokes, round caps/joins. +Each icon = stroke path data + optional fill path data. Generates the WPF resource dictionary +src/Titano.Ui/Icons/Icons.xaml and a preview sheet (icons.svg). Run: python3 branding/ui-icons/icons.py""" +import math, os + +def rr(x, y, w, h, r): + return (f"M{x+r} {y} H{x+w-r} A{r} {r} 0 0 1 {x+w} {y+r} V{y+h-r} A{r} {r} 0 0 1 {x+w-r} {y+h} " + f"H{x+r} A{r} {r} 0 0 1 {x} {y+h-r} V{y+r} A{r} {r} 0 0 1 {x+r} {y} Z") + +def circ(cx, cy, r): + return f"M{cx-r} {cy} A{r} {r} 0 1 0 {cx+r} {cy} A{r} {r} 0 1 0 {cx-r} {cy} Z" + +def arc(cx, cy, r, a0, a1): + """Arc clockwise from a0 to a1 degrees (0 = 12 o'clock).""" + p = lambda a: (cx + r * math.sin(math.radians(a)), cy - r * math.cos(math.radians(a))) + x0, y0 = p(a0); x1, y1 = p(a1) + large = 1 if (a1 - a0) % 360 > 180 else 0 + return f"M{x0:.2f} {y0:.2f} A{r} {r} 0 {large} 1 {x1:.2f} {y1:.2f}" + +I = {} +# Navigation +I["Library"] = (rr(1.5,1.5,5.5,5.5,1)+rr(9,1.5,5.5,5.5,1)+rr(1.5,9,5.5,5.5,1)+rr(9,9,5.5,5.5,1), None) +I["Import"] = ("M8 2V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5", None) +I["Sequence"] = ("M2 12.5 L11.5 3 L13 4.5 L3.5 14 H2 Z", None) +I["Archive"] = ("M2 4.5 H14 V13.5 H2 Z M2 2 H14 V4.5 H2 Z M6 8 H10", None) +I["Jobs"] = ("M3 8 H13 M3 4 H13 M3 12 H9", None) +I["Server"] = ("M4.5 12.5 A3 3 0 0 1 4.2 6.5 A4 4 0 0 1 11.9 5.5 A3.5 3.5 0 0 1 12.2 12.5 Z", None) +I["Settings"] = (circ(8,8,2.2)+" M8 1.5 V3.5 M8 12.5 V14.5 M1.5 8 H3.5 M12.5 8 H14.5 M3.4 3.4 L4.8 4.8 M11.2 11.2 L12.6 12.6 M3.4 12.6 L4.8 11.2 M11.2 4.8 L12.6 3.4", None) +I["About"] = (circ(8,8,6.5)+" M8 7 V11 M8 4.8 V5.2", None) +I["Menu"] = ("M2.5 4 H13.5 M2.5 8 H13.5 M2.5 12 H13.5", None) +I["Users"] = (circ(8,5,3)+" M2.5 14 A5.5 5.5 0 0 1 13.5 14", None) +I["User"] = I["Users"] +I["Logs"] = ("M3.5 1.5 H9.5 L12.5 4.5 V14.5 H3.5 Z M5.5 7 H10.5 M5.5 9.5 H10.5 M5.5 12 H8.5", None) +# Toolbar / actions +I["Search"] = (circ(7,7,4.5)+" M10.4 10.4 L14 14", None) +I["Refresh"] = (arc(8,8,5.5,30,320)+" M13.2 2.6 L13.2 5.3 L10.5 5.3", None) +I["ViewGrid"] = I["Library"] +I["ViewList"] = ("M5.5 4 H13.5 M5.5 8 H13.5 M5.5 12 H13.5 M2.5 4 H2.6 M2.5 8 H2.6 M2.5 12 H2.6", None) +I["ViewTimeline"] = ("M2 13.5 H14 M3.5 11 V8 M6 11 V5 M8.5 11 V7 M11 11 V3.5 M13.5 11 V9", None) +I["ChevronDown"] = ("M4 6 L8 10 L12 6", None) +I["ChevronUp"] = ("M4 10 L8 6 L12 10", None) +I["ChevronRight"] = ("M6 4 L10 8 L6 12", None) +I["ChevronLeft"] = ("M10 4 L6 8 L10 12", None) +I["Close"] = ("M4 4 L12 12 M12 4 L4 12", None) +I["Check"] = ("M3 8.5 L6.5 12 L13 4.5", None) +I["Back"] = ("M13 8 H3 M7 4 L3 8 L7 12", None) +I["Forward"] = ("M3 8 H13 M9 4 L13 8 L9 12", None) +I["Plus"] = ("M8 3 V13 M3 8 H13", None) +I["Minus"] = ("M3 8 H13", None) +I["More"] = (None, circ(3.5,8,1.1)+circ(8,8,1.1)+circ(12.5,8,1.1)) +I["Play"] = (None, "M4.5 2.8 L13 8 L4.5 13.2 Z") +I["Pause"] = (None, rr(4,3,2.6,10,0.8)+rr(9.4,3,2.6,10,0.8)) +I["Stop"] = (None, rr(3.5,3.5,9,9,1.5)) +I["Folder"] = ("M1.5 4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H13.5 A1 1 0 0 1 14.5 5.5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z", None) +I["FolderOpen"] = ("M1.5 12.5 V4 A1 1 0 0 1 2.5 3 H6 L7.5 4.5 H12.5 V6.5 M1.5 12.5 L3.5 7 H14.5 L12.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z", None) +I["Card"] = ("M4.5 1.5 H10 L12.5 4 V13.5 A1 1 0 0 1 11.5 14.5 H4.5 A1 1 0 0 1 3.5 13.5 V2.5 A1 1 0 0 1 4.5 1.5 Z M6 3.5 V5.5 M8 3.5 V5.5 M10 4.5 V5.5", None) +I["Drive"] = (rr(1.5,4.5,13,7,1.5)+" M4.5 8 H4.6 M7 8 H11.5", None) +I["Eject"] = ("M3 13 H13", "M8 2.8 L13 9.5 H3 Z") +I["Download"] = ("M8 2 V10 M4.5 6.5 L8 10 L11.5 6.5 M2.5 13.5 H13.5", None) +I["Upload"] = ("M8 10.5 V2.5 M4.5 6 L8 2.5 L11.5 6 M2.5 13.5 H13.5", None) +I["Sync"] = (arc(8,8,5.5,20,160)+" "+arc(8,8,5.5,200,340)+" M13.5 6.5 L13.2 9.4 L10.6 8.4 M2.5 9.5 L2.8 6.6 L5.4 7.6", None) +I["Compare"] = (rr(1.5,2.5,13,11,1.5)+" M8 1 V15", None) +I["Vectors"] = ("M2.5 12.5 L7 8 M7 8 H4.5 M7 8 V10.5 M9 7 L13.5 2.5 M13.5 2.5 H11 M13.5 2.5 V5", None) +I["Regions"] = ("M1.5 9.5 C4 8 6 10.5 8.5 9 C10.5 7.8 12.5 8.5 14.5 9.5 M1.5 13.5 H14.5 M1.5 2.5 H14.5", None) +I["CropMask"] = ("M4 1.5 V12 H14.5 M1.5 4 H12 V14.5", None) +I["Fullscreen"] = ("M2 6 V2 H6 M10 2 H14 V6 M14 10 V14 H10 M6 14 H2 V10", None) +I["ActualSize"] = (rr(1.5,2.5,13,11,1.5)+" M5 6 L6 5.5 V10.5 M9.5 6 L10.5 5.5 V10.5 M8 7 V7.1 M8 9.5 V9.6", None) +I["Reset"] = (arc(8,8.5,5,300,210)+" M3.2 3.2 V6.2 H6.2", None) +I["Warning"] = ("M8 1.8 L14.8 13.8 H1.2 Z M8 6.2 V9.6 M8 11.7 V11.8", None) +I["ErrorCircle"] = (circ(8,8,6.5)+" M5.8 5.8 L10.2 10.2 M10.2 5.8 L5.8 10.2", None) +I["SuccessCircle"] = (circ(8,8,6.5)+" M5 8.3 L7.1 10.3 L11 6", None) +I["Lock"] = (rr(3,7,10,7.5,1.5)+" M5.5 7 V5 A2.5 2.5 0 0 1 10.5 5 V7", None) +I["Key"] = (circ(5,10.5,3)+" M7.2 8.3 L13.5 2 M11.5 4 L13 5.5 M9.8 5.7 L11 6.9", None) +I["Power"] = ("M8 1.8 V7.5 "+arc(8,8.8,5.5,40,320), None) +I["Moon"] = ("M9.5 1.8 A6.5 6.5 0 1 0 14.2 11.2 A5.5 5.5 0 0 1 9.5 1.8 Z", None) +I["Sun"] = (circ(8,8,3)+" M8 1 V2.5 M8 13.5 V15 M1 8 H2.5 M13.5 8 H15 M3 3 L4 4 M12 12 L13 13 M3 13 L4 12 M12 4 L13 3", None) +I["Star"] = ("M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z", None) +I["StarFilled"] = (None, "M8 1.8 L9.9 5.8 L14.2 6.3 L11 9.3 L11.9 13.6 L8 11.4 L4.1 13.6 L5 9.3 L1.8 6.3 L6.1 5.8 Z") +I["Tag"] = ("M1.5 2.5 A1 1 0 0 1 2.5 1.5 H7.5 L14.5 8.5 L8.5 14.5 L1.5 7.5 Z M5 5 H5.1", None) +I["Delete"] = ("M2.5 4 H13.5 M6 4 V2.5 H10 V4 M3.8 4 L4.6 14 H11.4 L12.2 4 M6.6 6.8 V11.2 M9.4 6.8 V11.2", None) +I["Copy"] = (rr(5,5,9.5,9.5,1.5)+" M11 5 V2.5 A1 1 0 0 0 10 1.5 H2.5 A1 1 0 0 0 1.5 2.5 V10 A1 1 0 0 0 2.5 11 H5", None) +I["Link"] = ("M6.8 9.2 L9.2 6.8 M7.5 4.5 L9 3 A2.8 2.8 0 0 1 13 7 L11.5 8.5 M8.5 11.5 L7 13 A2.8 2.8 0 0 1 3 9 L4.5 7.5", None) +I["ExternalLink"] = ("M9.5 2 H14 V6.5 M14 2 L7.5 8.5 M12 9.5 V13 A1 1 0 0 1 11 14 H3 A1 1 0 0 1 2 13 V5 A1 1 0 0 1 3 4 H6.5", None) +I["Calendar"] = (rr(1.5,3,13,11.5,1.5)+" M1.5 6.5 H14.5 M5 1.5 V4 M11 1.5 V4", None) +I["Camera"] = ("M1.5 5 A1 1 0 0 1 2.5 4 H4.5 L6 2.5 H10 L11.5 4 H13.5 A1 1 0 0 1 14.5 5 V12.5 A1 1 0 0 1 13.5 13.5 H2.5 A1 1 0 0 1 1.5 12.5 Z "+circ(8,8.5,2.8), None) +I["Chart"] = ("M2 2 V14 H14 M4.5 10.5 L7.5 7 L9.5 9 L13.5 4", None) +I["Filmstrip"] = (rr(1.5,2.5,13,11,1.5)+" M4.5 2.5 V13.5 M11.5 2.5 V13.5 M1.5 6 H4.5 M1.5 10 H4.5 M11.5 6 H14.5 M11.5 10 H14.5", None) +I["Layers"] = ("M8 1.8 L14.5 5.2 L8 8.6 L1.5 5.2 Z M1.5 8.2 L8 11.6 L14.5 8.2 M1.5 11 L8 14.4 L14.5 11", None) +I["Clock"] = (circ(8,8,6.5)+" M8 4.5 V8 L10.5 9.5", None) +I["Exposure"] = (circ(8,8,6.5)+" M3.4 12.6 L12.6 3.4 M4.5 6 H7 M5.75 4.75 V7.25 M9 10 H11.5", None) +I["Motion"] = ("M1.5 8 C3.5 3 5.5 3 7.5 8 C9.5 13 11.5 13 14.5 8", None) +I["Time"] = I["Clock"] +I["Stack"] = I["Layers"] +I["Export"] = ("M8 10 V1.8 M4.8 5 L8 1.8 L11.2 5 M5 7.5 H3 A1 1 0 0 0 2 8.5 V13.5 A1 1 0 0 0 3 14.5 H13 A1 1 0 0 0 14 13.5 V8.5 A1 1 0 0 0 13 7.5 H11", None) +I["Render"] = (rr(1.5,2.5,13,11,1.5), "M6.5 5.5 L10.8 8 L6.5 10.5 Z") +I["Analyse"] = ("M1.5 8.5 H4.5 L6.5 3.5 L9.5 12.5 L11.5 8.5 H14.5", None) +I["Optimise"] = ("M7 2 L8.2 5.8 L12 7 L8.2 8.2 L7 12 L5.8 8.2 L2 7 L5.8 5.8 Z M12.5 10.5 L13 12 L14.5 12.5 L13 13 L12.5 14.5 L12 13 L10.5 12.5 L12 12 Z", None) +I["Duplicate"] = I["Copy"] +I["Verify"] = ("M8 1.5 L13.5 3.5 V7.5 C13.5 11 11 13.3 8 14.5 C5 13.3 2.5 11 2.5 7.5 V3.5 Z M5.5 8 L7.3 9.8 L10.6 6.3", None) +I["Database"] = ("M2.5 3.8 C2.5 2.5 13.5 2.5 13.5 3.8 C13.5 5.1 2.5 5.1 2.5 3.8 Z M2.5 3.8 V12.2 C2.5 13.5 13.5 13.5 13.5 12.2 V3.8 M2.5 8 C2.5 9.3 13.5 9.3 13.5 8", None) +I["Gpu"] = (rr(3.5,3.5,9,9,1.5)+" "+rr(6,6,4,4,0.5)+" M6 1.5 V3.5 M10 1.5 V3.5 M6 12.5 V14.5 M10 12.5 V14.5 M1.5 6 H3.5 M1.5 10 H3.5 M12.5 6 H14.5 M12.5 10 H14.5", None) +I["Network"] = ("M2 6 A8.5 8.5 0 0 1 14 6 M4 8.5 A5.5 5.5 0 0 1 12 8.5 M6 11 A2.6 2.6 0 0 1 10 11", circ(8,13,1.1)) +I["Sort"] = ("M5 2.5 V13.5 M2.5 11 L5 13.5 L7.5 11 M11 13.5 V2.5 M8.5 5 L11 2.5 L13.5 5", None) +I["Filter"] = ("M1.5 2.5 H14.5 L9.5 8.5 V13.5 L6.5 12 V8.5 Z", None) +I["Info"] = I["About"] +I["Image"] = (rr(1.5,2.5,13,11,1.5)+" M1.5 11 L5.5 7 L9 10.5 L11 8.5 L14.5 12", circ(10.8,5.6,1.2)) +I["Hero"] = (rr(1.5,2.5,13,11,1.5), "M8 4.8 L8.9 6.9 L11.1 7.1 L9.4 8.5 L9.9 10.7 L8 9.5 L6.1 10.7 L6.6 8.5 L4.9 7.1 L7.1 6.9 Z") +I["Exclude"] = (circ(8,8,6.5)+" M3.4 12.6 L12.6 3.4", None) +I["Eye"] = ("M1.5 8 C3.5 4 12.5 4 14.5 8 C12.5 12 3.5 12 1.5 8 Z "+circ(8,8,2.2), None) +I["Wipe"] = I["Compare"] +I["Spline"] = ("M2 13 C5 13 5 3 8 8 C11 13 11 3 14 3", circ(2,13,1.2)+circ(14,3,1.2)) +I["Keyframe"] = ("M8 2 L13 8 L8 14 L3 8 Z", None) +I["Tray"] = ("M1.5 9.5 H5 L6.5 11.5 H9.5 L11 9.5 H14.5 M1.5 9.5 L3.5 3 H12.5 L14.5 9.5 V13.5 H1.5 Z", None) +I["Window"] = (rr(1.5,2.5,13,11,1.5)+" M1.5 5.5 H14.5", None) +I["Clipboard"] = (rr(2.5,2.5,11,12,1.5)+" "+rr(5.5,1.5,5,2.5,0.8), None) +I["Cancel"] = I["ErrorCircle"] +I["Retry"] = I["Refresh"] +I["Grip"] = (None, circ(6,4,1)+circ(10,4,1)+circ(6,8,1)+circ(10,8,1)+circ(6,12,1)+circ(10,12,1)) +I["Dot"] = (None, circ(8,8,3.5)) +I["Ring"] = (circ(8,8,3.5), None) +I["HalfDot"] = (circ(8,8,3.5), "M8 4.5 A3.5 3.5 0 0 1 8 11.5 Z") +I["Triangle"] = (None, "M8 3 L13.5 12.5 H2.5 Z") +I["TriangleRight"] = (None, "M5 3 L12 8 L5 13 Z") +I["Cross"] = ("M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5", None) + +out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Titano.Ui", "Icons", "Icons.xaml") +with open(out, "w") as f: + f.write('\n') + f.write(' \n') + for name, (stroke, fill) in sorted(I.items()): + attrs = '' + if stroke: attrs += f' Stroke="{stroke}"' + if fill: attrs += f' Fill="{fill}"' + f.write(f' \n') + f.write('\n') + +cols = 10 +names = sorted(I) +rows = (len(names) + cols - 1) // cols +svg = [f''] +for k, name in enumerate(names): + x, y = (k % cols) * 90 + 37, (k // cols) * 70 + 14 + stroke, fill = I[name] + svg.append(f'') + if fill: svg.append(f'') + if stroke: svg.append(f'') + svg.append('') + svg.append(f'{name}') +svg.append('') +open(os.path.join(os.path.dirname(__file__), "icons.svg"), "w").write("\n".join(svg)) +print(len(I), "icons") diff --git a/branding/ui-icons/icons.svg b/branding/ui-icons/icons.svg new file mode 100644 index 00000000..a63e85c2 --- /dev/null +++ b/branding/ui-icons/icons.svg @@ -0,0 +1,417 @@ + + + + +About + + + +ActualSize + + + +Analyse + + + +Archive + + + +Back + + + +Calendar + + + +Camera + + + +Cancel + + + +Card + + + +Chart + + + +Check + + + +ChevronDown + + + +ChevronLeft + + + +ChevronRight + + + +ChevronUp + + + +Clipboard + + + +Clock + + + +Close + + + +Compare + + + +Copy + + + +CropMask + + + +Cross + + + +Database + + + +Delete + + + +Dot + + + +Download + + + +Drive + + + +Duplicate + + + + +Eject + + + +ErrorCircle + + + +Exclude + + + +Export + + + +Exposure + + + +ExternalLink + + + +Eye + + + +Filmstrip + + + +Filter + + + +Folder + + + +FolderOpen + + + +Forward + + + +Fullscreen + + + +Gpu + + + +Grip + + + + +HalfDot + + + + +Hero + + + + +Image + + + +Import + + + +Info + + + +Jobs + + + +Key + + + +Keyframe + + + +Layers + + + +Library + + + +Link + + + +Lock + + + +Logs + + + +Menu + + + +Minus + + + +Moon + + + +More + + + +Motion + + + + +Network + + + +Optimise + + + +Pause + + + +Play + + + +Plus + + + +Power + + + +Refresh + + + +Regions + + + + +Render + + + +Reset + + + +Retry + + + +Ring + + + +Search + + + +Sequence + + + +Server + + + +Settings + + + +Sort + + + + +Spline + + + +Stack + + + +Star + + + +StarFilled + + + +Stop + + + +SuccessCircle + + + +Sun + + + +Sync + + + +Tag + + + +Time + + + +Tray + + + +Triangle + + + +TriangleRight + + + +Upload + + + +User + + + +Users + + + +Vectors + + + +Verify + + + +ViewGrid + + + +ViewList + + + +ViewTimeline + + + +Warning + + + +Window + + + +Wipe + \ No newline at end of file diff --git a/deploy/docker/.env.example b/deploy/docker/.env.example new file mode 100644 index 00000000..f7e438eb --- /dev/null +++ b/deploy/docker/.env.example @@ -0,0 +1,8 @@ +TITANO_ADMIN_PASSWORD=change-me-at-first-login +TITANO_DB_PASSWORD=choose-a-long-random-password +TITANO_ARCHIVE=/mnt/user/Timelapse +TITANO_DATA=./data +TITANO_PGDATA=./pgdata +PUID=1000 +PGID=1000 +TZ=Europe/Rome diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile new file mode 100644 index 00000000..b55c8971 --- /dev/null +++ b/deploy/docker/Dockerfile @@ -0,0 +1,42 @@ +# Titano Server — multi-stage, multi-arch (linux/amd64, linux/arm64). BRIEF §14.9. + +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG TARGETARCH +ARG TITANO_VERSION=0.0.0-dev +WORKDIR /src +COPY global.json Directory.Build.props Directory.Build.targets Titano.slnx ./ +COPY i18n/ i18n/ +COPY src/Titano.Core/ src/Titano.Core/ +COPY src/Titano.Data/ src/Titano.Data/ +COPY src/Titano.Protocol/ src/Titano.Protocol/ +COPY src/Titano.Server/ src/Titano.Server/ +RUN dotnet publish src/Titano.Server/Titano.Server.csproj \ + -c Release -a "$TARGETARCH" --no-self-contained \ + -p:TitanoVersion="$TITANO_VERSION" -o /out \ + && rm -f /out/*.pdb + +FROM mcr.microsoft.com/dotnet/aspnet:10.0 +ARG TITANO_VERSION=0.0.0-dev +LABEL org.opencontainers.image.title="Titano Server" \ + org.opencontainers.image.description="Time-lapse archive, uploads, jobs and rendering server" \ + org.opencontainers.image.version="$TITANO_VERSION" \ + org.opencontainers.image.licenses="LicenseRef-Titano-EULA" +ENV TITANO_ARCHIVE_PATH=/archive \ + TITANO_DATA_PATH=/data \ + TITANO_HTTP_PORT=8080 \ + TITANO_HTTPS_PORT=8443 \ + TITANO_DB=postgres \ + PUID=1000 \ + PGID=1000 \ + DOTNET_gcServer=1 \ + DOTNET_GCHeapAffinitizeMask= \ + DOTNET_NOLOGO=1 +WORKDIR /app +COPY --from=build /out/ ./ +COPY deploy/docker/entrypoint.sh /usr/local/bin/titano-entrypoint +RUN chmod 0755 /usr/local/bin/titano-entrypoint && mkdir -p /archive /data +VOLUME ["/archive", "/data"] +EXPOSE 8080 8443 +HEALTHCHECK --interval=30s --timeout=8s --start-period=40s --retries=3 \ + CMD ["dotnet", "/app/Titano.Server.dll", "--healthcheck"] +ENTRYPOINT ["/usr/local/bin/titano-entrypoint"] diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml new file mode 100644 index 00000000..f8f6c3c9 --- /dev/null +++ b/deploy/docker/docker-compose.yml @@ -0,0 +1,47 @@ +# Titano Server with PostgreSQL 17. Start: docker compose up -d Admin panel: http://:8080/admin +name: titano + +services: + titano: + image: ghcr.io/alby96/titano-server:latest + restart: unless-stopped + depends_on: + postgres: + condition: service_healthy + ports: + - "8080:8080" + - "8443:8443" + environment: + TITANO_ADMIN_USER: admin + TITANO_ADMIN_PASSWORD: ${TITANO_ADMIN_PASSWORD:?set TITANO_ADMIN_PASSWORD in .env} + # postgres (with the TITANO_DB_* values below) or a full connection string: Host=…;Database=…;Username=…;Password=… + TITANO_DB: postgres + TITANO_DB_HOST: postgres + TITANO_DB_NAME: titano + TITANO_DB_USER: titano + TITANO_DB_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env} + TITANO_TLS_MODE: auto + TITANO_SERVER_NAME: Titano Server + # Trace, Debug, Information, Warning or Error + TITANO_LOG_LEVEL: Information + PUID: ${PUID:-1000} + PGID: ${PGID:-1000} + TZ: ${TZ:-UTC} + volumes: + - ${TITANO_ARCHIVE:-./archive}:/archive + - ${TITANO_DATA:-./data}:/data + + postgres: + image: postgres:17 + restart: unless-stopped + environment: + POSTGRES_DB: titano + POSTGRES_USER: titano + POSTGRES_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env} + volumes: + - ${TITANO_PGDATA:-./pgdata}:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U titano -d titano"] + interval: 10s + timeout: 5s + retries: 10 diff --git a/deploy/docker/entrypoint.sh b/deploy/docker/entrypoint.sh new file mode 100755 index 00000000..9ea31992 --- /dev/null +++ b/deploy/docker/entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Runs Titano Server as PUID:PGID (Unraid/NAS convention). /data is owned by that user; /archive is left as +# mounted (it may hold terabytes) and only checked for write access. +set -eu + +PUID="${PUID:-1000}" +PGID="${PGID:-1000}" +umask 002 + +if [ "$(id -u)" = "0" ]; then + mkdir -p /data + chown -R "$PUID:$PGID" /data + if ! setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- test -w "${TITANO_ARCHIVE_PATH:-/archive}"; then + echo "warning: ${TITANO_ARCHIVE_PATH:-/archive} is not writable by $PUID:$PGID" >&2 + fi + exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Titano.Server.dll "$@" +fi + +exec dotnet /app/Titano.Server.dll "$@" diff --git a/deploy/unraid/titano.xml b/deploy/unraid/titano.xml new file mode 100644 index 00000000..30fa9b4f --- /dev/null +++ b/deploy/unraid/titano.xml @@ -0,0 +1,42 @@ + + + titano-server + ghcr.io/alby96/titano-server:latest + https://github.com/alby96/titano-releases + bridge + + sh + false + https://github.com/alby96/titano-releases/issues + https://github.com/alby96/titano-releases + Titano Server keeps a shared, verified archive of time-lapse photo sequences and renders them. Pair it with the official PostgreSQL 17 container. + MediaServer:Photos Tools: + http://[IP]:[PORT:8080]/admin + https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano.xml + https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano-server.png + --restart unless-stopped + + + + + + A PostgreSQL 16 or 17 container (official "postgres" template) with a database and user for Titano. + 8080 + 8443 + /mnt/user/Timelapse + /mnt/user/appdata/titano + admin + + postgresql17 + 5432 + titano + titano + + prefer + auto + Titano Server + Information + 99 + 100 + Europe/Rome + diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 00000000..8a51336d --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,88 @@ +# Titano — Architecture and code conventions + +Companion to `docs/BRIEF.md` (scope, behaviour) and `docs/ui/DESIGN.md` (looks). This file says +*where code goes* and *how it is written*. + +## 1. Projects + +| Project | TFM | Purpose | +|---|---|---| +| `src/Titano.Core` | net10.0 | Engine shared by every program: metadata, codecs, imaging, analysis, motion, render, video containers, archive model, naming, import planning, localization runtime, brand mark | +| `src/Titano.Core.Windows` | net10.0-windows | WIC decoder, Media Foundation encoder, DXGI, device APIs, shell helpers (P/Invoke/COM only) | +| `src/Titano.Data` | net10.0 | `IDatabase`, SQLite binding (winsqlite3 on Windows, system libsqlite3 elsewhere for tests/dev), PostgreSQL wire client, migrations, repositories | +| `src/Titano.Protocol` | net10.0 | API DTOs, source-generated JSON contexts, upload/sync/event schemas | +| `src/Titano.Server` | net10.0 (Web SDK) | ASP.NET Core minimal API, auth, jobs, storage, admin web panel (embedded) | +| `src/Titano.Ui` | net10.0-windows (WPF) | Theme (DESIGN tokens), icons, custom controls, `Loc` markup extension, MVVM helpers | +| `src/Titano.App` | WPF exe `Titano.exe` | Desktop client | +| `src/Titano.Uploader` | WPF exe | Uploader | +| `src/Titano.Setup` | WPF exe | Installer/uninstaller | +| `src/Titano.Tools` | net10.0 exe | CLI: make-icon, i18n, xaml-lint, package-guard, selftest, diagnose, fixtures, changelog | +| `tests/Titano.Testing` | net10.0 | In-house test framework (`[Test]`, `[Theory]`+`[Case]`, `Assert`, `TestContext`) | +| `tests/Titano.*.Tests` | exe | One test program per area; `dotnet run --project tests/X -- --junit out.xml` | + +## 2. Namespaces in Titano.Core + +| Folder / namespace | Content | +|---|---| +| `Imaging` | `ImageBuffer` (planar float, linear light), `ImageFileFormat`, `IImageDecoderProvider`, `ImageDecoder`, colour/geometry helpers, `FrameWindow` | +| `Metadata` (+ `Metadata.Tiff`, `Metadata.Bmff`, …) | Signature sniffing, TIFF/IFD (`TiffReader`), Exif/GPS/XMP/MakerNotes, ISO-BMFF, RIFF, RAF, PNG chunks, `MetadataReader`, `ExifWriter` | +| `Codecs` (`Codecs.Jpeg`, `Codecs.Png`, `Codecs.Tiff`, `Codecs.Dng`, `Codecs.Gif`, `Codecs.Ico`) | Pure managed image codecs | +| `Video` | `Mp4Muxer`, box writer, Annex-B/OBU parsing, MP4 inspector, AVI-MJPEG writer, managed encoder provider, encoder contracts | +| `Analysis` | Luminance statistics, deflicker, regions, holy grail, white balance, colour temperature, light/deep analysis | +| `Motion` | FFT, phase correlation, pyramids, optical flow, motion blur, stabilisation, virtual camera, interpolation, stacking | +| `Math` (namespace `Titano.Core.Mathematics`, so it never shadows `System.Math`) | Splines (Fritsch–Carlson, Catmull-Rom, Bézier), robust local regression, statistics, solar position, 3×3 colour matrices | +| `Render` | Render plan, pipeline, export presets | +| `Advisor` | Recommendation rules with localisable reasons, sequence presets | +| `Archive` | Archive layout, sidecars (`sequence.json`, `project.json`), scanner, rebuild, verify, duplicates, orphans, adopt | +| `Naming` | Folder/file templates and tokens | +| `Import` | Card/folder scan, session detection, import plan, hash-verified copy | +| `Model` | Domain entities (§5) shared by Data, Server and clients | +| `Localization`, `Diagnostics`, `IO`, `Hashing`, `Branding` | Infrastructure | + +## 3. Conventions + +- File-scoped namespaces, `sealed` by default, nullable on, warnings are errors. No `#pragma warning disable` + except narrowly around interop with a reason. +- No third-party packages, ever. If the BCL lacks it (CRC-32, Adler, JPEG, PNG decode…), write it. +- Parsers never throw on malformed input: they return partial results plus warnings. Every offset is + bounds-checked against the stream length; recursion and loops are capped. +- Never load a whole RAW to read metadata: windowed reads through `Stream` + `Seek`. +- Hot loops: `Span`, `System.Numerics.Vector`/`Vector256` where it measurably pays, no LINQ. + Parallelise per row/tile with `Parallel.For` only when work per item is large. +- Pixel math in linear light, `float`, Rec.709 primaries. Convert to sRGB/8-bit only at the edges. +- Every long operation takes a `CancellationToken` and reports progress through `IProgress`. +- Libraries use `ConfigureAwait(false)`. No `async void` except WPF event handlers. +- Logging through `Titano.Core.Diagnostics.Log` in Core; `ILogger` on the server. +- Public types and non-obvious members get a one-line `///` summary. Comments explain *why*, not *what*. +- Disk writes that must survive crashes use `AtomicFile` (temp → fsync → rename). +- IDs are UUIDv7 (`Guid.CreateVersion7()`); timestamps UTC; capture times are camera wall-clock with an + optional offset. + +## 4. Tests + +- Framework: `Titano.Testing`. Test classes are `public sealed`; constructor may take `TestContext` + (temp directories, cancellation, log). Use `[WindowsOnly]` for OS-specific tests and + `[RequiresEnvironment("TITANO_TEST_PG")]` for PostgreSQL integration tests. +- Put tests under `tests/Titano..Tests//Tests.cs`, mirroring the source folder. +- Fixtures are synthetic and generated in code wherever possible; tiny binary fixtures may go in + `tests/fixtures/` (< 50 KB each). Larger CC0 samples are fetched by `Titano.Tools fixtures` into + `tests/fixtures/external/` (git-ignored) and tests depending on them skip when absent. +- Fuzz tests: truncate and corrupt valid inputs at many offsets; assert no exception escapes. + +## 5. Localization + +- Keys: `Area.Group.Name`; area = file name. Areas: Common, Shell, Library, Editor, Import, Archive, + Jobs, Server, Settings, Tooltips, Errors, Advisor, Admin, Uploader, Setup. +- `en` is the source (`i18n/en/.resx`), `it` is mandatory (`i18n/it/.it.resx`). +- Labels ≤ 30 chars, tooltips/errors/advisor reasons ≤ 200 chars (one or two sentences). +- Plurals: `Key.one` / `Key.few` / `Key.many` / `Key.other`, resolved by `Loc.Plural("Key", n)`. + +## 6. Build and checks + +``` +dotnet build Titano.slnx -c Release +dotnet run --project tests/Titano.Core.Tests -c Release -- --junit out/core.xml +dotnet run --project src/Titano.Tools -- package-guard +dotnet run --project src/Titano.Tools -- i18n check +dotnet run --project src/Titano.Tools -- xaml-lint +``` diff --git a/docs/BRIEF.md b/docs/BRIEF.md new file mode 100644 index 00000000..6a5f2d75 --- /dev/null +++ b/docs/BRIEF.md @@ -0,0 +1,1346 @@ +# Titano — Build Brief for Claude Code + +> This document is the complete specification and standing instruction set for building the +> Titano time-lapse ecosystem from scratch. It is written to be read by Claude Code at the +> start of every session (via `CLAUDE.md`, see Appendix A) and to be the single source of +> truth for scope, architecture, constraints and delivery order. +> +> Working name: **Titano**. Three shipped programs — **Titano** (Windows desktop client), +> **Titano Server** (Linux/Docker and Windows), **Titano Uploader** (Windows) — sharing one +> engine. Target audience: photographers, astro/landscape shooters, construction and +> weather-cam operators, hobbyists worldwide. + +--- + +## 0. How to work on this project (operating rules for Claude Code) + +### 0.1 Kickoff message + +Paste this as the first message in Claude Code, from an empty repository that contains only +this file at `docs/BRIEF.md` and the prototype dump at `docs/reference/titano-prototype.md`: + +``` +Read docs/BRIEF.md completely before doing anything. It is the full specification for this +repository and it overrides your defaults. Then: +1. Create CLAUDE.md from Appendix A of the brief, and docs/DECISIONS.md, docs/CHANGELOG.md. +2. Execute Phase 0 exactly as described in §22, stopping at its phase gate. +At every phase gate, report: what was built, how to run it, test results on Windows and +Linux, open decisions. Do not ask questions before the gate unless a decision is +irreversible; otherwise decide, record it in docs/DECISIONS.md, and continue. +``` + +### 0.2 Standing rules + +1. **Zero third-party packages, everywhere.** No `` in any `.csproj`, + including tests, tools and build scripts. Anything that is not the .NET BCL, a Microsoft + shared framework that ships with the .NET SDK/runtime (`Microsoft.NETCore.App`, + `Microsoft.AspNetCore.App`, `Microsoft.WindowsDesktop.App`, the Windows SDK targeting + pack), or an operating-system API reached by P/Invoke or COM interop, is implemented + in-house. CI fails the build if a `PackageReference` appears (§19.2). The prototype in + `docs/reference/titano-prototype.md` proves this is workable: it decodes images with WIC, + encodes video with Media Foundation, parses EXIF/TIFF/XMP with its own parsers, and + writes its own MP4 container. +2. **No external processes.** No FFmpeg, no ExifTool, no ImageMagick, no PowerShell + scripts at runtime. The only OS executables/dialogs the product may invoke are listed in + §8.6 (format-volume dialog, shell "open with", browser launch for links). +3. **Cross-platform core, Windows-only presentation.** `Titano.Core`, `Titano.Data`, + `Titano.Protocol` and `Titano.Server` target `net10.0` and must build and pass tests on + Linux. Windows-only code lives in `*.Windows` projects or the desktop apps. +4. **English everywhere in the codebase**: identifiers, comments, commit messages, docs. + The prototype is written in Italian; port the algorithms, not the language. +5. **Every user-visible string is a resource.** No literal UI text in code or XAML. + English is the source language; Italian is the first translation; all other languages + follow in Phase 8 (§16). +6. **UI copy rules (mandatory):** labels ≤ 3 words when possible; no helper text or + paragraphs anywhere in the UI; explanations live only in tooltips (≤ 2 sentences); + every actionable control has a tooltip; empty states are one sentence plus one button; + errors are one sentence saying what happened plus one action. +7. **Decide, record, continue.** When the brief is silent, choose the option that is + simplest, safest for user data, and consistent with the constraints; write one line in + `docs/DECISIONS.md` (date, decision, alternative, reason). Ask the human only at phase + gates, or before any irreversible or data-destroying design choice. +8. **User data is sacred.** Never delete, move or format anything without (a) a verified + hash match of every copied file and (b) an explicit user action. Every destructive + operation is dry-run-able and shows its plan first. +9. **Definition of Done for every phase:** builds green on `windows-latest` and + `ubuntu-latest`; all tests green; no new warnings; `docs/DECISIONS.md` and + `docs/CHANGELOG.md` updated; a short "how to try it" note in the phase report; + localization completeness check passes for `en` and `it`. +10. **Commit style:** Conventional Commits (`feat(core): …`, `fix(server): …`), small + commits, one concern each. Never commit generated binaries, fixtures downloaded by + scripts, or secrets. +11. **Reference prototype:** `docs/reference/titano-prototype.md` is a Repomix dump of the + previous single-program prototype (C#/.NET 10, WinForms, zero packages). Its engine + (metadata parsing, deflicker, holy-grail transitions, optical flow, motion blur, + stabilization, virtual camera, time remap, stacking, Media Foundation encoding, MP4 + muxing, self-tests) was validated on real material. Port those algorithms faithfully + into the new structure, with English names and unit tests; do not copy its UI + (WinForms) or its file layout. Search it with grep; do not try to read it whole. + +--- + +## 1. Product vision + +Titano turns folders of photos (RAW, JPEG, HEIC…) into finished time-lapse videos and keeps +a lifetime archive of shoots organised, verified and searchable — on one PC or on a shared +server. + +- **Import** memory cards with per-card rules, session detection, renaming and hash + verification; import directly into a local archive or straight to a server. +- **Analyse** every sequence deeply (metadata + pixels) and let the advisor set frame + timing, motion blur, deflicker, transitions and export presets — with a reason for every + choice, visible in a tooltip. +- **Render** with the in-house engine and GPU encoders (H.264/HEVC/AV1 via Media + Foundation) to purpose-built presets, from 720p previews to 8K 10-bit archives. +- **Archive** hundreds of thousands of photos across years and cameras, on local or network + drives, with an index that can always be rebuilt from the files themselves. +- **Share** through Titano Server: central archive, users with logins, uploads from the + tiny Uploader, sync of projects, server-side jobs, render delegation to GPU-equipped + clients, and a web admin panel — deployable as a Docker container (Unraid template + included) or on Windows. + +### 1.1 Goals (measurable) + +- A first-time user imports a card, gets a recommended preset, and renders a 1080p preview + in under five interactions from launch. +- A library of 500,000 photos in 2,000 sequences: Library screen opens in < 1 s, scrolls at + 60 fps, filters respond in < 200 ms, full index rebuild from sidecars in < 10 min. +- Rendering quality equals or exceeds the prototype's measured results (§20.4 regression + thresholds), with hardware encoding used whenever a hardware MFT exists. +- Every feature reachable without reading any documentation; every control explained by + its tooltip; UI available in ≥ 30 languages with RTL support. +- Server: 10 concurrent clients uploading at line speed; resumable uploads; zero data loss + on crash (append-only ingest + manifest commit). + +### 1.2 Non-goals (v1) + +- Audio tracks (P2: mux an external AAC file), HDR/PQ output, colour-managed display. +- macOS/Linux desktop clients (server only), mobile apps, browser-based editing. +- Cloud object storage backends (S3 etc.), multi-server federation. +- General RAW *development* beyond what the render pipeline needs (no Lightroom clone). +- GPU compute for image processing (CPU SIMD only in v1; keep interfaces open). +- Real-time tethered capture, camera control. +- Plugin system. + +--- + +## 2. Hard constraints and allowed native surface + +### 2.1 Language and platform decision + +**C# on .NET 10 LTS** for every component. Reasons: one toolchain for a cross-platform +server and a first-class Windows desktop; WPF and ASP.NET Core ship with the SDK (no +packages); mature BCL for crypto, HTTP/2, WebSockets, JSON, compression and SIMD +(`System.Numerics.Vector`, `Vector256`); direct P/Invoke/COM interop to WIC, Media +Foundation and `winsqlite3.dll`; the validated engine is already C#. Alternatives were +rejected: Python (stdlib GUI is dated, no GPU encode, no PostgreSQL driver), C++ (UI and +server cost), Rust/Go (no standard GUI, no SQLite/PostgreSQL in std), Java (JavaFX is +external). + +Desktop UI: **WPF** with the built-in Fluent theme (`Application.ThemeMode`, available in +WPF since .NET 9, refined in .NET 10) for a Windows 11 look with dark/light/system modes and +system accent colour, plus in-house custom `FrameworkElement`s for charts, filmstrip, +curve editors and the virtualized photo grid. If the Fluent theme proves inadequate for any +control, restyle it with an in-house `ResourceDictionary` — never a package. Window chrome: +`WindowChrome` + `DwmSetWindowAttribute` (dark title bar, Mica/backdrop where available). + +### 2.2 Allowed native/OS surface (Windows) + +| Need | API (all OS components, no packages) | +|---|---| +| Image decoding incl. RAW/HEIC/WebP/AVIF when codecs installed | WIC (`IWICImagingFactory`… via COM interop) | +| Video encoding, hardware MFTs (NVENC/QSV/AMF) | Media Foundation (`MFStartup`, `MFTEnumEx`, `IMFTransform`, `ICodecAPI`) | +| Local database | `winsqlite3.dll` (ships with Windows 10 1709+ / Windows 11) via P/Invoke | +| Volume identity, device arrival | `GetVolumeInformationW`, `GetDriveTypeW`, `WM_DEVICECHANGE`, `SetupAPI` if needed | +| Format a card | `SHFormatDrive` (OS format dialog) | +| GPU name/VRAM for encoder capability display | DXGI (`CreateDXGIFactory1`, `IDXGIAdapter::GetDesc`) | +| Taskbar progress, toasts | `ITaskbarList3`; toasts via Windows SDK projection (`net10.0-windows10.0.19041.0` targeting pack) or in-house tray balloon | +| MTP cameras (P2) | Windows Portable Devices (COM) | +| Window chrome | `dwmapi.dll` | + +Linux (server): BCL only. No `libsqlite3`, no `libva`, no FFmpeg. PostgreSQL is reached +through the in-house wire-protocol client (§6.3). + +### 2.3 What this implies (and how the brief resolves it) + +- **RAW decoding** without libraw is tiered (§8.2): full in-house decode for DNG/TIFF/ + JPEG/PNG and a growing set of native RAW formats; embedded full-size JPEG previews as a + universal fallback (every major RAW format embeds one); on Windows, WIC with the free + Microsoft "Raw Image Extension" gives full decode of everything else. +- **Video encoding** on Linux has no OS encoder API; the server produces pure-managed + outputs (MJPEG-AVI, image sequences, GIF, APNG) itself and delegates MP4/H.264/HEVC/AV1 + jobs to **render nodes** — Titano clients that volunteer their GPU (§14.7). An in-house + intra-only H.264 encoder is a P2 universal fallback (§11.6). +- **Testing** uses an in-house runner (`Titano.Testing`, §20.1), not xUnit/NUnit. +- **HEIC/HEIF** cannot be decoded in-house (HEVC intra decoder is out of scope): Windows + clients decode via WIC (HEIF + HEVC extensions); the server stores originals and relies on + proxies produced by a Windows client or render node. + +--- + +## 3. Repository layout + +``` +titano/ (private GitHub repo) +├── CLAUDE.md operating rules (Appendix A) +├── Directory.Build.props version, LangVersion, nullable, warnings-as-errors, analyzers +├── Directory.Build.targets zero-package guard, resource generation hooks +├── Titano.slnx +├── global.json pins .NET 10 SDK +├── src/ +│ ├── Titano.Core/ net10.0 — engine: Metadata, Imaging, Codecs, Analysis, Motion, Video (container/muxers), Archive model, Naming, Localization runtime +│ ├── Titano.Core.Windows/ net10.0-windows — WIC decoder, Media Foundation encoder, DXGI, device APIs, winsqlite3 binding +│ ├── Titano.Data/ net10.0 — IDatabase abstraction, SQL dialects, migrations, repositories, Postgres wire client (Titano.Data.Postgres), SQLite driver surface (implemented by Core.Windows binding) +│ ├── Titano.Protocol/ net10.0 — API DTOs, JSON contexts (source-generated), chunked upload protocol, sync manifests, WebSocket event schema, version negotiation +│ ├── Titano.Server/ net10.0 — ASP.NET Core minimal API, auth, job engine, storage service, admin web UI (embedded static files), Docker entrypoint +│ ├── Titano.App/ net10.0-windows — WPF desktop client +│ ├── Titano.Uploader/ net10.0-windows — WPF uploader (tray-capable) +│ ├── Titano.Setup/ net10.0-windows — in-house installer/uninstaller (self-extracting, Add/Remove Programs, shortcuts, file associations) +│ └── Titano.Tools/ net10.0 — CLI: selftest, diagnose, make-icon, i18n export/check, fixtures fetch, changelog +├── tests/ +│ ├── Titano.Testing/ in-house test framework + runner (attributes, asserts, fixtures, JUnit XML) +│ ├── Titano.Core.Tests/ +│ ├── Titano.Data.Tests/ includes PostgreSQL integration tests (skipped without TITANO_TEST_PG) +│ ├── Titano.Server.Tests/ in-process Kestrel on a random port +│ ├── Titano.App.Tests/ view-model tests + XAML lint (tooltip/resource rules) + screenshot smoke (`--capture`) +│ └── fixtures/ tiny checked-in samples; larger CC0 RAW samples fetched by `Titano.Tools fixtures` +├── branding/ icon sources (SVG), generated ICO/PNG sets +├── i18n/ .resx sources (en) + translations, glossary, machine-translation notes +├── deploy/ +│ ├── docker/Dockerfile, docker-compose.yml, entrypoint +│ └── unraid/titano.xml +├── .github/workflows/ ci.yml, release.yml, docker.yml +└── docs/ BRIEF.md (this), DECISIONS.md, CHANGELOG.md, ARCHITECTURE.md (generated per phase), reference/titano-prototype.md +``` + +Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Server` → `Core`, +`Data`, `Protocol`. `Uploader` → `Core` (hashing, metadata light), `Protocol`. `Core` and +`Data` never reference anything Windows-specific; CI builds them on Linux. + +--- + +## 4. Architecture + +### 4.1 Component diagram + +``` + ┌────────────────────────────────────────────────────────────────┐ + │ Titano (WPF client) │ + │ Library · Sequence editor · Import · Archive manager · Jobs │ + │ Local mode: SQLite + local/network archive │ + │ Server mode: REST/WS client, proxies cache, render node │ + └───────┬───────────────────────────────────────┬────────────────┘ + │ HTTPS REST + WebSocket │ Memory cards (USB/SD) + ▼ ▼ +┌───────────────────────────────────┐ ┌──────────────────────────┐ +│ Titano Server │ │ Titano Uploader (WPF) │ +│ Kestrel · API v1 · Auth · Jobs │◄───────────│ queue · watch folders │ +│ Storage service · Admin web panel │ HTTPS │ resumable chunk upload │ +│ Pure-managed encoders │ └──────────────────────────┘ +└──────┬──────────────────┬─────────┘ + │ │ + ▼ ▼ + PostgreSQL (Docker) Archive volume (/archive: originals, sidecars, proxies, renders) + or SQLite (Windows) +``` + +### 4.2 Shared engine + +`Titano.Core` is the same assembly on client and server: metadata parsing, image codecs, +analysis advisor, render pipeline, container writers. Only the *decoder/encoder providers* +differ per platform, behind two interfaces: + +```csharp +public interface IImageDecoderProvider { bool CanDecode(ImageFormatInfo f); DecodedImage Decode(DecodeRequest r); } +public interface IVideoEncoderProvider { IReadOnlyList Capabilities { get; } IVideoEncoderSession Open(EncodeSettings s); } +``` + +Registered providers, in priority order: client → `WicDecoderProvider`, then +`ManagedDecoderProvider`; server → `ManagedDecoderProvider` only. Encoders: client → +`MediaFoundationEncoderProvider` (hardware first, software H.264 fallback), then +`ManagedEncoderProvider` (MJPEG/AVI, sequences, GIF, APNG); server → managed only, plus +delegation to render nodes. + +### 4.3 Data flow: card → archive → render + +``` +Card ──scan(light metadata)──► Import plan (sessions, names) ──copy+hash──► originals/ + ──light analysis──► sequence.json sidecar + DB rows ──queue──► deep analysis job + ──► proxies + thumbs ──► advisor recommendations + suggested presets +User opens sequence ──► settings (project JSON) ──render──► exports/ + DB render row +``` + +Frames are streamed to the server by the client or uploader through chunked, resumable, +hash-verified uploads; the server commits the frame into the archive layout and updates the +sequence manifest atomically (write temp → fsync → rename). + +### 4.4 Modes of the client + +| Mode | Storage | Index | Who renders | +|---|---|---|---| +| Local | local or network drive archive | SQLite | this PC | +| Server-connected | server archive; local proxies/thumbs cache | server DB via API; local SQLite caches only | server (managed formats), render nodes (MP4), or this PC after downloading originals | +| Mixed | both; each sequence has an `origin` and a `sync state` | both | as above | + +--- + +## 5. Domain model + +Primary entities (identical concepts in SQLite and PostgreSQL; ids are UUIDv7 stored as +`TEXT`/`uuid`; timestamps UTC ISO-8601/`timestamptz`): + +- **Archive** — id, name, root path, layout templates, schema version, created, proxy policy. +- **Sequence** — id, archive id, title, folder (relative), camera make/model/serial, lens, + first/last capture, frame count, median interval, total bytes, status flags + (`analyzed_light`, `analyzed_deep`, `proxies_built`, `thumbs_built`, `rendered_count`, + `verified_at`), hero frame id, tags, rating, notes (short), settings JSON (project), + analysis report JSON (compact) + path to full report, origin (local/server), sync state, + version counters (`settings_version`, `frames_version`), owner user id (server). +- **Frame** — id, sequence id, index, relative path, file name, size, sha256, captured at + (with sub-second and source: EXIF/XMP/filesystem), exposure time, f-number, ISO, focal + length, exposure bias, white balance, orientation, width, height, format, embedded + preview info (offset/length), light stats (mean log-luminance, clip fractions) once + analysed, flags (missing, corrupt, duplicate, excluded). +- **Render** — id, sequence id, preset name, settings JSON, output relative path, codec, + width, height, fps, duration, bytes, created, produced by (client id / server / node). +- **Job** — id, kind (scan, rebuild, verify, light-analyse, deep-analyse, proxies, + thumbs, render, import, upload-commit, maintenance), target ids, state (queued, running, + paused, done, failed, cancelled), progress (done/total, fps, eta), log tail, created by, + node id, attempts, error. +- **MediaCard** (client) — id, volume serial, filesystem label, capacity, nickname, camera + identity (Make/Model/BodySerial from first file), profile JSON, first/last seen, import + history (job ids). +- **User** (server) — id, username, display name, password hash (PBKDF2), role (admin, + editor, uploader, viewer), permissions bitmask, quota bytes, used bytes, disabled, + must-change-password, created, last login. +- **Session/Token** (server) — token hash, user id, client name, created, expires, last + used, revoked. +- **RenderNode** (server) — id, user id, client name, capabilities JSON (codecs, hardware + encoder names, max resolution), last heartbeat, state. +- **Setting** — key/value (typed JSON), scope (app, archive, user). +- **Tag**, **SequenceTag** — normalised for filtering. +- **AuditLog** (server) — who did what to which sequence/user, when. + +Indexes: `frame(sequence_id, index)`, `frame(sha256)`, `frame(captured_at)`, +`sequence(archive_id, first_capture)`, `sequence(camera_model)`, tags, jobs by state. +Paging everywhere (keyset pagination on `(first_capture, id)`). + +--- + +## 6. Data layer + +### 6.1 `Titano.Data` abstraction + +```csharp +public interface IDatabase : IAsyncDisposable { + Dialect Dialect { get; } // Sqlite | Postgres + Task OpenAsync(CancellationToken ct); // connection from pool +} +public interface IDbSession : IAsyncDisposable { + Task ExecuteAsync(string sql, params DbParam[] p); + IAsyncEnumerable QueryAsync(string sql, params DbParam[] p); + Task BeginAsync(); + Task BulkInsertAsync(string table, IReadOnlyList columns, IAsyncEnumerable rows); // COPY on PG, multi-row INSERT on SQLite +} +``` + +Hand-written SQL in repositories (`SequenceRepository`, `FrameRepository`, …); no ORM. +Migrations: numbered `.sql` files per dialect in `Titano.Data/Migrations/{sqlite,postgres}/`, +applied at startup inside a transaction, recorded in `schema_migrations`. Dialect +differences (types, `RETURNING`, upserts) are confined to SQL files and a small `SqlDialect` +helper. + +### 6.2 SQLite (client, and Windows standalone server) + +- Binding: `Titano.Core.Windows/Sqlite/WinSqlite3.cs` P/Invoke to `winsqlite3.dll` + (`sqlite3_open_v2`, `prepare_v2`, `step`, `reset`, `finalize`, `bind_*`, `column_*`, + `exec`, `errmsg`, `last_insert_rowid`, `changes`, `busy_timeout`, `libversion`, + `extended_result_codes`). UTF-8 marshalling by hand. Check `sqlite3_libversion() ≥ 3.31` + at startup; probe `PRAGMA compile_options` and never depend on FTS/JSON extensions. +- Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, + `temp_store=MEMORY`, `cache_size=-65536`, `mmap_size=268435456`. +- Location: `%LOCALAPPDATA%\Titano\titano.db` (never Documents/OneDrive-synced folders — + SQLite in a synced folder corrupts). Portable mode: `portable.txt` next to the exe puts + everything under `.\data\`. +- Backups: `VACUUM INTO` nightly copy kept ×3; restore from Settings › Advanced. + +### 6.3 PostgreSQL client (`Titano.Data.Postgres`) — in-house wire protocol v3 + +- TCP + optional TLS via `SslStream` after `SSLRequest`; `sslmode` = disable | prefer | + require | verify-full. +- Startup (`user`, `database`, `application_name=titano-server`, `client_encoding=UTF8`, + `TimeZone=UTC`); authentication: SCRAM-SHA-256 (`Rfc2898DeriveBytes.Pbkdf2`, HMAC-SHA256, + channel binding not required), MD5, cleartext, trust. +- Simple query, extended query (Parse/Bind/Describe/Execute/Sync) with parameters in text + format except `bytea` (binary), prepared-statement cache per connection, transactions, + `COPY … FROM STDIN` for bulk inserts, `LISTEN/NOTIFY` (used for multi-instance job + wake-ups, optional), cancellation via `CancelRequest`. +- Type mapping: `text, varchar, int4, int8, float8, bool, bytea, timestamptz, uuid, jsonb, + numeric(as string)`; arrays not needed. +- Connection pool (min/max, health check `SELECT 1`, idle eviction), typed + `PostgresException` carrying SQLSTATE, retry on transient errors (57P01, 08xxx). +- Test suite runs against PostgreSQL 16 and 17 service containers in CI (§19). + +--- + +## 7. Archive format on disk + +The archive is the source of truth; the database is an index that can be rebuilt from it. + +``` +/ +├── .titano/ +│ ├── archive.json { id, name, schemaVersion, created, layoutTemplates, proxyPolicy } +│ ├── index-snapshot.bin optional accelerator for rebuild (all sidecars concatenated + hash); ignored if stale +│ └── locks/ lease files for concurrent writers (server + client on same share) +├── 2026/ +│ └── 2026-09-28 Canon EOS R5 - Harbour sunset/ folder = expanded FolderTemplate +│ ├── originals/ IMG_0001.CR2 … names = expanded FileTemplate +│ ├── proxies/ 0001.jpg … (JPEG, long edge per policy; optional, regenerable) +│ ├── exports/ 2026-09-28 Harbour sunset - 4K HEVC.mp4 … +│ └── .titano/ +│ ├── sequence.json sidecar manifest (below) +│ ├── analysis.json full deep-analysis report +│ ├── project.json render settings (the "project") +│ └── thumbs.pack packed thumbnails (one file per sequence, indexed; avoids 100k tiny files on SMB) +``` + +`sequence.json` (canonical, versioned, written atomically): +`{ id, title, camera, lens, frames: [{ i, file, size, sha256, capturedAt, exposure, fNumber, +iso, focal, bias, wb, orientation, w, h, format, previewOffset, previewLength, flags }], +tags, rating, notes, status, versions, createdBy, updatedAt }`. + +Rules: originals are immutable (never rewritten; edits are settings); every write of a +sidecar goes to a temp file, `fsync`, rename; the folder name is derived from templates at +import time and never auto-renamed afterwards (renaming is a user mass-operation that +updates sidecars and DB together). Network drives: UNC or mapped paths; long-path aware +(`\\?\` prefix); no `FileSystemWatcher` reliance — periodic polling by mtime/size plus manual +rescan; offline detection with graceful read-only state. + +### 7.1 Naming templates + +`FolderTemplate` default `{year}/{date} {camera}`; `FileTemplate` default +`{date}_{time}_{n:0000}`. Tokens (localised descriptions in resources): `year, month, day, +date, time, hm, session, sessionstart, camera, lens, iso, shutter, aperture, n, nsession, +name, ext, title`. `{token:format}` passes the format to the .NET formatter. Illegal +characters are replaced, never passed through; templates are validated live in the UI with a +preview of the first three names. + +--- + +## 8. Image pipeline + +### 8.1 Supported input formats + +| Family | Extensions | Metadata (in-house) | Pixels on Windows | Pixels on server (Linux) | +|---|---|---|---|---| +| JPEG | jpg jpeg jpe jfif | APP1 Exif/XMP, MPF | WIC or managed | managed (baseline + progressive) | +| PNG | png | eXIf, iTXt XMP | WIC or managed | managed | +| TIFF | tif tiff | IFDs | WIC or managed | managed (strips/tiles; none/PackBits/LZW/Deflate/JPEG) | +| DNG (smartphones: Apple ProRAW, Android, Samsung; DJI; Insta360; Leica; Pentax; Ricoh) | dng | IFDs, MakerNote | WIC (if Raw ext.) or managed full decode | managed full decode | +| Canon | cr2 cr3 | cr2: TIFF; cr3: ISO-BMFF `CMT1..4` | WIC (Raw ext.) → managed CR2 (P1) → embedded preview | managed CR2 (P1) → embedded full-size JPEG (CR3 track 1) | +| Nikon | nef nrw | TIFF | WIC → managed NEF (P1) → preview | managed NEF (P1) → preview | +| Sony | arw srf sr2 | TIFF | WIC → managed ARW (P1) → preview | idem | +| Fujifilm | raf | RAF header + TIFF | WIC → managed RAF uncompressed (P1) → preview | idem | +| Olympus/OM, Panasonic, Pentax, Samsung, Hasselblad, Phase One, Leica | orf rw2 raw pef srw 3fr fff iiq rwl | TIFF-like | WIC → managed (P1/P2) → preview | preview (P1: managed decoders as feasible) | +| GoPro | gpr (DNG+VC-5) + jpg sidecar | IFDs | preview/sidecar JPEG; VC-5 out of scope | sidecar JPEG | +| HEIF/HEIC/AVIF (iPhone, Samsung, DJI) | heic heif hif avif | ISO-BMFF `Exif` item | WIC (HEIF + HEVC/AV1 extensions) | metadata only; pixels via client-made proxies | +| WebP | webp | RIFF `EXIF` chunk | WIC (WebP ext.) | metadata only (P2: managed VP8L) | +| JPEG XL, JPEG XR, BMP, GIF (single frame) | jxl jxr bmp gif | minimal | WIC if a codec exists | not supported | + +Windows codec availability is enumerated at startup (`IWICImagingFactory:: +CreateComponentEnumerator`). Missing codecs are surfaced as a one-line notice with an +"Install" button opening the Microsoft Store page (Raw Image Extension, HEIF Image +Extension, HEVC Video Extensions, AV1 Video Extension, WebP Image Extension; verify product +IDs at implementation time). The format table in Settings › Formats shows, per format, +which tier will be used on this machine. + +### 8.2 Decode tiers (deterministic, logged per frame) + +1. **Native full decode** (in-house or WIC) at working resolution, 16-bit linear light. +2. **Embedded preview** (largest JPEG found: TIFF `JPEGInterchangeFormat`/SubIFD strips, + RAF preview, CR3 full-size JPEG track, MPF). Marked `PreviewOnly` on the frame; the + sequence shows a chip with the count and the advisor caps output resolution to the + preview size unless the user overrides. +3. **Unavailable** → frame flagged `Undecodable`; excluded from render; listed in the + sequence warnings. + +The in-house DNG pipeline (server and client): CFA/linear DNG, `Compression` 1/7 (lossless +JPEG SOF3)/8 (Deflate)/34892 (lossy JPEG), `LinearizationTable`, `BlackLevel` (+ repeat +dims, delta), `WhiteLevel`, `AsShotNeutral`/`AsShotWhiteXY`, `ColorMatrix1/2` + +`CameraCalibration`, `AnalogBalance`, Bradford adaptation to D65, demosaic **AHD** (default, +"perfect result" priority) with bilinear for Draft quality, highlight reconstruction (clip ++ desaturate), `ActiveArea`/`DefaultCrop*`, `Opcode` lists 1–3 (at least `GainMap`, +`WarpRectilinear`, `FixVignetteRadial`; unknown opcodes ignored with a warning), +`BaselineExposure`. Output: linear Rec.709/sRGB primaries float planes. + +### 8.3 Managed codecs (all in `Titano.Core/Codecs`, pure C#, SIMD where it pays) + +- `JpegDecoder` (baseline, progressive, restart intervals, 4:4:4/4:2:2/4:2:0/4:1:1/gray, + 12-bit optional, ICC ignored), `JpegEncoder` (baseline, quality 1–100, subsampling + choice, optimised Huffman tables optional, Exif/XMP APP1 embedding). +- `PngDecoder`/`PngEncoder` (all colour types, 8/16-bit, Adam7 decode, filters, zlib via + `System.IO.Compression.ZLibStream`). +- `TiffReader`/`TiffWriter` (as prototype: 16-bit TIFF, linear DNG writer with + `PhotometricInterpretation=34892`). +- `GifEncoder` (animated; median-cut palette + Floyd–Steinberg; frame differencing). +- `ApngEncoder`. +- `AviMjpegWriter` (RIFF AVI with `MJPG`, OpenDML index for > 2 GB). +- `Mp4Muxer` (port of prototype: streaming `ftyp`/`mdat`/`moov`, 90 kHz timescale, + variable durations, `avcC`/`hvcC`; add `av1C` + OBU handling in P1), `AnnexBParser`. +- `Bmff` reader (HEIF/CR3/AVIF boxes), `Riff` reader (WebP/AVI), `Raf` reader. + +### 8.4 Image buffers + +Port the prototype's `ImageBuffer`/`FrameBufferPool` (pooled float planes, linear light), +`FrameWindow` (sliding window, disk spill under a memory budget, read-ahead), and +`GeometryStage` (crop/aspect/affine with Catmull-Rom). Memory is governed by the window +size and budget, never by sequence length; the self-tests assert this. + +### 8.5 Thumbnails and proxies + +- Thumbnail: 320 px long edge JPEG q80, packed per sequence in `thumbs.pack` (header, + index table, entries), with an LRU in-memory cache and async loading for the UI. +- Proxy: JPEG at policy long edge (default 1920; options 1280/1920/2560/full), q92, Exif + orientation applied, capture time copied into Exif. Proxies are optional and regenerable; + they enable remote editing, server-side rendering of formats the server cannot decode, + and fast scrubbing. + +### 8.6 The only OS executables/dialogs the product may invoke + +`SHFormatDrive` (format card), `ShellExecute("open", url)` (links, Store pages), +`ShellExecute("explore", folder)` (reveal in Explorer). Nothing else. + +--- + +## 9. Metadata model and parsers (`Titano.Core/Metadata`) + +Port and extend the prototype's binary parsers: container detection by signature; JPEG +segment scan (APP1 Exif, APP1 XMP + extended XMP, APP2 MPF); TIFF/IFD walker with on-demand +window reads (never load a whole RAW to read tags), SubIFD selection of the main image, +`0x02BC` XMP; ISO-BMFF walker (`meta/iinf/iloc` Exif item, CR3 `CMT` boxes, `PRVW`/`THMB`, +track sample tables for the CR3 JPEG); RIFF; RAF; PNG chunks. MakerNote parsing only where +it adds value: Canon/Nikon/Sony/Fuji/Olympus/Panasonic body serial, shutter count, lens +name, exposure mode, image stabilisation flag, intervalometer hints, sRaw flags. + +Fields extracted per frame: DateTimeOriginal + SubSecTimeOriginal + OffsetTimeOriginal +(fallback: CreateDate, GPS time, file mtime — recorded with `TimestampSource`), ExposureTime, +FNumber, ISO, FocalLength (+35 mm equiv), ExposureBias, ExposureProgram, MeteringMode, +WhiteBalance mode + Kelvin if present, Flash, Orientation, dimensions, Make/Model/BodySerial, +Lens, GPS (lat/lon/alt), Artist/Copyright, Rating/Label from XMP, `Software`. All parsers +are fuzz-safe (no exception escapes; malformed input yields partial metadata + a warning). + +`ExifWriter` (prototype) is kept for proxies/exports: writes a minimal, valid Exif block. + +--- + +## 10. Analysis advisor + +Two passes; both deterministic, both explainable (every finding and every recommendation +carries a resource key + parameters that render as a localised reason in tooltips). + +### 10.1 Light analysis (at import/scan, metadata only, seconds per 10k frames) + +Cadence (median interval, jitter, gaps → session boundaries; `SessionGapMinutes` default +45, `MinimumSessionFrames` 8), total capture span, exposure series (EV = +log2(N²/t) − log2(ISO/100)), exposure step detection (ISO/shutter/aperture changes and +their EV amplitude), camera/lens identity, orientation consistency, resolution +consistency, timestamp sanity (clock resets, duplicates, non-monotonic), format tiers, +GPS → sunrise/sunset/civil twilight via an in-house solar-position calculation (NOAA +algorithm) → day/night/transition labelling. + +### 10.2 Deep analysis (background job after import; "speed is not an issue") + +Every frame decoded at analysis width (default half native, capped 2048): per-frame +trimmed log-luminance mean, histogram, clip fractions, per-channel means (WB drift), colour +temperature where applicable (McCamy with Planckian-locus validity check), sharpness +(Laplacian variance), noise estimate, phase-correlation shift vs previous frame (shake +magnitude, drift → panning), region mask (horizon by strongest row-luminance step, refined +per column; fallback by luminance), flicker spectrum (autocorrelation of luminance +residuals → deflicker window), exposure steps *as actually received* by the pixels, +star-field detection (small bright point density on night frames), cloud coverage estimate +(sky-region texture), scene-change detection (histogram distance), duplicate/black/white +frames, motion magnitude histogram (for motion-blur recommendation), suggested hero frame. +Results → `analysis.json` + compact summary in DB; charts in the Sequence editor. + +### 10.3 Recommendations (rules, each with reason and confidence) + +- Frame timing mode: Constant when jitter < tolerance; Adaptive when the intervalometer + paused deliberately; Interpolated when gaps are sparse and motion is smooth. +- Frame rate and time compression: choose 24/25/30/60 fps and duration targets from cadence + and motion magnitude; offer "fit to N seconds". +- Motion blur target shutter angle: from measured shutter angle (360×exposure/interval) and + motion magnitude; skip flow when exposure already exceeds the target. +- Deflicker window (4× flicker period), region deflicker when horizon confidence is high, + holy-grail transition length (half the typical distance between exposure steps), WB + smoothing, stabilization on/off (measured shake > 0.3 px) with crop cost, crop/aspect + suggestions from subject placement, output resolution cap from source/preview size and + codec level limits, quality profile. +- Auto-generated **sequence presets** ("Night sky — 4K 10-bit HEVC 24 fps, deflicker 41, + stabilise", "Holy grail sunset — 4K HEVC 30 fps, transitions 18", "Construction cam — + 1080p H.264 30 fps, adaptive timing", "Social vertical 1080×1920") = full project settings + + export preset; one click to apply; saveable as user presets. + +### 10.4 Auto vs manual + +Every deducible parameter shows an **Auto** indicator with the chosen value and a reason +tooltip; touching the control takes it manual; a small reset returns it to Auto. Per section +**Optimise** applies heavier decisions (module on/off) and reports what changed and why. Where +data is missing, the advisor says so and changes nothing. + +--- + +## 11. Rendering engine and export + +### 11.1 Render plan (port) + +The engine walks a list of output frames, each with a (possibly fractional) source position +and a duration; constant, adaptive, interpolated and remapped timings all produce this one +shape. Fractional positions synthesise frames from the motion field; motion blur scales +with `√(target² − real²)` shutter angle composition (prototype rule). + +### 11.2 Modules (port, keep the validated behaviour and its tests) + +Colour science (linear light, sRGB transfer), orientation detection (declared vs decoded +size), deflicker (weighted local linear regression with Tukey robustness blended by +surviving-window fraction), region deflicker (horizon/luminance masks), holy-grail exposure +step redistribution (only steps the pixels actually received), WB smoothing (channel +ratios), optical flow (pyramidal differential, median filtered), motion blur (gather +filter), stabilization (phase correlation, nine patches, similarity fit, texture gating, +smoothed path), virtual camera (Bézier eased pan/zoom keyframes, composed with +stabilization into one affine), non-linear time remap (Fritsch–Carlson monotone spline), +temporal stacking (median, progressive max with decay), geometry stage, codec level limits, +disk spill, cancellation semantics. + +### 11.3 Encoders and containers + +| Output | Client (Windows) | Server (Linux/Windows) | +|---|---|---| +| MP4 H.264 (Baseline/Main/High, 8-bit) | Media Foundation: hardware MFT (NVENC/QSV/AMF) else Microsoft software encoder | render node; P2 in-house intra-only encoder | +| MP4 HEVC Main / Main10 (10-bit, P010) | hardware MFT only | render node | +| MP4 AV1 | hardware MFT only (Windows 11 + AV1 encoder) | render node | +| AVI MJPEG | managed | managed | +| Image sequence JPEG / PNG / TIFF-16 / linear DNG | managed | managed | +| Animated GIF, APNG | managed | managed | + +Encoder session design as prototype: encoder MFT driven directly (not SinkWriter), NV12/P010 +conversion in-house, Annex-B → MP4 samples, streaming muxer; rate control (VBR/CBR/quality), +GOP, B-frames, profile/level via `ICodecAPI`. Capability discovery (`MFTEnumEx` hardware +flag, friendly names, DXGI adapter) is shown in Settings › Rendering and used to hide +unavailable codecs. + +### 11.4 Presets + +Presets bind resolution, aspect, codec, profile, bit depth, fps, bitrate (≈0.10 bpp/frame +H.264, 0.07 HEVC, 0.05 AV1; night-sky content is the most demanding), GOP and container. +Editing any value flips the name to "Custom"; matching values restore the preset name. + +Built-in presets: 8K UHD 10-bit HEVC archive · 4K UHD 10-bit HEVC archive · 4K UHD HEVC · +4K UHD H.264 compatible · DCI 4K HEVC 24 fps · Cinema 21:9 4K HEVC 24 fps · 4K 60 fps · +1440p H.264 · 1080p H.264 share · 1080p 60 · 1080×1920 vertical social · 1080×1350 4:5 · +1440×1440 square · 720p quick preview (GOP 1 s) · AV1 4K · MJPEG AVI intermediate · PNG +sequence · JPEG sequence · TIFF-16 sequence · GIF preview (480 px) · APNG. Resolutions: +720p/1080p/1440p/4K UHD/DCI 4K/5K/6K/8K/custom; aspects 16:9, 21:9, 4:3, 3:2, 1:1, 9:16, +4:5, source, custom; fps 23.976/24/25/29.97/30/48/50/59.94/60/120. + +### 11.5 Export UI behaviour + +Preview stays visible during encoding (optional live preview); single global progress bar +(frames, fps, elapsed, ETA) mirrored to the taskbar; cancel is always available and leaves +no partial files behind; output name from `{title} - {preset}` template; "Reveal in +Explorer" and "Render another preset" follow-ups; batch render of several presets in one +job; per-sequence render history. + +### 11.6 P2: in-house H.264 intra-only encoder + +Baseline profile, I-frames only, I_16x16/I_4x4 prediction, 4×4 integer transform, CAVLC, +fixed QP or simple rate control. Large files but universally playable; enables MP4 output +on a server without render nodes. Validate with the in-house MP4 inspector and a system +player smoke test on Windows CI. + +--- + +## 12. Titano desktop client — UI specification + +### 12.1 Shell + +``` +┌────┬─────────────────────────────────────────────────────────────────────────────┐ +│ ≡ │ ▮▮▮▮▮▮▮▮▮▮▮▮▮░░░░░░░ Building proxies · Harbour sunset · 1,240/3,600 · 12 fps · 3 min │ ⏹ │ ← global job bar, only while a job runs +│ ├─────────────────────────────────────────────────────────────────────────────┤ +│ ▤ │ │ +│Lib │ │ +│ ⬇ │ section content (edge to edge) │ +│Imp │ │ +│ ✎ │ commands of the section live INSIDE the section, in one row above the │ +│Seq │ content they act on; every command has a tooltip │ +│ ▣ │ │ +│Arch│ │ +│ ⚙ │ │ +│Jobs│ │ +│ ☁ │ │ +│Srv │ │ +│ │ │ +│ ⚙ │ │ +│Set │ │ +│ ⓘ ├─────────────────────────────────────────────────────────────────────────────┤ +│ │ 412 sequences · 618,204 photos · 9.4 TB · ☁ Connected to "Studio NAS" · 3 jobs │ ← status strip +└────┴─────────────────────────────────────────────────────────────────────────────┘ +``` + +- Left navigation rail (prototype pattern): full names, collapsible to icons (state saved), + badge counts (warnings, running jobs), hover tooltip with section description. +- Fluent theme, system/dark/light, system accent; density "comfortable"; 8 px grid; one + typeface (Segoe UI Variable, system fallback for CJK/Arabic/etc.). +- Window chrome custom (dark title bar), min size 1200×760; per-monitor DPI. +- Keyboard: standard shortcuts, listed in tooltips ("Render · Ctrl+R"). +- Notifications: unobtrusive toasts inside the window (bottom-right) for job completion, + card detected, server events; optional OS toast when minimised. +- Modals only for destructive confirmations and login. + +### 12.2 Library (home) + +``` +│ [🔍 Search title, camera, tag] [Year ▾] [Camera ▾] [Status ▾] [Tags ▾] [Sort ▾] [⊞][☰][▦] [⟳] │ +├──────────────────────────────────────────────────────────────────────────────────────────────┤ +│ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ │ +│ │ hero thumb │ │ │ │ │ │ │ │ │ │ │ │ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ +│ ├────────────┤ ├────────────┤ ├────────────┤ ├────────────┤ ├────────────┤ ├────────────┤ │ +│ │Harbour sun…│ │2026-09-27 │ │… │ │ │ │ │ │ │ │ +│ │3,600 · R5 │ │1,020 · GoPr│ │ │ │ │ │ │ │ │ │ +│ │✓ ▣ ▶2 ☁ │ │✓ ▣ · ☁ │ │ │ │ │ │ │ │ │ │ +│ └────────────┘ └────────────┘ └────────────┘ └────────────┘ └────────────┘ └────────────┘ │ +``` + +- Unit of the library = **sequence** (never a flat list of 600k photos). Views: grid + (default), list (sortable columns), timeline (year/month bands with density). +- Card: hero thumbnail, title (user title or `{date} {camera}`), count · camera · span, + status chips: `✓` analysed, `▣` proxies, `▶n` renders, `☁` synced/origin, `!` warnings. + Hover reveals quick actions: Open, Analyse, Render preset, Sync. +- Multi-select → mass actions bar (Analyse, Build proxies, Verify, Tag, Rate, Move, + Upload, Download, Delete, Export list as CSV). +- Filters are chips; saved views (e.g. "Night, 4K, not rendered"); search is instant + (indexed columns); everything virtualized (in-house `VirtualizingWrapPanel`). + +### 12.3 Sequence editor + +``` +│ ← Harbour sunset · 3,600 frames · Canon EOS R5 · 2 s interval · 2 h 00 m [Analyse] [Optimise all] [Render ▾] │ +├──────────────────────────────────────────────────────────────────┬──────────────────────────────────┤ +│ ┌──────────────────────────────────────────────────────────────┐ │ Exposure │ +│ │ │ │ Deflicker [●] Auto 41 ⓘ │ +│ │ PREVIEW │ │ Strength ───●──── 0.8 │ +│ │ │ │ Regions [●] Auto horizon │ +│ │ [◧ compare] [⊹ vectors] [▭ regions] [▦ crop mask] [1:1] [⛶] │ │ Transitions [●] Auto 18 ⓘ │ +│ └──────────────────────────────────────────────────────────────┘ │ WB smoothing [●] Auto │ +│ ▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏▏ filmstrip + markers │ │ +│ [Frames] [Exposure] [Motion] [Camera] [Time] [Stack] [Export] │ [Optimise section] [Reset] │ +│ ┌──────────────────────────────────────────────────────────────┐ │ │ +│ │ measured (amber) vs target (accent) luminance chart, │ │ │ +│ │ exposure-step markers, region curves; click = seek preview │ │ │ +│ └──────────────────────────────────────────────────────────────┘ │ │ +``` + +- Preview always on top with tools: zoom/pan (1:1 shows raw pixels), wipe compare + original/corrected, motion-vector overlay, region boundary, crop mask ("what I lose" vs + "how it will look"), full-screen native-resolution window with collapsible shot data. +- Sections (tabs inside the editor; each with its measuring tool below the filmstrip and + its settings column on the right): **Frames** (virtualized table: index, time, exposure, + ISO, f, size, tier, flags; exclude/include; set hero; warnings list), **Exposure** + (deflicker, regions, holy-grail transitions, WB) with luminance/waveform charts, + **Motion** (blur, flow quality, stabilization) with shake path chart, **Camera** (crop, + aspect, virtual camera keyframes with a spline editor), **Time** (fps, timing mode, remap + curve, fit-to-duration, plan chart), **Stack** (median/max, trail length), **Export** + (preset, values, output name, batch list, render history, sponsor slot — Phase 9 only). +- Every deducible control shows Auto/manual state (§10.4); every control has a tooltip + with the reason and the effect of moving it the wrong way. +- While a job runs on this sequence, settings that would change the rules mid-render are + disabled; viewing tools stay live. + +### 12.4 Import (cards) + +``` +│ Devices │ Profile "EOS R5 · card A" (SD 128 GB · serial 3F2A-9C11 · Canon EOS R5 #0431) [Edit ▾] [New] │ +│ ● SD 128 GB EOS R5 card A ▲ │ Destination (•) Archive ( ) Folder [D:\Shoots …] ( ) Server ☁ "Studio NAS" │ +│ ● microSD 64 GB GoPro 12 │ Scan [✓] Subfolders Sessions [✓] gap [45] min · min [8] frames [✓] Verify hashes │ +│ ○ E:\ no DCIM │ Names {year}/{date} {camera} / {date}_{time}_{n:0000} → 2026/2026-09-28 Canon EOS R5/2026-09-28_18-02-11_0001.CR2 │ +│ ○ Folder… │ On existing (•) Skip ( ) Rename ( ) Overwrite Convert (•) Copy ( ) TIFF-16 ( ) Linear DNG ( ) JPEG │ +│ │ After import (•) Keep card ( ) Delete imported ( ) Format card [✓] Eject [✓] Deep analysis │ +│ [✓] Import automatically when │ Plan 3 sessions · 4,812 photos · 96.2 GB · 12 min [Show plan] [ Import ▶ ] │ +│ a known card is inserted │ │ +``` + +- Devices list: removable volumes and any volume with `DCIM`; identity = volume serial + + label + capacity, camera identity from the first file; known cards show their nickname + and profile; unknown cards prompt for a nickname (one field). +- Plan before touching disk: sessions, folders to be created, first three file names, + duplicates already in the archive (by hash), disk space check. +- Copy with hash while streaming; verify by re-reading destination; only then delete or + format (OS dialog); eject via `IOCTL_STORAGE_EJECT_MEDIA` after `FSCTL_LOCK_VOLUME`. +- Destination "Server" streams frames through the client to the server (§14.4); the + server confirms each hash before the client counts it as imported. +- Auto-import on insertion (per card), with the OS toast "Card X detected — Import". + +### 12.5 Archive manager + +``` +│ [Archive: D:\TitanoArchive ▾] [Scan] [Rebuild index] [Verify] [Duplicates] [Orphans] [Adopt folder…] [Maintenance ▾] │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ 618,204 photos · 412 sequences · 9.4 TB · 14 cameras · 2019–2026 │ +│ ▆▇█▅▂▁▃▆ photos per month (heatmap) ██████░░ storage by year ▉▉▉▍ by camera ▉▉▎ by format │ +│ Index health: ✓ sidecars 412/412 · ⚠ 3 sequences without proxies · ⚠ 1 unverified since 90 days │ +│ Recent maintenance: 2026-09-20 verify ✓ · 2026-09-01 vacuum ✓ │ +├──────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Mass operations on filtered set (412): [Analyse] [Proxies] [Thumbnails] [Verify] [Move] [Retag] [Export CSV] [Delete] │ +``` + +Operations: **Scan** (incremental, mtime/size), **Rebuild index** (from sidecars; falls +back to full metadata scan; never deletes originals), **Verify** (hashes; bit-rot report), +**Duplicates** (by hash across sequences), **Orphans** (files not indexed / rows without +files, with fix actions), **Adopt folder** (index an existing tree in place or copy into +the layout), **Merge/split sequences**, **Move archive** (relink), **Maintenance** +(SQLite vacuum/backup/restore, cache cleanup, proxy purge/rebuild, thumbnail pack +compaction, log rotation). Statistics drawn with in-house chart elements. Every operation +is a Job (resumable, cancellable, logged). + +### 12.6 Jobs + +Queue + history table: kind, target, progress, fps, ETA, node, state; pause/resume/cancel/ +retry; log tail on expand; filters. Global job bar mirrors the active job. + +### 12.7 Server (client side) + +``` +│ Server [https://nas.local:8443 ……] [Connect] Status ● Connected · v1.3 · TLS fingerprint 9A:… (trusted 2026-09-01) │ +│ Signed in as alberto · Editor · 2.1 TB of 5 TB used [Sign out] │ +│ [✓] Offer this PC as render node (NVENC HEVC/H.264, AV1) [✓] Keep proxies of synced sequences offline │ +├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ Sequence Local Server State Action │ +│ Harbour sunset ✓ originals ✓ in sync — │ +│ Comet 2026-08-13 ✓ originals ✗ local only [Upload] │ +│ Construction cam wk 38 proxies ✓ remote [Download originals] [Open with proxies]│ +``` + +First connection shows the certificate fingerprint (trust-on-first-use); login modal; +per-sequence sync actions and states; conflict resolution only for settings JSON (keep +mine / take server / save both). + +### 12.8 Settings + +Sections (list on the left, controls on the right, no descriptions — tooltips only): +General (language, theme, startup, notifications), Archive (root, templates, proxy policy, +thumbnail size, network polling), Import (defaults, session rules, verify, post-actions), +Analysis (widths, thresholds, deep analysis auto-run), Rendering (quality profile, memory +budget, spill folder, parallelism, encoders detected, hardware preference), Formats (per +format tier on this PC, codec install links), Server (last servers, trusted fingerprints, +render node), Updates (check on start), Advanced (portable mode, logs, database backup/ +restore, reset). Import/export settings as JSON. + +### 12.9 About + +Version, build, licence/EULA link, third-party notice (none), diagnostics bundle button +(zips logs + environment report), update check. + +--- + +## 13. Card import — behaviour details + +- Detection: `WM_DEVICECHANGE` (`DBT_DEVICEARRIVAL`/`REMOVECOMPLETE`) + `DriveInfo` poll + fallback; card identity `{volumeSerial}-{label}-{capacity}`; camera identity from EXIF + Make/Model/BodySerial of the first image found. +- Card pool (`media_cards`): nickname, profile, history; profiles copyable; a card can + inherit a "camera profile" (rules shared by all cards of that camera). +- Session detection: gap > `SessionGapMinutes`; groups with < `MinimumSessionFrames` merge + into the previous session (test shots); each session becomes a sequence; the user can + merge/split in the plan. +- Duplicate handling: hash lookup against the archive index (skip/rename/overwrite); + "already imported" state remembered per card + file (path, size, mtime) for fast + re-inserts. +- Rename during import: templates (§7.1) with live preview; original name kept in the + sidecar. +- Post-actions: keep / delete imported files (only those verified) / format card (OS + dialog) / eject; run deep analysis automatically (default on, background, low priority). +- Failure handling: card removed mid-copy → partial files deleted, plan resumable on + re-insert; errors listed per file, never a modal per error. + +--- + +## 14. Titano Server + +### 14.1 Stack + +ASP.NET Core minimal API on Kestrel (`Microsoft.AspNetCore.App` shared framework, no +packages), `System.Text.Json` source-generated contexts from `Titano.Protocol`, WebSockets +for events, in-house structured file logging (`Microsoft.Extensions.Logging` abstractions +are part of the shared framework; the file provider is in-house), in-house rate limiting for +login and uploads, health endpoint, graceful shutdown (jobs checkpoint). + +### 14.2 Security + +- TLS: `auto` (self-signed cert generated at first start with `CertificateRequest`, stored + in `/data/tls`, fingerprint printed in logs and shown in admin), `pem` (cert + key + paths), `proxy` (HTTP behind a reverse proxy, `ForwardedHeaders` middleware, admin warns + if not local). +- Passwords: PBKDF2-SHA512, ≥ 210,000 iterations, 16-byte salt, versioned hash format; + minimum length 10; admin-created users get `mustChangePassword`. +- Tokens: 32 random bytes, stored as SHA-256, `Authorization: Bearer`; sliding expiry + (default 30 days), per-client name, revocation list; web admin uses an `HttpOnly; Secure; + SameSite=Strict` cookie session + double-submit CSRF token. +- Authorization: roles admin/editor/uploader/viewer + permission bits; sequence ownership; + admin-only management endpoints; path traversal impossible (ids → paths via DB only). +- Limits: max upload size, chunk size (default 8 MiB), per-user quota, request timeouts, + login rate limit (5/min/IP), audit log. + +### 14.3 API v1 (JSON; errors as `{ code, message, details }`; `X-Titano-Api: 1`) + +``` +POST /api/v1/auth/login {username,password,clientName} → {token,user,mustChangePassword} +POST /api/v1/auth/logout · POST /auth/password · GET /auth/me +GET /api/v1/server/info name, version, apiVersion, capabilities, tlsFingerprint, formats, limits +GET /health + +GET /api/v1/users · POST · GET/PATCH/DELETE /users/{id} · POST /users/{id}/reset-password (admin) + +GET /api/v1/sequences?year&camera&status&tag&q&cursor&limit +POST /api/v1/sequences create (title, camera hint) → id +GET /api/v1/sequences/{id} · PATCH (title, tags, rating, settings) · DELETE +GET /api/v1/sequences/{id}/manifest frames with hashes/sizes/versions (sync) +GET /api/v1/sequences/{id}/analysis · GET /stats · GET /renders +GET /api/v1/sequences/{id}/frames?cursor&limit +GET /api/v1/frames/{id}/original · /proxy · /thumb (streamed, Range supported) + +POST /api/v1/uploads {sequenceId|null, fileName, size, sha256, capturedAt?} → {uploadId, chunkSize, received[]} | 200 {alreadyExists} +PUT /api/v1/uploads/{id}/chunks/{n} body bytes (idempotent) → {received} +POST /api/v1/uploads/{id}/complete → frame id (server verifies sha256, commits into layout, updates manifest) +GET /api/v1/uploads/{id} resume state +DELETE /api/v1/uploads/{id} + +GET /api/v1/jobs?state · POST /jobs {kind, target, params} · GET /jobs/{id} · POST /jobs/{id}/cancel · /retry +WS /api/v1/events {type: jobProgress|jobState|sequenceChanged|cardEvent|nodeState, …} + +POST /api/v1/nodes/register · POST /nodes/{id}/heartbeat · POST /nodes/{id}/claim → job · POST /nodes/{id}/jobs/{jobId}/result (chunked upload of output) + +GET/PUT /api/v1/archive/settings · POST /archive/scan · /rebuild · /verify · GET /archive/stats · POST /archive/maintenance (admin) +GET /api/v1/i18n/{culture} strings for the web admin +``` + +### 14.4 Upload and ingest + +Client computes SHA-256 while reading; `POST /uploads` short-circuits if the hash exists; +chunks are written to `/data/uploads/{id}.part` with a received-bitmap; `complete` verifies +the hash, moves the file into `originals/` under the layout templates (temp → fsync → +rename), extracts metadata, appends to `sequence.json`, inserts the DB row, enqueues +thumbs/proxies/light analysis, emits `sequenceChanged`. Frames without a target sequence +are grouped by the same session rules (§13) into auto-created sequences. Card imports from +a connected client use exactly this path. + +### 14.5 Sync + +Manifest diff per sequence: originals are content-addressed (never conflict); settings and +tags carry version counters (last-writer-wins with an explicit conflict prompt in the +client when both changed); proxies/thumbs are regenerable and never synced upward; renders +are uploaded on request. "Edit with proxies, render where the originals are": a client can +open a remote sequence with proxies only and submit a render job to the server, which runs +it itself (managed formats) or hands it to a render node. + +### 14.6 Job engine + +Persistent queue in the DB; N worker threads (configurable, default = cores/2); job kinds +in §5; checkpoints every 5 s (progress + resumable cursor); crash-safe restart; priorities +(user-initiated > background analysis); cancellation cooperative; logs per job; retention +of history 90 days. + +### 14.7 Render nodes + +A Titano client with "Offer this PC as render node" registers its encoder capabilities +and polls/claims render jobs matching them, downloads what it needs (proxies or originals +per job settings), renders with its GPU, uploads the result as a render of the sequence. +Node state shown in admin › Jobs; the server falls back to managed formats when no node is +available and says so in the job log. + +### 14.8 Admin web panel (`/admin`, vanilla HTML/CSS/JS, ES modules, no build step, same API) + +``` +┌─────────────┬────────────────────────────────────────────────────────────────────────────┐ +│ Titano │ Dashboard │ +│ ● Dashboard │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ +│ Users │ │ 9.4 TB │ │ 412 seq │ │ 3 jobs │ │ 2 nodes │ │ +│ Archive │ │ of 16 TB │ │ 618k pho │ │ running │ │ online │ │ +│ Jobs │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ +│ Settings │ Storage by year ▁▂▃▅▇█ Uploads last 30 days ▂▁▃▆▇▅▂ │ +│ Logs │ Recent: alberto uploaded 1,020 frames · node "studio-pc" rendered 4K HEVC │ +│ About │ │ +└─────────────┴────────────────────────────────────────────────────────────────────────────┘ +``` + +Pages: Login · Dashboard · Users (table; create/edit/disable/reset/roles/quota) · Archive +(path, templates, proxy policy, scan/rebuild/verify, stats) · Jobs (queue/history/nodes, +cancel/retry) · Settings (server name, ports, TLS mode + fingerprint, discovery, limits, +language, retention) · Logs (tail, download) · About. Same UI rules: tooltips only, light/ +dark, localised via `/api/v1/i18n`, keyboard accessible. + +### 14.9 Configuration and Docker + +Environment variables (also readable from `/data/server.json`): +`TITANO_ADMIN_USER`, `TITANO_ADMIN_PASSWORD` (used only when no admin exists; forced change +at first login), `TITANO_ARCHIVE_PATH=/archive`, `TITANO_DATA_PATH=/data`, +`TITANO_DB=postgres|sqlite` (Linux: postgres only), `TITANO_DB_HOST`, `TITANO_DB_PORT=5432`, +`TITANO_DB_NAME`, `TITANO_DB_USER`, `TITANO_DB_PASSWORD`, `TITANO_DB_SSLMODE=prefer`, +`TITANO_HTTP_PORT=8080`, `TITANO_HTTPS_PORT=8443`, `TITANO_TLS_MODE=auto|pem|proxy`, +`TITANO_TLS_CERT`, `TITANO_TLS_KEY`, `TITANO_SERVER_NAME`, `TITANO_LANG=en`, +`TITANO_WORKERS`, `TITANO_DISCOVERY=true` (LAN UDP beacon), `PUID`, `PGID`, `TZ`. + +Dockerfile: multi-stage on `mcr.microsoft.com/dotnet/sdk:10.0` → `aspnet:10.0`, non-root +user via `PUID/PGID` entrypoint, volumes `/archive` and `/data`, `HEALTHCHECK` on +`/health`, `linux/amd64` + `linux/arm64`. `docker-compose.yml` with a PostgreSQL 17 service. +Windows: `Titano.Server.exe` runs as console or Windows Service (`sc create`), SQLite or +PostgreSQL. + +--- + +## 15. Titano Uploader + +Single small window (tray-capable), zero analysis: connect + sign in (token saved with +DPAPI), drop zone (files/folders/cards), queue with per-file state, pause/resume, bandwidth +limit, retry with backoff, resumable across restarts (queue persisted in a JSON file next to +the app data), hash verification, optional "delete source after server confirms" (off by +default, confirmation), watch folders (poll + `FileSystemWatcher` where reliable; upload +new files after they stop growing), run at startup, minimise to tray, per-session target +(auto-group / choose sequence / new sequence with title). P2: "make proxies here" toggle +for HEIC/RAW so the server can render without a node. + +``` +│ Titano Uploader ☁ https://nas.local:8443 · alberto · ● Connected [⚙] │ +│ ┌────────────────────────────────────────────────────────────────────────────────┐ │ +│ │ Drop photos, folders or a card here │ │ +│ └────────────────────────────────────────────────────────────────────────────────┘ │ +│ Target (•) Group into sessions automatically ( ) Sequence [Harbour sunset ▾] ( ) New │ +│ Queue 4,812 files · 96.2 GB · 38 MB/s · 41 min left [⏸] [⏹] Limit [50] MB/s │ +│ ▮▮▮▮▮▮▮▮▮▮▮▮▮▮░░░░░░░░░░░░░░░░ 2026-09-28_18-02-11_0413.CR2 │ +│ Watch folders D:\Cam\Roof (every 60 s) ● [+] │ +│ [✓] Delete source after verified upload [✓] Start with Windows │ +``` + +--- + +## 16. Localization + +- Source strings in `i18n/en/*.resx` (one file per area: `Shell`, `Library`, `Editor`, + `Import`, `Archive`, `Server`, `Settings`, `Tooltips`, `Errors`, `Advisor`, `Admin`). + Keys are stable identifiers (`Library.Filter.Year`), never English sentences. +- Runtime: `ResourceManager` + a `Loc` XAML markup extension and `L("key", args)` helper in + `Titano.Core/Localization`; culture switch at runtime without restart (rebinding via a + `LocalizationChanged` event); web admin receives `/api/v1/i18n/{culture}` generated from + the same resx by `Titano.Tools i18n export`. +- Plurals: an in-house minimal CLDR plural-rule table for the shipped languages + (`one/few/many/other`), keys with suffixes (`Photos.Count.one`, `.other`). +- Dates/numbers/units via `CultureInfo`; file sizes localised; RTL via `FlowDirection` + for `ar`, `he`, `fa`, `ur` (mirrored rail and icons where directional). +- Languages (Phase 8, all machine-translated by Claude Code with a glossary, marked as such + in About and open to community review via the public releases repo): `en` (source), `it`, + `de`, `fr`, `es`, `pt-BR`, `pt-PT`, `nl`, `pl`, `cs`, `sk`, `hu`, `ro`, `sv`, `da`, `nb`, + `fi`, `ru`, `uk`, `tr`, `el`, `bg`, `hr`, `sl`, `lt`, `lv`, `et`, `ja`, `zh-Hans`, + `zh-Hant`, `ko`, `ar`, `he`, `hi`, `id`, `ms`, `vi`, `th`. Add more if effort allows. +- `Titano.Tools i18n check` fails CI when a key is missing in `en` or `it`, when a + placeholder count differs between languages, or when a string exceeds the layout budget + (tooltips ≤ 200 chars, labels ≤ 30 chars unless flagged). +- UI is written to survive +40 % text expansion (German, Finnish): no fixed-width labels. + +--- + +## 17. Branding and icon + +- Mark: a **time-lapse aperture-clock** — a circle of 12 short arc segments increasing in + opacity clockwise (the sequence of frames) around a solid sun disc slightly off-centre, + reading as camera aperture, clock and sun path at once; single accent colour on a rounded + square (dark) tile; no text. Works at 16 px (segments merge into a ring; the disc + remains). +- Generated programmatically (`Titano.Tools make-icon`): in-house PNG encoder + ICO + container (16/20/24/32/48/64/128/256), SVG source kept in `branding/`; variants: Server + (mark + three horizontal bars badge), Uploader (mark + up-arrow badge). Also favicon + for the admin panel and a 1024 px PNG for listings. Prototype `IconGenerator` shows + the ICO writer approach. +- App name in title bar only; no splash screen; first-run screen is the empty Library + with one sentence and two buttons (Import a card · Open an archive). + +--- + +## 18. Installer, distribution and updates + +- Builds: `dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true + -p:PublishReadyToRun=true` for App, Uploader, Setup; server as framework-dependent + Docker image and a self-contained Windows zip/installer. (No trimming: WPF does not + support it.) +- `Titano.Setup` (in-house, WPF, ~one screen): choose components (Titano, Uploader, + Server for Windows), folder, shortcuts, file associations (`.titano` project bundles), + installs to `%LOCALAPPDATA%\Programs\Titano` per user (no admin) or `Program Files` + (elevated), registers Add/Remove Programs entry with uninstaller, silent mode + (`/S /DIR=`), upgrade in place, keeps user data. Payload appended to the setup exe as a + compressed archive (in-house format on `DeflateStream`) with a manifest and per-file + hashes. If the human later permits a build-time tool, Inno Setup/MSIX are acceptable + alternatives; default is in-house. +- Code signing hook in the release workflow (`signtool` from the Windows SDK) using + secrets when present; unsigned builds are still produced. +- Updates: on start (opt-out) the client calls the GitHub Releases API of the **public + releases repository** (§19.4) and shows a one-line notice with "Download" (P1: download + installer, verify SHA-256 from `SHA256SUMS`, run it). +- Distribution: installers and `SHA256SUMS` on the public releases repo; Docker images on + GHCR (public package); Unraid template in the public repo. + +--- + +## 19. CI/CD, Docker, Unraid + +### 19.1 `ci.yml` (push, PR) + +Matrix `windows-latest` / `ubuntu-latest`: `dotnet --info`, restore (no packages → fast), +build with warnings as errors, run `Titano.Testing` for all test projects (JUnit XML +uploaded and annotated), `dotnet format --verify-no-changes`, `Titano.Tools i18n check`, +XAML lint (App.Tests), zero-package guard, Docker build (no push) on ubuntu; PostgreSQL 16 +and 17 service containers for `Titano.Data.Tests`; CC0 RAW fixtures fetched by +`Titano.Tools fixtures` and cached (`actions/cache`). + +### 19.2 Zero-package guard + +`Directory.Build.targets` target `AssertNoPackageReferences` fails the build if any +`PackageReference` exists; CI also greps `**/*.csproj` and `**/*.props` and checks that +`obj/project.assets.json` lists no packages. Only `actions/*` and `docker/*` GitHub +Actions are used in workflows. + +### 19.3 `release.yml` (tag `v*`) + +Version from the tag → `Directory.Build.props`; publish self-contained binaries; build +`Titano-Setup-.exe`, `Titano-Uploader-Setup-.exe`, `Titano-Server-win-x64-.zip`; +sign if secrets present; generate `SHA256SUMS` and the changelog (`Titano.Tools changelog` +from Conventional Commits); build and push multi-arch Docker image to +`ghcr.io//titano-server:` and `:latest`; create the GitHub Release **in the +public releases repository** with `gh release create` (the `gh` CLI is preinstalled on +runners) using a fine-grained PAT stored as `RELEASES_TOKEN`; copy `deploy/unraid/ +titano.xml` and EULA there. + +### 19.4 Public releases repository + +Because release assets of a private repository are not publicly downloadable, a second, +public repository (`titano-releases`) holds only: README (what it is, screenshots, +requirements), EULA/LICENSE, release assets, `SHA256SUMS`, Unraid template, `i18n/` +translations for community review, and issues. The private repo publishes into it; nothing +is developed there. The GHCR package is set to public visibility. + +### 19.5 `docker.yml` + +Nightly build of `main` to `ghcr.io//titano-server:nightly`; `deploy/docker/ +docker-compose.yml` for users (server + PostgreSQL + volumes). + +### 19.6 Unraid template (`deploy/unraid/titano.xml`) + +Community Applications XML: repository `ghcr.io//titano-server:latest`, WebUI +`http://[IP]:[PORT:8080]/admin`, ports 8080/8443, paths `/archive` → `/mnt/user/Timelapse`, +`/data` → `/mnt/user/appdata/titano`, variables from §14.9 (admin user/password, DB +host/port/name/user/password, TLS mode, PUID/PGID, TZ), icon URL from the public repo, +support/project links, description ≤ 2 sentences. Document (in the public README) how to +add the template repository URL in Unraid and to pair with the official PostgreSQL +template. + +--- + +## 20. Testing and quality + +### 20.1 `Titano.Testing` (in-house) + +Attributes `[Test]`, `[Theory]` + `[Case(...)]`, `[Skip(reason)]`, `[Timeout(ms)]`, +`[Category]`; assertions with expressive messages (`Assert.Equal`, `Approximately`, +`Throws`, `SequenceEqual`, `Monotonic`, `Within(px)`); fixtures (temp dirs, synthetic +sequences, in-process server, database per test); parallel execution; filters by name/ +category; console output + JUnit XML; exit codes; `dotnet run --project tests/X -- --junit +out.xml --filter core`. + +### 20.2 Test layers + +- Unit: parsers (fuzz corpus: truncated/garbage files must not throw), codecs (round-trip + PSNR thresholds), analysis rules (synthetic sequences with known answers — port the + prototype's 63-check self-test as tests), naming templates, SQL repositories (SQLite + in-memory), PostgreSQL wire client (against service container), protocol (chunk resume, + hash mismatch, idempotency), advisor recommendations (golden JSON). +- Integration: import a synthetic card folder → archive layout + sidecars + DB; rebuild + index from sidecars equals original DB; verify detects a flipped byte; server ingest via + API; sync round trip; render node claim/complete; job resume after simulated crash. +- Windows: WIC decode of fixtures, Media Foundation encode smoke (software H.264) + + in-house MP4 inspector + `MediaPlayer` playback check; `--capture` screenshots of every + screen for visual regression (pixel-diff tolerance) and for the phase report. +- Fixtures: tiny synthetic files checked in; CC0 RAW samples (one per major format, from a + public CC0 sample set) fetched by `Titano.Tools fixtures` into `tests/fixtures/external` + (git-ignored, CI-cached). + +### 20.3 Static rules + +Warnings as errors; nullable enabled; `dotnet format`; XAML lint: every `Button`, +`ToggleButton`, `Slider`, `ComboBox`, `CheckBox`, `MenuItem` has a `ToolTip`; no literal +`Content="…"`/`Text="…"` outside resources; no `PackageReference`; no Windows APIs in +`Titano.Core`/`Titano.Data`/`Titano.Protocol`/`Titano.Server` (checked by building them on +Linux); public API of `Titano.Protocol` versioned. + +### 20.4 Quality gates carried over from the prototype (regression thresholds) + +Deflicker: flicker reduction ≥ 60 % on the synthetic ramp sequence with the ramp preserved +within 0.05 EV; region deflicker: landscape residual ≤ 25 % of the global-curve residual; +phase correlation: sub-pixel error ≤ 0.10 px; stabilization on a textureless frame: shake +≤ 0.1 px (texture gating); holy grail: no step > 0.3 EV in the target curve; time remap +monotonic; star-trail luminance non-decreasing on ≥ 99 % of steps; memory: peak RSS +independent of sequence length for a fixed window; cancellation: no partial output, no +unobserved exceptions, spill file removed. + +--- + +## 21. Monetization — absolute final step (Phase 9; do not start before every gate passed) + +- In-house ad delivery, no SDK, no tracking by default: the client fetches a signed + campaign manifest (JSON: id, image URL, link, weight, languages, countries, start/end, + minimum version) from `https://.github.io/titano-releases/ads/manifest.json` + (or a URL set by the human), caches creatives, renders them natively in one slot — the + Export section while a render runs (prototype rationale: the only moment an ad takes + nothing from anyone) — and optionally a small footer slot in Library. Clicks open the + browser. Manifest signature: ECDSA P-256 with an embedded public key. +- Consent: first-run one-line choice for anonymous impression counting (off by default); + when on, a daily aggregated ping (version, language, country from OS locale, counts) — + no identifiers. Privacy policy link in About and EULA. +- Ad-free: "Titano Pro" licence key (ECDSA-signed, offline validation, tied to a display + name and edition, no phone-home) entered in Settings › Licence; a server licence makes + all its connected clients ad-free (team scenario). Fallback content when the manifest + is empty: internal tips about the program. +- Everything above is a toggle in Settings for the human's own builds; the feature ships + disabled by default until the human flips a build property `TitanoAdsEnabled=true`. + +--- + +## 22. Phased delivery plan + +Each phase ends with the Definition of Done (§0.2 rule 9) and a phase report. Phases may be +split into sub-phases; order inside a phase is Claude Code's choice. + +### Phase 0 — Bootstrap (repo, rules, shells) +Solution, `Directory.Build.*`, `global.json`, `CLAUDE.md`, `DECISIONS.md`, `CHANGELOG.md`; +`Titano.Testing`; zero-package guard; `ci.yml`; i18n infrastructure with `en` + `it`; +WPF shell (rail, theme, job bar, status strip, settings skeleton, tooltip lint); server +skeleton (Kestrel, `/health`, `/server/info`, login page, admin shell); Dockerfile builds; +branding mark + ICO generator. +*Gate:* both apps start, server container answers `/health`, CI green on both OSes. + +### Phase 1 — Metadata and imaging core +Parsers (§9), managed codecs (§8.3), WIC provider, decode tiers, thumbnails/proxies, +`ImageBuffer`/`FrameWindow` port, fixtures tool, fuzz tests, DNG full pipeline. +*Gate:* every fixture decodes at the expected tier on Windows and Linux; PSNR/round-trip +tests green; `Titano.Tools diagnose ` reports per-file tier and metadata. + +### Phase 2 — Data layer and archive +SQLite binding, PostgreSQL wire client, migrations, repositories, archive layout, sidecars, +scanner, rebuild, verify, duplicates, orphans, adopt folder, naming templates. +*Gate:* import synthetic 100k-frame archive; rebuild equals original; verify detects +corruption; PG tests green against 16 and 17. + +### Phase 3 — Client Library and Archive manager +Virtualized grid/list/timeline, filters, saved views, mass operations, jobs screen, stats +charts, maintenance, settings screens, `--capture` screenshots. +*Gate:* 500k-photo synthetic library meets §1.1 timings. + +### Phase 4 — Card import +Device detection, card pool and profiles, plan preview, sessions, hash-verified copy, +post-actions (delete/format/eject), auto-import, direct-to-server destination stub. +*Gate:* end-to-end import from a simulated card folder; destructive actions gated by +verification; screenshots. + +### Phase 5 — Analysis advisor +Light + deep analysis, reports, charts, recommendations with reasons, auto presets, +Auto/manual controls, Optimise. +*Gate:* golden recommendations for synthetic sequences; every recommendation has a +localised reason; deep analysis of 10k frames completes unattended. + +### Phase 6 — Engine, encoding and Sequence editor +6a modules port with regression thresholds (§20.4); 6b Media Foundation encoder, MP4 muxer +(H.264/HEVC/AV1), managed encoders (AVI/GIF/APNG/sequences), presets; 6c preview tools, +section charts, spline editor, export UI, batch render. +*Gate:* self-test suite green; renders play in Windows Media Player and the in-house +inspector validates containers; hardware MFT used when present (logged). + +### Phase 7 — Server, sync, uploader +Full API, auth, uploads/ingest, sync, jobs, render nodes, admin panel, Docker + compose, +client server mode, Uploader app, LAN discovery. +*Gate:* two clients + uploader against a Docker server: upload, sync, render via node and +via server; crash-restart resumes jobs; audit log complete. + +### Phase 8 — Worldwide release readiness +All languages (§16), RTL pass, installer, `release.yml`, public releases repo bootstrap +(README, EULA draft, template), Unraid template, update check, diagnostics bundle, +accessibility pass, performance pass, docs. +*Gate:* tagged pre-release published end-to-end from CI; install/uninstall/upgrade tested; +Unraid template validated. + +### Phase 9 — Monetization (§21) +*Gate:* human explicitly approves start; feature behind build property; privacy text done. + +--- + +## 23. Assumptions and open decisions (for the human; do not block on these) + +1. Product name **Titano** kept from the prototype — rename before Phase 0 if desired + (repo-wide rename later is costly). +2. Linux server MP4 output relies on render nodes (and P2 intra-only encoder). If an + FFmpeg subprocess were ever allowed as an *optional, opt-in* backend, it would be a + single `IVideoEncoderProvider`; not planned unless the human approves. +3. HEIC pixels are only decodable on Windows (WIC); server-side rendering of HEIC-only + sequences requires proxies from a client/node. +4. Native RAW decoders beyond DNG are phased (CR2, NEF, ARW, PEF, ORF, RW2, RAF + uncompressed first); until then those formats render from full-size embedded previews + on the server and via WIC + Raw Image Extension on Windows. +5. Windows 10 21H2+/Windows 11, x64 only (ARM64 later); `winsqlite3.dll` presence assumed. +6. Tests use the in-house runner to keep the zero-package rule absolute; xUnit would be + acceptable only if the human relaxes the rule for test projects. +7. Installer is in-house; Inno Setup/MSIX acceptable if the human allows build-time tools. +8. Ads and licence keys are designed but disabled by build property until Phase 9. + +--- + +## Appendix A — `CLAUDE.md` content (create verbatim in Phase 0, keep updated) + +```markdown +# Titano — working rules +Read docs/BRIEF.md when in doubt; it wins over these notes. +- Zero . Anything not in the .NET BCL / Microsoft shared frameworks / OS APIs is written here. +- No external processes at runtime (no ffmpeg, exiftool, powershell). Only OS dialogs listed in BRIEF §8.6. +- Titano.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. +- English identifiers, comments, commits (Conventional Commits). Prototype in docs/reference is Italian: port algorithms, not language. +- Every UI string is a resource (en source, it translation). Labels ≤ 3 words; explanations only in tooltips; every actionable control has a tooltip; no helper paragraphs. +- Destructive operations: dry-run plan first, hash verification, explicit user action. +- When the brief is silent: choose the simplest safe option, log it in docs/DECISIONS.md, continue. Ask only at phase gates or before irreversible choices. +- Definition of Done per phase: green on windows-latest + ubuntu-latest, tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". +- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Titano.Tools -- . +- Current phase and next steps: see docs/STATUS.md (update at every gate). +``` + +## Appendix B — Prototype module map (grep targets in `docs/reference/titano-prototype.md`) + +| Prototype (Italian) | New home | Notes | +|---|---|---| +| `Metadata/TiffDirectory, TiffPrimitives, MetadataReader, XmpScanner, FrameMetadata` | `Core/Metadata` | extend with BMFF/RIFF/RAF walkers, MakerNotes | +| `Imaging/WicInterop, ImageDecoder` | `Core.Windows/Wic` | keep pull-based scaling chain | +| `Imaging/ImageBuffer, ColorSpace, GeometryStage, RasterWriter, OrientationDetector` | `Core/Imaging` | RasterWriter → `Codecs/TiffWriter`, `LinearDngWriter` | +| `Analysis/*` (LuminanceAnalyzer, DeflickerEngine, RegionSegmenter, HolyGrailEngine, ExposureProcessor, ColorScience) | `Core/Analysis` | keep validated behaviour + tests | +| `Motion/*` (Fourier, PhaseCorrelator, GrayPyramid, OpticalFlowEngine, MotionField, MotionBlurRenderer, Stabilizer, VirtualCamera, TemporalStacker, FrameInterpolator) | `Core/Motion` | | +| `Core/Spline, LocalRegression, TimelapseSequence, FrameRecord` | `Core/Math`, `Core/Sequences` | | +| `Pipeline/RenderPlan, RenderPipeline, FrameWindow, AutoDirector, AutoOptimizer, SequenceWarnings` | `Core/Render`, `Core/Advisor` | AutoDirector/Optimizer → advisor rules with reasons | +| `Pipeline/MediaImporter, PathTemplate` | `Core/Import`, `Core/Naming` | tokens translated to English | +| `Video/MediaFoundationInterop, VideoEncoderSession, Nv12Converter, CodecLimits` | `Core.Windows/MediaFoundation` | add P010, AV1, capability enumeration | +| `Video/Mp4Muxer, BoxWriter, AnnexBParser, ExportPresets, ExportSettings` | `Core/Video`, `Core/Export` | add `av1C`, new presets | +| `Diagnostics/SelfTest, SyntheticSequence, SequenceDiagnostics, Mp4Inspector, Mp4Playback, AdvancedModuleTests, ExifWriter, IconGenerator, CrashGuard` | `tests/*`, `Titano.Tools`, `Core/Diagnostics` | 63 checks → tests | +| `UI/*` (WinForms) | not ported | reuse only the interaction ideas (rail, preview tools, Auto indicator, presets) | +| `UI/SponsorPanel` | Phase 9 only | | + +## Appendix C — Glossary + +Sequence (a shoot: one folder of frames = one project) · Frame (one photo) · Hero frame +(thumbnail of the sequence) · Light/Deep analysis · Advisor (rule engine producing +recommendations with reasons) · Tier (how a frame's pixels are obtained) · Proxy (JPEG +stand-in) · Sidecar (`sequence.json` manifest) · Render (an exported video) · Preset +(bundle of export values) · Sequence preset (project settings + export preset produced by +the advisor) · Render node (client lending its GPU to the server) · Job (any long +operation, resumable) · Card profile (import rules for a memory card). diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md new file mode 100644 index 00000000..ab7f9c76 --- /dev/null +++ b/docs/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes. Format: Keep a Changelog; versions follow SemVer; commits follow Conventional Commits. + +## [Unreleased] + +### Added +- Repository foundation: solution, build rules (warnings as errors, zero-package guard), .NET 10 SDK pin. +- `Titano.Testing`: in-house test framework and runner with JUnit XML output and GitHub annotations. +- Localization runtime (`Loc`, CLDR plural rules, 38 shipped languages), `en` + `it` catalogs, `i18n check/export`. +- Brand mark geometry, SDF rasteriser, PNG encoder, ICO writer and `make-icon` (program icons generated at build time). +- Core contracts: image buffers and decoder providers, video encoder providers, domain model, TIFF/IFD reader, sRGB helpers, atomic file writes, logging. +- `Titano.Ui` design system: DESIGN.md tokens (dark/light), 100+ stroke icons, styles for every standard control, custom chrome window with snap layouts, navigation rail, job bar, Auto/manual slider, chips, status glyphs, toasts, empty states. +- Titano desktop shell: rail, job bar, status strip, sections, Settings (language, theme) and About; `--capture` screenshot mode. +- Titano Server skeleton: configuration from environment/`server.json`, self-signed TLS with fingerprint, `/health`, `/api/v1/server/info`, `/api/v1/i18n/{culture}`, embedded admin panel (login, dashboard). +- Docker image (multi-arch, PUID/PGID, health check), compose file with PostgreSQL 17, Unraid template. +- CI (Windows + Linux build/test, PostgreSQL 16/17, Docker smoke test, screenshots, Windows program artifacts), release and nightly image workflows. diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md new file mode 100644 index 00000000..e26e4dd6 --- /dev/null +++ b/docs/DECISIONS.md @@ -0,0 +1,125 @@ +# Decisions + +One line per decision: date · decision · alternative · reason. + +| Date | Decision | Alternative | Reason | +|---|---|---|---| +| 2026-10-02 | The prototype dump `docs/reference/titano-prototype.md` was not supplied; algorithms are implemented from the brief's descriptions and the cited literature, with the §20.4 thresholds as acceptance tests. | Wait for the dump | Not available in the repository or uploads; the brief fully specifies behaviour and gates. | +| 2026-10-02 | Custom WPF theme dictionaries (`Titano.Ui/Themes`) implementing DESIGN.md tokens instead of `Application.ThemeMode` Fluent. | Fluent theme + overrides | DESIGN.md fixes exact colours/sizes; Fluent is still flagged experimental (WPF0001) and would need restyling of most controls anyway (§2.1 permits in-house dictionaries). | +| 2026-10-02 | Added shared WPF library `src/Titano.Ui` (theme, icons, controls, `Loc` markup extension) used by App, Uploader and Setup. | Duplicate resources per app | One visual system for three programs. | +| 2026-10-02 | Added `tests/Titano.Core.Windows.Tests` for WIC / Media Foundation / DXGI tests. | Put them in App.Tests | Keeps engine interop tests independent of the WPF app. | +| 2026-10-02 | Localization areas extended with `Common`, `Jobs`, `Uploader`, `Setup`. | Fold into `Shell` | Smaller, owned files; same key scheme. | +| 2026-10-02 | Resources live in `i18n//[.].resx`, embedded into `Titano.Core` (satellite assemblies), base name `Titano.Core.i18n.`. Keys marked `invariant` need no translation. | Raw XML loader | Uses `ResourceManager` as the brief requires; satellites bundle into single-file publishes. | +| 2026-10-02 | Program icons (ICO) are generated at build time into `artifacts/icons` by `Titano.Tools make-icon`, invoked from `Directory.Build.targets`. | Commit generated ICO files | Brief forbids committing generated binaries and raster sources. | +| 2026-10-02 | In-house CRC-32 (`Titano.Core.Hashing.Crc32`). | System.IO.Hashing | That assembly is a NuGet package, not part of the shared framework. | +| 2026-10-02 | Windows projects target `net10.0-windows` (platform version 7.0) without a Windows SDK projection TFM; Windows 10 APIs are reached by P/Invoke/COM. | `net10.0-windows10.0.19041.0` | Avoids the CsWinRT projection; toasts use the in-window toast host plus tray balloon. | +| 2026-10-02 | Test projects use an explicit `TestMain` entry point. | Top-level statements | Avoids the `Program` type clash with the server's top-level program. | +| 2026-10-02 | SQLite P/Invoke binding lives in `Titano.Data` with a library resolver (winsqlite3 on Windows, system libsqlite3 elsewhere for tests/dev); the Linux server still refuses SQLite at configuration time. | Binding in Core.Windows only | Lets repository tests run on Linux CI against both dialects. | +| 2026-10-02 | Client preferences needed before the database opens (language, theme, window placement) are stored in `settings.json` next to the database. | Settings table only | Language and theme must apply before the first window appears. | +| 2026-10-02 | Server Windows-service hosting will use an in-house advapi32 P/Invoke host. | Microsoft.Extensions.Hosting.WindowsServices | That assembly is a NuGet package, not part of the shared framework. | +| 2026-10-02 | Admin panel files are embedded resources served by an in-house middleware with ETags and SPA fallback. | ManifestEmbeddedFileProvider | Its manifest generator ships in a NuGet package. | +| 2026-10-02 | Container health check runs `Titano.Server --healthcheck` (in-process HTTP probe). | curl/wget in the image | Keeps the runtime image free of extra tools. | +| 2026-10-02 | Container drops privileges with `setpriv` to PUID:PGID; `/data` is chowned, `/archive` only checked for write access. | Recursive chown of the archive | The archive may hold terabytes on NAS shares. | +| 2026-10-02 | Release workflow publishes to `RELEASES_REPO` (default `/titano-releases`) when the `RELEASES_TOKEN` secret exists, otherwise to this repository. | Fail without the token | First releases work before the public repository is set up. | +| 2026-10-02 | Release notes are generated by `Titano.Tools changelog` from `git log` piped on stdin. | Tool spawning git | Keeps the tool free of external process calls. | +| 2026-10-02 | CI `dotnet format` gate checks whitespace formatting. | Full style/analyzer verification | Analyzer rules already fail the build (warnings as errors); style preferences stay suggestions. | +| 2026-10-02 | Test runner exits 0 for a project with no tests and 2 when a filter matches nothing. | Always 2 | Empty projects during bootstrap are not failures; mistyped filters are. | +| 2026-10-02 | COM via `[ComImport]` + explicit `ReleaseComObject`; flat APIs via `LibraryImport`. | `[GeneratedComInterface]` | Deterministic release keeps files unlocked; the apps are not trimmed. | +| 2026-10-02 | WIC decodes to 64bppRGBA and linearises with the exact sRGB LUT (128bpp float only for float sources). | Always 128bppPRGBAFloat | WIC's integer→float gamma is not the exact sRGB curve and premultiplication darkens edges. | +| 2026-10-02 | Exif orientation is applied in managed code while de-interleaving. | `IWICBitmapFlipRotator` | Microsoft documents quadratic behaviour of the flip-rotator over scanline decoders. | +| 2026-10-02 | Volume watcher uses a hidden top-level tool window plus 3 s polling. | Message-only window | Message-only windows do not receive broadcast WM_DEVICECHANGE. | +| 2026-10-02 | Camera RAW is "native" via WIC only when the Raw Image Extension package is installed. | Decoder CLSID alone | The in-box RAW codec shares the CLSID but only reads embedded previews. | +| 2026-10-02 | HEVC/AV1 decoder presence is detected with `MFTEnumEx`. | Store package names | Also covers OEM and hardware decoders. | +| 2026-10-02 | Math code lives in `src/Titano.Core/Math` with namespace `Titano.Core.Mathematics`. | `Titano.Core.Math` | That namespace would shadow `System.Math` in every `Titano.Core.*` file. | +| 2026-10-02 | CCT = McCamy refined to the nearest Planckian point (Krystek, CIE 1960 uv), valid for \|Duv\| ≤ 0.02. | Plain McCamy | McCamy alone misses the 100 K gate above ~9000 K. | +| 2026-10-02 | Deflicker keeps (1 − strength)·ρ·S of a frame's deviation (ρ own Tukey weight, S window surviving fraction). | Blend by S only | S alone barely isolates outliers. | +| 2026-10-02 | LOWESS uses the k nearest valid samples with bandwidth = farthest distance + one spacing. | Fixed half-width | Constant sample count at sequence edges. | +| 2026-10-02 | Clock jump = backward step > 3× median interval or a ±1 h offset from cadence (DST); counts as one interval. | Any whole-hour step | Scheduled multi-hour pauses look the same. | +| 2026-10-02 | Time zone for solar labels: recorded offset → camera−GPS clock (15 min) → longitude/15 with a "time zone estimated" finding. | No day phases | Usable labels, honestly flagged. | +| 2026-10-02 | Holy-grail step is "received" when the detrended median jump ≥ 50 % of the metadata step (same sign); metadata amplitude is redistributed with smoothstep ramps lengthened until ≤ 0.3 EV/frame. | Measured amplitude | Flicker makes the measured jump noisy. | +| 2026-10-02 | Flicker fundamental = first autocorrelation peak within 80 % of the strongest; window ∈ [15, 151], odd. | Strongest peak | Avoids harmonics at fractional periods. | +| 2026-10-02 | Optical flow: dense pyramidal Lucas–Kanade with box filters, neighbour-flow correction, σ = 1 px pre-blur; grid step 4/2/1 px for Draft/Balanced/Best. | Farnebäck | Separable, SIMD-friendly, stable and as accurate on smooth motion. | +| 2026-10-02 | Phase correlation: Gaussian-shaped peak + log-parabola sub-pixel fit, both patches in one complex FFT. | Foroosh sinc fit | Exact for Gaussian peaks, half the FFT work. | +| 2026-10-02 | Stabiliser: noise-corrected texture gate, exhaustive pairwise similarity hypotheses (≤ 36) + weighted LS, path smoothed by Gaussian-weighted local linear regression (σ = 12). | RANSAC / plain Gaussian | Deterministic with nine patches; keeps intentional pans. | +| 2026-10-02 | Interpolation chooses velocities by forward–backward consistency with per-sample flow-agreement weights (τ = 3 px). | Super SloMo combination | Better at motion boundaries (36.8 vs 33 dB). | +| 2026-10-02 | Virtual-camera zoom is interpolated geometrically; trail length L ↦ decay 0.01^(1/L). | Linear zoom / half-life | Even perceived speed; the trail is gone at its stated length. | +| 2026-10-02 | Motion estimation, sharpness and noise use sRGB-encoded luminance. | Linear light | Shadows keep texture weight; less exposure dependence. | +| 2026-10-02 | Archive presets use 0.30 bpp (≈60 Mb/s at 4K24 HEVC 10-bit); share presets use the brief's per-codec defaults (0.10/0.07/0.05). | 0.07 bpp everywhere | An archive must survive later re-encoding; star fields are the hardest content. | +| 2026-10-02 | All metadata fallback chains (time, ISO, serial, lens, rating, size) live in `MetadataBuilder.Build`; parsers only collect candidates. | Fallbacks inside each parser | One place for priority rules; parsers are order-independent. | +| 2026-10-02 | `MetadataReader.Read(path)` throws when the file cannot be opened; malformed content becomes warnings (with a parser-fault safety net the fuzz tests require to stay unused). | Swallow everything | An unopenable file is not malformed input. | +| 2026-10-02 | HEIF `irot`/`imir` override Exif orientation (imir axis 0 = top↔bottom). | Exif first | HEIF decoders apply the transforms themselves; both would rotate twice. | +| 2026-10-02 | Main image size comes from the container's own size field (SOF, IHDR, ispe, VP8X, RAF crop record, RW2 borders, CR3 CMP1) before raster IFDs. | Always the largest raster IFD | That is what each container defines and what decoders output. | +| 2026-10-02 | Only MPF large-thumbnail entries count as previews; XMP date-only values are never used as capture times. | Every secondary image / midnight | Gain maps are not previews; midnight would be invented. | +| 2026-10-02 | Media Foundation interop uses `[GeneratedComInterface]` with explicit release; threads entering MF call `Win32Com.EnsureInitialized()` (MTA unless already STA). | `[ComImport]` like WIC | Hardware encoders stall when sample references wait for GC; source-generated COM does not initialise apartments, so it is done explicitly. | +| 2026-10-02 | MP4: 16-byte `free`+`mdat` placeholder rewritten to a 64-bit header past 4 GiB; negative composition offsets shifted to ctts v0 plus an edit list; parameter sets moved into avcC/hvcC; fast start on by default. | Always 64-bit mdat / ctts v1 | Small files stay maximally compatible; wider player support. | +| 2026-10-02 | GIF: Wu-criterion median cut, frame differencing against the source last drawn, identical frames merged by holding one back. | Plain median cut / diff against dithered output | Max palette error 37 → small; 945 KB → 52 KB at equal PSNR; exact delays. | +| 2026-10-02 | AVI always carries OpenDML indexes plus idx1 (1 GiB RIFF segments). | idx1 only | Files beyond 2 GB stay playable. | +| 2026-10-02 | MF encoder capabilities: software H.264 ≤ 4096×2304, hardware assumed 4096² (H.264) / 8192² (HEVC/AV1); an unsupported size fails at media-type negotiation and the next encoder is tried. | Querying limits | MF has no reliable capability query. | +| 2026-10-02 | Full-size JPEG IDCT is a port of libjpeg's accurate integer IDCT (bit-identical to djpeg); reduced-size (1/2–1/8) decoding uses float IDCTs with triangle chroma upsampling. | SIMD float IDCT everywhere | Float produced rare ±3 differences after YCbCr; reduced sizes gain 6.7 dB with triangle upsampling. | +| 2026-10-02 | Codecs throw only `InvalidDataException` for bad structure or unsupported features; damaged scan data yields a partial image plus warnings. | NotSupportedException for features | One exception type for callers and fuzzing. | +| 2026-10-02 | Linear DNG export: raw image in IFD0, lossless-JPEG tiles, ColorMatrix1 + ForwardMatrix1 for Rec.709 D65; source camera Make/Model kept when Exif is supplied. | Preview IFD + SubIFD raw | Simplest valid DNG; LibRaw renders test patches back exactly. | +| 2026-10-02 | Resampler keeps negative/overshoot values in linear light. | Clamp to 0–1 | Ringing stays within each kernel's exact bound; clamping happens at encode. | +| 2026-10-02 | Codec fixtures (each < 12 KB) are generated by `tests/fixtures/codecs/make-fixtures.sh` with libjpeg-turbo/libtiff dev tools and committed. | Fetch at test time | Reference outputs must be stable; the tools are not build or runtime dependencies. | +| 2026-10-02 | Installer payload "TPK1": deduplicated, deflate-ratio-bounded entries after the setup stub; footer aligned to 8 bytes and found before an Authenticode table so signing works before and after packing. | Spec fields only | Every offset is bounds-checked; signtool can append without breaking the payload. | +| 2026-10-02 | Setup runs `asInvoker` and relaunches itself elevated (`runas`) only for all-users installs; the unelevated parent starts Titano afterwards. | requireAdministrator | Titano never runs elevated. | +| 2026-10-02 | Uninstaller self-removal via a %TEMP% copy started with `/CLEANUP`; running programs are only asked to close (never killed; silent mode exits 5). | MoveFileEx alone / kill | Per-user installs have no admin rights; user data safety. | +| 2026-10-02 | Setup has its own `Program.Main` (silent and cleanup modes run without WPF) and is published with single-file compression (70 MB stub). | App.xaml-generated Main | Reliable exit codes; smaller installers. | +| 2026-10-02 | SQLite: one in-process async write lock with `BEGIN IMMEDIATE`, shared-cache in-memory mode for tests, fixed-width ISO-8601 UTC text with microseconds and lower-case UUID text. | busy_timeout alone / epochs | Writers queue instead of failing; text order equals time order on both dialects. | +| 2026-10-02 | PostgreSQL: parameters typed by OID, results in text decoded by OID, named prepared statements (128 LRU), session settings pinned in the startup packet, cancel = CancelRequest then socket abort after 5 s, transient retry once for idempotent reads only. | Untyped params / tracking ParameterStatus | Predictable decoding, no "could not determine data type", a dead server never hangs a caller, writes never repeat. | +| 2026-10-02 | Migrations: all pending ones in one transaction under `pg_advisory_xact_lock`. | One transaction per migration | Atomic and safe when several servers start together. | +| 2026-10-02 | Case-insensitive search/sort via lower-cased `search_text`/`title_key` columns (and `COLLATE "C"` on PG). | ILIKE / NOCASE | Identical results on both dialects. | +| 2026-10-02 | Job claim: `UPDATE … WHERE id = (SELECT … FOR UPDATE SKIP LOCKED) RETURNING` on PG; immediate transaction on SQLite. | Advisory locks | Exclusive under concurrency, as specified. | +| 2026-10-02 | One `JobEngine` in Titano.Data runs every long operation for both the client and the server: handlers per `JobKind`, progress persisted at most every 5 s, a failed persist (job no longer running) stops the handler, a shutdown leaves jobs running so the next start requeues them from their checkpoint. | Per-feature background loops | One queue, one cancel/pause/resume path and one crash-recovery rule everywhere. | +| 2026-10-02 | Job throughput is a moving average over windows of at least 2 s. | Average since start | ETA follows speed changes (cache warm-up, network) without jitter. | +| 2026-10-02 | Visual controls (card grid, filmstrip, charts, preview, curve editor) keep their layout and math in WPF-free classes; colours are theme brush keys re-resolved on theme switch; charts, filmstrip and preview never mirror in RTL. | Math inside controls / brush properties | Testable on Linux; view models hold no brushes; time axes and images must not flip. | +| 2026-10-02 | `VirtualizingWrapPanel` does its own keyboard navigation and recycling; the focused container is kept alive. | ListBox navigation | Direct targets, wrapping across rows; focus survives scrolling. | +| 2026-10-02 | Library card slot 236 × 208 with a 16:9 thumbnail. | Mockup's 150 px thumbnail | DESIGN §4 specifies 16:9. | +| 2026-10-02 | Uploader sessions: key = 8 hex chars of the source folder's SHA-256 + first-frame time; leading test shots (first group < 8 frames) join the next session; watch-folder files always use automatic sessions. | Group by time only | Simultaneous cameras stay apart; unattended files never land in a sequence chosen for a manual drop. | +| 2026-10-02 | Uploader: a watch file counts as processed only after the server confirms it; offline, rejected-token and changed-certificate failures do not use up the three retries; a changed certificate signs the user out. | Mark at enqueue / count every failure | Clearing the queue loses nothing; an outage does not exhaust a large batch; never upload to an unverified server. | +| 2026-10-02 | Delete-after-upload also requires size and write time unchanged since hashing. | Server confirmation alone | BRIEF rule 8. | +| 2026-10-02 | Uploader settings are an in-window panel; single instance via a per-session mutex and a current-user named pipe; native tray menu (`TrackPopupMenuEx`). | Dialog / WM_COPYDATA / WPF ContextMenu | §12.1 allows modals only for login and destructive confirmations; works while hidden in the tray; dismisses reliably. | +| 2026-10-02 | Network watch folders are polled (default 5 min); local folders every 60 s plus `FileSystemWatcher` hints. | Watcher everywhere | SMB change notifications are unreliable. | +| 2026-10-02 | The Dockerfile uses BuildKit's built-in frontend (no `# syntax=docker/dockerfile:1`). | Pinned external frontend | Every feature used is built in; the build no longer depends on Docker Hub (a 502 there failed CI). Base images come from mcr.microsoft.com. | +| 2026-10-02 | SQLite sessions run every blocking call on the thread pool (`ThreadPoolHop`) and cancel through a per-connection flag polled by `sqlite3_progress_handler` (every 1000 VM instructions) in addition to `sqlite3_interrupt`. | Callers offload themselves / interrupt only | A repository awaited on the UI thread never freezes it; an interrupt that lands before `sqlite3_step` starts was silently lost and the query ran to the end. | +| 2026-10-02 | Deep analysis persists per-frame shifts from the nine-patch `Stabilizer` and smooths the path itself; per-frame data is stored as columns (~80–110 bytes/frame) with a JSON-lines checkpoint that drops a torn last line. | `Stabilizer.Solve` / row objects | `Solve` cannot resume from a checkpoint; the report stays small for 100k-frame sequences. | +| 2026-10-02 | Sky/land mask from a pre-pass over 15 sampled frames before the main pass. | Segment after the pass | Cloud coverage and per-region luminance need the mask during the pass. | +| 2026-10-02 | Scene distance: chi-square on histograms smoothed by ⅛ EV and levelled to the same mean; flow statistics use brightness-levelled images and forward–backward-consistent vectors only; noise is median-based (Immerkær). | Raw chi-square / raw flow / mean noise | Flicker and exposure steps no longer read as scene changes or motion; stars no longer inflate noise. | +| 2026-10-02 | Shake and motion thresholds are judged in output pixels (stabilise above 0.3 px RMS). | Source pixels | That is what the viewer sees. | +| 2026-10-02 | Automatic output stops at 4K UHD; no automatic stacking advice. | 8K / temporal-median denoise | 8K stays a manual choice; a median erases moving stars and stillness cannot be verified reliably. | +| 2026-10-02 | Apply records a missing-data reason only where no advice exists; Optimise returns modules to Auto and only adds to the user's hero, exclusions, offset or output cap; a preset's own choices are stored as manual values, content-derived values stay Auto. | Overwrite | Manual values stay in force; re-analysis does not undo a chosen preset. | +| 2026-10-02 | Advisor namespace is `Titano.Core.Advice` (class `Advisor`). | `Titano.Core.Advisor` | A class named like its namespace needed an alias in every `Titano.Core.*` caller. | +| 2026-10-02 | CI also force-pushes each same-repository PR run's screenshots as one commit to the `ci-screenshots` branch (separate job, only it has `contents: write`). | Artifact only | Artifacts need an authenticated download; a branch can be fetched with plain git for visual review. The branch never merges and holds a single commit. | +| 2026-10-02 | Export fps is the encoded grid; `Timing.FrameRate` is the playback rate (source frames per video second, default = export fps). Durations are quantised to output periods on rounded 90 kHz boundaries; whole frames are sampled at the period centre. | One fps / free durations | Presets keep their meaning, Interpolated can synthesise slow motion, AVI and image sequences stay exact. | +| 2026-10-02 | Adaptive timing is proportional up to 3× the median interval; longer gaps show for 3 + log2(r/3) frames (max 5); pauses ≥ 20× median and ≥ 120 s become a 0.2 s cut. Interpolated fills gaps of up to 3 missing/excluded frames. | Fixed clamps | Bursts stay faithful and long gaps cannot stall the video. | +| 2026-10-02 | A non-monotonic time-remap curve is repaired (sorted, clamped, made non-decreasing) with a warning; virtual-camera keyframes are keyed to source frame positions. | Reject the curve / output frame index | The remap is always monotone; keyframes stay on the content when timing or fps change. | +| 2026-10-02 | Per frame: exposure → one warp (stabilisation⁻¹ ∘ camera ∘ crop) to output size → flow, synthesis and blur in output space → stacking → knee. Stabilisation zooms by 1/max(crop scale, 0.75), warning below 0.75. Modules run only when Auto resolves true. | Flow in source space / no zoom | A single resample; flow sees stabilised content; borders stay hidden. | +| 2026-10-02 | Blur fraction = BlurFraction(target × speed, real) / steps, speed clamped to 4, no blur across cuts. | Fixed fraction | The look survives speed changes. | +| 2026-10-02 | Encoding overlaps processing by one frame; image sequences encode up to one frame per core into a hidden `.tmp` folder renamed at the end, named `/_000001.ext`. | Strictly sequential / `frame_%05d` | 1080p PNG 1.0 → 2.5 fps; crash-safe and editor-friendly. | +| 2026-10-02 | JPEG/MJPEG use 4:4:4 at quality ≥ 90, else 4:2:0; HEVC/AV1 → H.264 fallback rescales the bit rate by bits-per-pixel; size capped to the highest level, then the encoder maximum; managed bit depth moves to the shallowest supported depth ≥ the request; linear DNG tiles are sized to the frame (≤ 256 px). | — | Predictable quality and sizes; small DNGs are ~3× smaller. | +| 2026-10-02 | `Auto` carries `HasAdvice`; `Resolve` falls back only when there is no advice. | Treat `default` as "no advice" | A value type's advised 0/false was indistinguishable from "no advice". | +| 2026-10-02 | `i18n check` also treats any C# string literal shaped `Area.Group.Name` with an existing area as a used key. | Marker functions such as `LocKey(…)` | Reason and warning keys travel as data; 53 render/export keys had no resources and the check did not notice. | +| 2026-10-02 | Sidecars store sequence and frame ids, original name, UTC offset, time source, `verifiedAt` and session keys; compact JSON with numeric flags and named enums that read as Unknown; a sidecar with a newer `schemaVersion` is read but never rewritten. | Ids only in the DB / string enums / rewrite | A rebuild returns the same ids; unknown bits survive; data safety. | +| 2026-10-02 | Frames stay in capture order: ingest inserts in place and renumbers later frames; thumbnails carry a source fingerprint and proxies an Exif capture time so stale ones rebuild themselves. | Append in arrival order / mapping file | Parallel uploads arrive out of order. | +| 2026-10-02 | Ingest batches one sidecar write per sequence for concurrent commits, protected by a write-ahead journal; "new sequence with title" uploads map to a session key of user + title. | One write per file / new sequence per call | Large sidecars are not rewritten per frame; a crash between move and sidecar write recovers; parallel uploads with one title share a sequence. | +| 2026-10-02 | Import sessions split per camera body and file format; the session key hashes body, format and first capture time; duplicates offer Skip or Import again, never overwrite. | Body only / random key / overwrite | RAW+JPEG would double every frame; an interrupted import continues its sequence; originals are never replaced. | +| 2026-10-02 | Card erase re-hashes both the card file and the archive copy and refuses files touched since the dry run; adoption reads light metadata only and Verify fills the hashes. | Trust import-time hashes / hash during adoption | User data rule 8; adoption stays fast. | +| 2026-10-02 | Index rows without a sidecar are kept and reported as orphans (only Rebuild or an explicit fix removes them); scan stamps are 100 ns ticks; a copied sequence folder gets new ids; index edits win over the sidecar when the index's settings version is ahead. | Auto-delete / timestamps / shared ids / sidecar always wins | A temporarily missing folder loses nothing; microsecond DB precision would make every scan see changes; duplicate ids corrupt the index. | +| 2026-10-02 | Writers coordinate through lease files (2 min, renewed every 40 s, stale leases renamed aside); thumbnail passes take their own `thumbs-` lease. | OS file locks / the sequence lease | Locks are unreliable over SMB and across processes; long thumbnail passes must not block ingest. | +| 2026-10-02 | One `thumbs.pack` format: the archive's `ThumbPack` (frame index + source hash, append-only entries, index + footer, walk-back recovery). The decode workstream's second pack format and proxy builder were removed; its LRU `ThumbnailCache` stays for the UI. | Keep both | Both wrote `TTPK` files with incompatible layouts to the same path. | +| 2026-10-02 | Native RAW: the sensor saturation point only marks clipping (never rescales); white balance before demosaic, colour matrix after; highlight recovery lifts clipped channels to the unclipped mean then fades to grey; camera matrices match the exact model name; CR2 black level from masked columns; Sony as-shot WB falls back to daylight. | Per-frame white adjustment / prefix match / SR2 decryption | Per-frame rescaling would flicker a timelapse; D750 ≠ D7500. | +| 2026-10-02 | Frame-window spill stores 32-bit floats; DNG DefaultScale stretches the axis with the larger factor; ForcePreview uses an embedded JPEG preview only when it is at least the requested size. | Half floats / shrink / always preview | Renders stay bit-identical under memory pressure; full resolution; no blurry thumbnails. | +| 2026-10-02 | A job engine claims only kinds it has handlers for (intersected with `Kinds` when set) and starts no workers without any; crash recovery requeues the node's numbered workers (`node#0`, `node#1`, …). | Empty filter = every kind / exact node id | A host without a render handler must leave render jobs to render nodes; with several workers the old exact match never requeued crashed jobs. | +| 2026-10-02 | Desktop: the archive engine uses WIC first, then managed decoders; the last archive is reopened at start (relinking a moved one, finishing interrupted renames) and incrementally rescanned every 10 minutes; Welcome and Library create/adopt through the archive engine and queue a full scan; failures become a toast. | File-system watchers / no periodic scan | BRIEF §7: polling by mtime/size plus manual rescan. | +| 2026-10-02 | Desktop thumbnails: widths rounded up to 64 px, LRU of 2000 items, at most cores/2 (2–6) decodes, "no image" cached but failures not, a decode is cancelled when its card scrolls away; job list updates batched to ~10 Hz keeping the latest per job. | Fixed size per card / update per event | Fewer decodes, bounded memory, a free UI thread during fast renders. | +| 2026-10-02 | Server sign-in in the client: an unknown certificate fingerprint is confirmed before any password is sent, a changed certificate never receives the saved token, the token is stored only DPAPI-encrypted. | Trust on login | BRIEF §14.2. | +| 2026-10-02 | The client update check reads the latest non-draft, non-prerelease GitHub release of `TitanoReleasesRepo` and only opens its page; Clear cache deletes only folders carrying a `.titano-cache` marker, after confirmation; `--capture` runs on a temporary data folder with fake server, encoders and update check. | Download updates / clear any folder / real data | No external processes; never delete user data; CI never touches user data. | +| 2026-10-02 | The server registers the archive engine in `ArchiveModule` (ingest, asset locator, job handlers through `IJobHandlerProvider`) and opens its archive through `ArchiveService.AdoptAsync`; `ServerHost.Build` keeps the registration callback so tests can substitute fakes, and still refuses to start without ingest and locator. | Hard-wired registrations / DB row only | Tests stay isolated; the archive always has `.titano/archive.json`, so scans and ingest work from the first start. | +| 2026-10-02 | Admin cookies are `Secure`: cookie sign-in over plain HTTP only from loopback, `/admin` over HTTP from other hosts redirects to HTTPS; CSRF token derived from the session token's hash, cookie WebSocket upgrades must be same-origin. | Drop `Secure` / random double-submit cookie | BRIEF §14.2; a planted cookie pair cannot forge the token. | +| 2026-10-02 | Sign-in rate limit and lockout live in memory and apply to unknown names too; the generated first admin password goes to an owner-only file deleted once an admin sets a password; minimum password length 10; admin-created users must change their password; resets give a temporary password. | DB columns / log the password / email links | No user enumeration; secrets never logged; no mail infrastructure. | +| 2026-10-02 | API errors are localised through `Accept-Language` (fallback `TITANO_LANG`); ETags on sequences, manifests and originals (SHA-256) with `If-Match` doubling as the expected settings version. | English only / version in body only | Every user-visible string is a resource; standard HTTP caching and concurrency. | +| 2026-10-02 | Deleting a sequence moves its folder to `/.titano/trash/` (with dry run); upload completion is synchronous and idempotent, survives client disconnect, and a failed ingest returns the upload to receiving (503). | Erase files / async commit job | User data rule 8 and undo; clients need the frame id at once and retries stay safe. | +| 2026-10-02 | Quota = used + pending uploads + new size, checked at start and at commit (render outputs not counted); the duplicate short-circuit matches a hash anywhere, preferring the target sequence; at most 8 concurrent chunk uploads per user (429), bodies capped at 1 MiB except chunks. | Committed bytes only / per-sequence only / request-rate limiter | Parallel uploads cannot slip past the quota; the brief's wording; simplest effective limit. | +| 2026-10-02 | Render jobs never run on the server engine: render nodes claim them by codec and resolution, report failures, and a job fails after losing its node 5 times. | Managed rendering on the server | No server render handler yet. | +| 2026-10-02 | Server settings page writes only edited keys to `server.json`; environment-fixed settings are locked; restart-only keys are flagged. Windows service: LocalSystem, automatic start, name `TitanoServer`. Admin panel: strict CSP (SVG charts, no inline styles), light theme only. | Rewrite the whole file / theme toggle | Secrets never written; DESIGN.md wins over the mockup toggle. | +| 2026-10-02 | Migrations are numbered without gaps (0001 initial, 0002 archive index, 0003 server uploads). | Keep 0005 | Parallel workstreams picked numbers to avoid collisions; renumbered at merge. | +| 2026-10-02 | `xaml-lint` checks keyed value resources against the property type (GridLength for column/row sizes, Thickness, CornerRadius, Double). | Rely on Windows smoke tests | A Double used as a column width compiles and only fails when the template loads on Windows; the lint now fails on Linux too. | diff --git a/docs/STATUS.md b/docs/STATUS.md new file mode 100644 index 00000000..8ae31a7c --- /dev/null +++ b/docs/STATUS.md @@ -0,0 +1,26 @@ +# Status + +Phase plan: docs/BRIEF.md §22. Windows behaviour is verified on CI (`windows-latest`); everything else also on Linux. + +| Phase | State | +|---|---| +| 0 Bootstrap | Done: solution, rules, Titano.Testing, zero-package guard, i18n (en, it; 36 cultures scaffolded), WPF shell, server skeleton, Docker, icons, CI. | +| 1 Metadata and imaging | Done: metadata parsers, managed codecs (JPEG, PNG, TIFF, GIF, APNG, ICO, linear DNG writer), WIC provider, colour/resampling. RAW/DNG decode pipeline in progress. | +| 2 Data layer and archive | Data layer done (SQLite binding, PostgreSQL wire client, migrations, repositories, job engine). Archive layout, sidecars, scan, rebuild, verify, duplicates, orphans, adopt: in progress. | +| 3 Library and Archive manager | Visual controls done (virtualised card grid, charts, filmstrip, preview, curve editor). Library, Jobs, Settings, Welcome, Server and About screens: in progress. Archive manager screen: next. | +| 4 Card import | Engine in progress with the archive workstream; screen next. | +| 5 Analysis advisor | In progress. | +| 6 Engine, encoding, editor | Video containers and encoders done (MP4, AVI, GIF/APNG, Media Foundation H.264/HEVC/AV1); render pipeline in progress; editor screen next. | +| 7 Server, sync, uploader | Uploader done. Full server (API, auth, uploads, sync, jobs, render nodes, events, admin panel, Windows service) in progress. | +| 8 Release readiness | Installer, release/docker workflows and Unraid template in place; translations, accessibility and performance passes pending. | +| 9 Monetization | Not started: requires explicit approval (§22). | + +## How to try it + +``` +dotnet build Titano.slnx -c Release +dotnet run --project src/Titano.Server # https://localhost:8443/admin (set TITANO_DATA_PATH/TITANO_ARCHIVE_PATH) +src/Titano.App/bin/Release/net10.0-windows/Titano.exe # Windows +src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe # Windows +docker compose -f deploy/docker/docker-compose.yml up -d # server + PostgreSQL 17 +``` diff --git a/docs/ui/DESIGN.md b/docs/ui/DESIGN.md new file mode 100644 index 00000000..6bcfbea5 --- /dev/null +++ b/docs/ui/DESIGN.md @@ -0,0 +1,119 @@ +# Titano — Design reference for Claude Code + +Companion to `docs/BRIEF.md` §12 (UI spec). Suggested repo placement: +`docs/ui/DESIGN.md` (this file), `docs/ui/mockups/*.html` (open in any browser; +each file is one screen at its natural size, links between screens work), `branding/` +(icon sources). The mockups are the visual target; where a mockup and the brief disagree +on behaviour, the brief wins; where they disagree on looks, the mockup wins. + +## 1. Tokens → WPF resource dictionary (`Titano.App/Themes/Dark.xaml`, `Light.xaml`) + +| Key (SolidColorBrush) | Dark | Light | Use | +|---|---|---|---| +| `Brush.Bg` | #1F1F23 | #F3F3F3 | window background | +| `Brush.Chrome` | #1A1A1E | #FFFFFF | title bar, rail, status bar, web sidebar | +| `Brush.Surface` | #26262C | #FFFFFF | panels, toolbars, dialogs | +| `Brush.Card` | #2F3038 | #FFFFFF | cards, inputs, buttons, hovered rows | +| `Brush.Stroke` | #3E404A | #E5E5E5 | 1 px borders and dividers | +| `Brush.Text` | #F2F3F5 | #1A1A1A | primary text | +| `Brush.TextMuted` | #A9AEB9 | #616161 | secondary text, labels | +| `Brush.TextFaint` | #7B818E | #9E9E9E | hints, column headers, disabled | +| `Brush.Accent` | #4CC2FF | #0067C0 | primary button, active rail edge, links, Auto | +| `Brush.OnAccent` | #0B1B24 | #FFFFFF | text on accent | +| `Brush.AccentSelected` | rgba(76,194,255,.25) | #E8F1FA | selection glow / selected nav | +| `Brush.Sun` | #F5A524 | #E08A1E | manual slider track, uploader accent, icon sun | +| `Brush.Success` | #35C48F | #0F7B4F | analysed, in sync, done | +| `Brush.Warning` | #E8B339 | #9A6700 | warnings, destructive outline | +| `Brush.Error` | #F0625D | #C42B1C | errors, failed | +| `Brush.Region` | #5AD1C8 | #1A9E95 | sky/landscape region masks only | + +Dark is the client default; Light follows the OS setting; the web admin is Light-only. +Never use colour alone to carry state: pair it with a glyph (● ○ ◐ ▲ ✕ ▶) or a word. + +## 2. Type (Segoe UI Variable, fallback Segoe UI; `FontSize` keys) + +`Text.PageTitle` 18/600 · `Text.Title` 16/600 · `Text.Section` 14/600 · `Text.Body` 13/400 +· `Text.Secondary` 12/400 muted · `Text.Chip` 11/400. Line heights 24/22/20/18/16/14. +Numbers in tables use tabular figures (`Typography.NumeralAlignment="Tabular"`). +Layout must survive +40 % text width (de, fi): no fixed-width labels, `MinWidth` only. + +## 3. Spacing, radii, sizes + +Spacing scale 4 · 8 · 12 · 16 · 20 (`Thickness` keys `Space.1`…`Space.5`). +Radii: 6 controls · 8 cards/panels · 12 pills · 12 modal dialogs. +Controls 32 px tall, 44 px minimum width, 12 px horizontal padding; compact row buttons 26–28 px. +Rail 128 px (collapses to 48 px icons); title bar 34; job bar 40; toolbar 56; status bar 30; +table rows 36–40 (52 in the web admin); side panels 320 px; settings section list 200 px. +Label column left of controls: 116 px in panels, 180 px in Settings. + +## 4. Controls and states (see `Components.html`) + +- **Button**: Card fill, Stroke border. Hover +6 % lightness, pressed −6 %, focus = 2 px + Accent ring outside. **Primary** (Accent fill, OnAccent text, 600) — one per screen. + **Destructive** = Warning outline, transparent fill, never a primary. **Subtle** = no border + until hover. **Toggled** = Accent text + Accent border. **Disabled** = 40 % opacity and the + tooltip says why. Icon-only buttons carry `AutomationProperties.Name` and a tooltip. +- **Inputs**: Card fill, Stroke border, Accent border on focus, Error border when invalid with + the message in the tooltip (never a line of text under the field). Enter commits, Esc reverts. +- **Slider — Auto/manual** (brief §10.4): Auto state = Accent track, dimmed thumb, an `Auto · 41` + pill at the right whose tooltip gives the advisor's reason; touching it turns the track Sun + (manual), shows the value, and a `⟲` reset button returns to Auto. Not applicable = greyed + value "n/a" with the reason in its tooltip. +- **Status glyphs**: `●` green Analysed · `○` faint Not analysed · `●` Proxies · `▶ n` rendered + · `●` accent Synced/Remote · `◐` amber Analysing · `▲ n` warnings · `✕ n` errors. +- **Chips**: 24 px pills, Card fill, Stroke border; selected/recommended = Accent border and text. +- **Progress**: 6 px bar, Accent fill, text to the right; indeterminate = sliding highlight. +- **Tooltip**: light on dark (#F2F3F5 on dark, #1A1A1A text), 12 px, one line: action + cost + + shortcut ("Read every frame again · about 6 min · Ctrl+Shift+A"); 400 ms delay; ≤ 200 chars. + Every interactive element has one. There is no other explanatory text in the UI. +- **Dialog**: Surface fill, Stroke border, radius 12, 24 px shadow, two buttons maximum, safe + action left and default, destructive on the right with typed confirmation for formatting. +- **Toast**: bottom-right, 420 px, Card fill with a 3 px Accent left edge, one action button, + 8 s, hover pauses. Used for card insertion, render done, server messages. +- **Job bar**: 40 px strip under the title bar in every client screen: current job, progress, + time left, pause; hidden when idle only in the editor (it shows "Ready" elsewhere). +- **Rail item**: 36 px; active = Card fill + 3 px Accent left edge; badge = Accent pill with + the count of things needing attention. +- **Cards** (Library): 236 px wide, thumbnail 16:9, count badge top-right, checkbox top-left on + hover/selection, selected = Accent border + `AccentSelected` glow; hover scrubs the thumbnail. +- **Tables**: header 11 px faint, sortable; rows Card fill on hover; numbers right-aligned, + tabular; virtualised beyond 200 rows; row actions are 26 px buttons revealed on the row. + +## 5. Icons + +16 px, 1.5 px strokes, round caps and joins, `currentColor`, drawn as `PathGeometry` / +`DrawingImage` resources in `Titano.App/Icons/Icons.xaml` (source SVGs in `branding/ui-icons/` +if generated by a tool). No icon fonts, no emoji in shipped UI (the mockups use a few glyphs +only as placeholders: replace ⟳ ▾ ✕ ■ ❚❚ ≡ with drawn icons). Directional icons mirror in RTL. + +## 6. App icon (`branding/`) + +`titano.svg` is the master: 256 plate radius 56 #1A1A1E, ring r 92, 12 ticks of 12° with 18° +gaps, stroke 20 round caps, opacity 0.14 → 1.0 clockwise from 12 o'clock, sun disc at +(152,104) r 30 #F5A524. Variants: `titano-server.svg` (rack badge), `titano-uploader.svg` +(up-arrow badge), `titano-mono.svg` (white, no plate, for the tray). PNG renders at +16/32/48/64/128/256 are reference output; `Titano.Tools make-icon` must regenerate ICO/PNG +from the SVG geometry (no raster assets checked in as sources). Badges only at ≥ 48 px. + +## 7. Screen-by-screen notes (mockup → brief section) + +| Mockup | Brief | Notes | +|---|---|---| +| `Main.html` | §12.2 Library | grid/list, year·camera·status filters, selection panel | +| `Editor.html` | §12.3 Sequence editor | Exposure tab, wipe compare, curves, advisor Auto pills | +| `Export.html` | §12.3 / §11.4 | preset cards with size/time estimate, Output panel, batch | +| `Import.html` | §12.4 / §13 | card profile, sessions, plan, verification, after-import actions | +| `Archive.html` | §12.5 | tree, mass operations, stats, verify/rebuild, maintenance | +| `Jobs.html` | §12.6 | filters, queue order, expandable log, retry/open/folder | +| `Server.html` | §12.7 / §14 | connection with TOFU fingerprint, account and quota, render node, sync table, conflicts | +| `Settings.html` | §12.8 | section list, Rendering section, encoder table, self-test | +| `Welcome.html` | §12.1 | first run: local archive / adopt folder / connect; consent line; card toast | +| `Admin.html` | §14.7 | dashboard | +| `AdminUsers.html` | §14.7 | users table, roles, quotas, temporary password, render-node right | +| `Uploader.html` | §15 | single window, watch folder, queue, tray | +| `Components.html` | §12.1 | the control kit above, with hex values and state rules | +| `Icon.html` | §17 | construction, sizes, variants, wordmark | + +Missing on purpose (build from the brief and this kit): About, Login dialog, the other editor +tabs (Frames, Motion, Camera, Time, Stack), Import "Show plan", Archive rebuild dialog, the +admin Archive/Jobs/Settings/Logs pages. Reuse the shell and the kit; do not invent new colours. diff --git a/docs/ui/mockups/Admin.html b/docs/ui/mockups/Admin.html new file mode 100644 index 00000000..fe0ac6f5 --- /dev/null +++ b/docs/ui/mockups/Admin.html @@ -0,0 +1,118 @@ + + + + +Titano Server — Admin dashboard + + + +
+ +
+
+ Dashboard + up 12 d 4 h · PostgreSQL 17 · TLS auto · discovery on + + + + +
+
+
+
+ Storage + 9.4 TBof 16 TB +
+ 6.6 TB free · exports 210 GB · proxies 610 GB +
+
+ Archive + 412sequences + 618,204 photos · 14 cameras · last scan 07:12 + 3 sequences without proxies +
+
+ Jobs + 3running + 12 queued · 41 done today · 0 failed + workers 4 of 4 busy +
+
+ Render nodes + 2online + studio-pc · NVENC HEVC/H.264/AV1 · busy + laptop-alb · QSV HEVC/H.264 · idle +
+
+
+
+ Storage by year + +
+
+
Uploads · last 30 daysframes per day · 96,410 total · peak 12,400
+ +
+
+
+
+
Recent activityAll logs
+
+ 09:41alberto uploaded 1,020 frames to Construction cam · week 38 + 09:12studio-pc rendered Milan skyline dusk · 4K HEVC · 2 min 41 s + 08:55uploader roof-cam signed in from 192.168.1.44 + 08:30admin set export retention to 180 days + 07:12scheduled scan finished · 412 sequences · 0 changes + 06:00database backup · /data/backups/2026-09-30.sql.gz · 190 MB + 23:04admin created user giulia · Editor · quota 2 TB +
+
+
+ +
+ KindTargetNodeProgressState + RenderHarbour sunset → 4K 10-bit HEVCstudio-pc
62 %
running + Deep analysisConstruction cam · week 38server
28 %
running + ProxiesComet over the ridgeserver
91 %
running + VerifyArchive · 2024server
—
queued + RenderAurora, Tromsø → 1080p share H.264laptop-alb
—
queued +
+
+
+
+
+
+ + diff --git a/docs/ui/mockups/AdminUsers.html b/docs/ui/mockups/AdminUsers.html new file mode 100644 index 00000000..faffd14d --- /dev/null +++ b/docs/ui/mockups/AdminUsers.html @@ -0,0 +1,76 @@ + + + + +Titano Server — Users + + + +
+ +
+
+ Users + 6 accounts · 5 active · roles: admin, editor, uploader, viewer + + + + +
+
+
+
UserRoleQuotaLast seenUploads 30 dStatus
+
AadminAdministrator · created at first startAdmin—now · 192.168.1.100● Active
+
AalbertoAlberto · render node studio-pcEditor
2.1 of 5 TB
10:15 · client 1.3.014,208● Active
+
GgiuliaGiulia · must change passwordEditor
0.1 of 2 TB
09:20 · client 1.3.0640● Active
+
Rroof-camUploader on the roof PC · watch folderUploader
0.6 of 1 TB
08:55 · uploader 1.3.081,320● Active
+
MmarcoMarco · clientViewer—2026-09-140● Active
+
SsimoneSimone · disabled 2026-08-30Editor
0.4 of 2 TB
2026-08-290○ Disabled
+ +
Passwords: PBKDF2-SHA512, 12 characters minimum · tokens expire after 30 days idleSign-in log
+
+ +
+
+
+ + diff --git a/docs/ui/mockups/Archive.html b/docs/ui/mockups/Archive.html new file mode 100644 index 00000000..8837fc49 --- /dev/null +++ b/docs/ui/mockups/Archive.html @@ -0,0 +1,142 @@ + + + + +Titano — Archive manager + + + +
+
+ + Titano — Archive + + —▢✕ +
+
+ +
+
+
+ Verify · 6.7 of 9.4 TB · 410 MB/s · 1 h 52 min left · 0 errors + +
+
+
+ + + + + + + + + + + Last scan 2026-09-29 07:12 · 14 min +
+
+
618,204photos
+
412sequences · 1,309 loose photos
+
9.4 TBoriginals · 610 GB proxies · 1.8 GB thumbnails
+
14cameras · 9 formats
+
2019 – 2026316 rendered · 84 never rendered · 12 not analysed
+
+
+
+
Photos per month021k
+ +
+
+ Storage by year + +
+
+ By camera + +
+
+ By format + +
+
+
+
+ Index health +
Sidecars 412 / 412 · database matches the disk
+
3 sequences without proxies
+
1 sequence not verified in 90 days
+
Database 214 MB · thumbnail pack 1.8 GB · 0 orphans · 0 duplicates
+
Network root reachable · SMB · 118 MB/s read
+
+
+
Recent maintenance
+
+ 2026-09-29Verify · running71 % + 2026-09-20Verify · 9.4 TB0 errors + 2026-09-01Vacuum · 231 → 214 MBdone + 2026-08-14Rebuild index · 412 sidecarsdone + 2026-08-02Backup · D:\Backups\titano-2026-08-02.dbdone +
+
+
+
+ Filtered set + + + + + + + + + + + +
+
+
+ 412 sequences618,204 photos9.4 TBConnected to "Studio NAS"1 job +
+
+
+
+ + diff --git a/docs/ui/mockups/Components.html b/docs/ui/mockups/Components.html new file mode 100644 index 00000000..7dfa392c --- /dev/null +++ b/docs/ui/mockups/Components.html @@ -0,0 +1,193 @@ + + + + +Titano — UI kit + + + +
+
+ COLOURS · CLIENT (DARK, DEFAULT) +
+
Bg #1F1F23
+
Chrome #1A1A1E
+
Surface #26262C
+
Card #2F3038
+
Stroke #3E404A
+
Text #F2F3F5
+
Muted #A9AEB9
+
Faint #7B818E
+
Accent #4CC2FF
+
On accent #0B1B24
+
Sun #F5A524
+
Success #35C48F
+
Warning #E8B339
+
Error #F0625D
+
+ Region teal #5AD1C8 only for sky/landscape masks · one accent per screen · never colour alone: pair with a shape or a word +
+
+ COLOURS · LIGHT THEME & WEB ADMIN +
+
Bg #F3F3F3
+
Card #FFFFFF
+
Stroke #E5E5E5
+
Text #1A1A1A
+
Muted #616161
+
Accent #0067C0
+
+ Selected nav #E8F1FA · sun #E08A1E · success #0F7B4F · warning #9A6700 · error #C42B1C +
+
+ TYPE · SPACING · RADII + Page title 18 / 600 + Sequence title 16 / 600 + Section 14 / 600 + Body and controls 13 / 400 + Secondary 12 / 400 muted + Chips and axis labels 11 / 400 +
+ + 4 · 8 · 12 · 16 · 20 px + + 6 control · 8 card · 12 pill +
+
+
+ BUTTONS · 32 PX · MIN WIDTH 44 +
+ + + +
+
+ + + + +
+
+ + +
+ Hover +6 % lightness · pressed −6 % · focus ring 2 px accent outside · every button has a tooltip +
+
+ INPUTS · SELECTION + +
+ + + +
+ +
+ + + + + +
+ Labels left of the control, 116 px column · placeholder never replaces a label · Enter commits, Esc reverts +
+
+ SLIDERS · AUTO / MANUAL +
+
+ +
+
+
0.80
+ +
+
Colour temperaturen/a
+ Accent track = Auto · sun track = manual · greyed with reason = not applicable · values edit on double-click +
+
+ STATUS · PROGRESS · TOOLTIP +
+ ● Analysed○ Not analysed● Proxies▶ 2 rendered● Synced● Remote◐ Analysing▲ 1 warning✕ 2 errors +
+
+ sunset ✕ + holy grail ✕ + Recommended +
+
Determinate 6 px · text to the right, never inside
+
Indeterminate: sliding highlight
+
+ +
Read every frame again and refresh the analysis · about 6 min · Ctrl+Shift+A
+
+ Tooltip: one line, action + cost + shortcut · shows after 400 ms · light on dark +
+
+ DIALOG · DESTRUCTIVE CONFIRM +
+ Format EOS R5 · card A? + 4,812 photos were copied and verified. Formatting removes everything on the card. + +
+ + +
+
+ Two buttons max · safe action left and default · destructive never primary · Esc = safe +
+
+ TOAST · JOB BAR · RAIL +
+ + EOS R5 · card A inserted4,812 photos · 96.2 GB · 3 sessions + + +
+
+
+ Building proxies · 1,240 / 3,600 · 3 min left + +
+
+
+ Library + Import + Jobs2 +
+ Rail 128 px, collapses to 48 px icons · active = card fill + 3 px accent edge · badge = count needing attention · toast bottom-right, 8 s, hover pauses +
+
+
+ EMPTY STATE · SEQUENCE CARD · TABLE ROW +
+
+ + No sequences yet +
+ + + +
+
+
+
+
3,600
+
Harbour sunsetCanon EOS R5 · 2 h 00 m
● Analysed● Proxies▶ 2
+
+ Selected card: accent border + glow · thumbnail is the first analysed keyframe, hover scrubs +
+
+
SequenceCameraFramesState
+
Harbour sunsetCanon EOS R53,600● ok
+
Comet over the ridgeGoPro HERO81,005▲ 1
+
Aurora, TromsøNikon Z 81,860● sync
+ Rows 36 px · hover = card fill · numbers right-aligned in real tables · sortable headers · virtualised past 200 rows +
+
+
+
+ + diff --git a/docs/ui/mockups/Editor.html b/docs/ui/mockups/Editor.html new file mode 100644 index 00000000..3e013a8f --- /dev/null +++ b/docs/ui/mockups/Editor.html @@ -0,0 +1,114 @@ + + + + +Titano — Sequence editor + + + +
+
+ + Titano — Harbour sunset + + —▢✕ +
+
+ +
+
+ ← + Harbour sunset + 3,600 frames · Canon EOS R5 · 2 s interval · 2 h 00 m · 3 warnings + + + + +
+
+
+
+
+
+
+
original | corrected
+
+ + + + + + +
+
0413 / 3,600 · 18:02:11 · 1/8 s · f/8 · ISO 400 · 24 mm
+
+
+
▼▼▼▼
+
+
+
+
+
+ + + + + + + +
+
+
— measured luminance— target curve- - sky region▼ exposure steps as receivedflicker −67 % · max step 0.21 EV
+ +
+
+ +
+
+
+
+ + diff --git a/docs/ui/mockups/Export.html b/docs/ui/mockups/Export.html new file mode 100644 index 00000000..16814484 --- /dev/null +++ b/docs/ui/mockups/Export.html @@ -0,0 +1,102 @@ + + + + +Titano — Sequence editor · Export + + + +
+
+ + Titano — Harbour sunset + + —▢✕ +
+
+ +
+
+ ← + Harbour sunset + 3,600 frames · 24 fps · 2 min 30 s · 3840×2160 source 8192×5464 + + + + +
+
+
+
+
+
+ + + +
+
0413 / 3,600 · 00:17.2 of 02:30 · output 3840×2160
+
+
+
+
+
+ + + + + + + +
+
+ + + + + + + + +
+
+ +
+
+
+
+ + diff --git a/docs/ui/mockups/Icon.html b/docs/ui/mockups/Icon.html new file mode 100644 index 00000000..b45593f5 --- /dev/null +++ b/docs/ui/mockups/Icon.html @@ -0,0 +1,80 @@ + + + + +Titano — Icon + + + +
+ + + + + + + + + + + + + + + + + + + + + + plate 256 · radius 56 · ring r 92 · stroke 20 · sun (152,104) r 30 + + 12 ticks of 12°, 18° gaps, round caps — a clock face and an intervalometer at once. + Opacity 0.14 → 1.0 clockwise from 12 o'clock: time accumulating, exposure ramping. + The sun sits off-centre, north-east, the way it does in every sunset shot. + Two colours only: accent #4CC2FF on plate #1A1A1E, sun #F5A524. No gradients, no text. + Generated by `Titano.Tools make-icon` into ICO (16–256), PNG, and the WPF DrawingImage. + + + ON DARK + + + + + + 12864483216 + + + ON LIGHT + + + + + + + VARIANTS + + + + Titano ServerTitano UploaderTray · monochrome · no plate + + WORDMARK · Segoe UI Variable Display Semibold, tracking −1 %, cap height aligned to the ring + + Titano + + Titano Server + + Titano Uploader + + Clear space around the mark: one tick length (40/256) on every side. Never rotate, recolour or add a drop shadow. + Badges only at 48 px and above; below that the Server and Uploader use the plain mark and their window title. + Installer, Store listing, GitHub social preview and the Unraid template icon all use the 256 px PNG. + + +
+ + diff --git a/docs/ui/mockups/Import.html b/docs/ui/mockups/Import.html new file mode 100644 index 00000000..3f1f14da --- /dev/null +++ b/docs/ui/mockups/Import.html @@ -0,0 +1,154 @@ + + + + +Titano — Import + + + +
+
+ + Titano — Import + + —▢✕ +
+
+ +
+
+
+ Ready · 0 jobs queued +
+
+ +
+
+ EOS R5 · card A + SD 128 GB · serial 3F2A-9C11 · Canon EOS R5 #0431 · last import 2026-09-21 + + + +
+
+ Destination +
+ + + + + + Studio NAS +
+ Scan +
+ + + gap min + min frames + +
+ Names +
+
+ + / + + +
+ → 2026/2026-09-28 Canon EOS R5/2026-09-28_18-02-11_0001.CR2 +
+ On existing +
+ + + +
+ Convert +
+ + + + +
+ After import +
+ + + + + + +
+
+
+
+ Plan + 3 sessions · 4,812 photos · 96.2 GB · about 12 min + + 0 duplicates + 2.1 TB free after import +
+
+ SessionFrames · intervalSizeCameraSequence + 2026-09-28 · 18:02 → 20:043,600 · 2 s72.4 GBEOS R5new · 2026-09-28 Canon EOS R5 + 2026-09-27 · 05:41 → 06:571,140 · 4 s22.6 GBEOS R5new · 2026-09-27 Canon EOS R5 + 2026-09-26 · 21:10 → 23:3472 · 120 s1.2 GBEOS R5loose photos +
+ +
+ + + +
+
+
+
+
+ 412 sequences618,204 photos9.4 TBConnected to "Studio NAS"0 jobs +
+
+
+
+ + diff --git a/docs/ui/mockups/Jobs.html b/docs/ui/mockups/Jobs.html new file mode 100644 index 00000000..9a391d65 --- /dev/null +++ b/docs/ui/mockups/Jobs.html @@ -0,0 +1,80 @@ + + + + +Titano — Jobs + + + +
+
+ + Titano — Jobs + + —▢✕ +
+
+ +
+
+
+ Render · Harbour sunset · 2,232 / 3,600 · 11.3 fps · 2 min left + +
+
+ + + + + + + + + + Workers 4 / 4 · GPU NVENC busy + + +
+
+
KindTargetProgressSpeedLeftWhereState
+
RenderHarbour sunset → 4K 10-bit HEVC · 24 fps
62 %
11.3 fps2 minthis PC · NVENCrunning
+
+
10:14:02 window 41 · deflicker −67 % · 3 exposure steps redistributed over 18 frames
+
10:14:03 stabilisation on · mean shake 0.42 px · crop 1.8 %
+
10:14:03 encoder NVENC HEVC Main10 · 3840×2160 · 120 Mb/s · 24 fps · GOP 48
+
10:15:41 frame 2232 / 3600 · 11.3 fps · spill 0 · memory 6.1 GB of 8 GB budget
+
+
Deep analysisConstruction cam · week 38
28 %
41 fps6 minthis PCrunning
+
UploadComet over the ridge → Studio NAS
46 %
38 MB/s4 minnetworkrunning
+
ProxiesComet over the ridge
91 %
118 fps8 sthis PCrunning
+
RenderAurora, Tromsø → 1080p share H.264
—
—after 1this PCqueued
+
VerifyArchive · 2024
—
—after 2this PCqueued
+
VerifyStar trails, Colle del Nivolet
100 %
—09:58this PCfailed · 2
+
RenderMilan skyline dusk → 4K HEVC
100 %
14.8 fps09:12studio-pcdone · 2:41
+
ImportEOS R5 · card A → Archive · 4,812 photos
100 %
410 MB/s08:41this PCdone · 11:52
+
Thumbnails2026-09-27 Sony ILCE-7M4
100 %
2,300 fps08:42this PCdone · 0:01
+ +
History keeps 90 days · 1,412 jobsFailed jobs retry automatically 3× with backoff, then wait for youRendering settings
+
+
+ 412 sequences618,204 photos9.4 TBConnected to "Studio NAS"4 jobs +
+
+
+
+ + diff --git a/docs/ui/mockups/Main.html b/docs/ui/mockups/Main.html new file mode 100644 index 00000000..ba11bd8a --- /dev/null +++ b/docs/ui/mockups/Main.html @@ -0,0 +1,101 @@ + + + + +Titano — Library + + + +
+
+ + Titano + + —▢✕ +
+
+ +
+
+
+ Building proxies · Harbour sunset · 1,240 / 3,600 · 12 fps · 3 min left + +
+
+ + + + + + + + + + + + +
+
+
+
+
Harbour sunset3,600 · Canon EOS R5 · 2 h 00 m
● Analysed● Proxies▶ 2● Synced
+
+
+
+
Comet over the ridge1,005 · GoPro HERO8 · 5 h 34 m
● Analysed● Proxies▲ 1
+
+
+
+
2026-09-27 Sony ILCE-7M42,140 · Sony A7 IV · 1 h 11 m
● Analysed○ Proxies
+
+
+
+
Aurora, Tromsø1,860 · Nikon Z 8 · 4 h 08 m
● Analysed● Proxies● Synced
+
+
+
+
Construction cam · week 388,920 · Brinno · 7 d
◐ Analysing● Remote
+
+
+
+
Milan skyline dusk2,400 · iPhone 16 Pro · 1 h 20 m
● Analysed● Proxies▶ 1
+
+
+
+
Clouds over the Langhe1,320 · Canon EOS R5 · 44 m
○ Analysed○ Proxies
+
+
+
+
Star trails, Colle del Nivolet640 · Sony A7 IV · 5 h 20 m
● Analysed● Proxies▶ 3
+
+
+
+
Fog lifting, Asti980 · DJI Osmo Action 5 · 1 h 38 m
● Analysed○ Proxies
+
+
+
+
Holy grail · Monviso1,720 · Nikon Z 8 · 3 h 02 m
● Analysed● Proxies▶ 1● Synced
+
+
+
+ 412 sequences618,204 photos9.4 TBConnected to "Studio NAS"3 jobs +
+
+
+
+ + diff --git a/docs/ui/mockups/Server.html b/docs/ui/mockups/Server.html new file mode 100644 index 00000000..f865587e --- /dev/null +++ b/docs/ui/mockups/Server.html @@ -0,0 +1,112 @@ + + + + +Titano — Server + + + +
+
+ + Titano — Server + + —▢✕ +
+
+ +
+
+
+ Upload · Comet over the ridge · 46 % · 38 MB/s · 4 min left + +
+
+
+
+
+ + + + +
+
+ Status + Connected + ·Studio NAS · v1.3.0 · 14 ms + ·TLS 9A:3C:71:E0:… trusted 2026-09-01 + +
+
+ Account + A + alberto·Editor· +
2.1 TB of 5 TB + + + +
+
+ + NVENC HEVC · H.264 · AV1 + + + +
+
+
+
Render nodeBusy
+ Rendering Harbour sunset → 4K 10-bit HEVC for the server · 62 % · 11.3 fps +
+
Today3 jobs · 41 min GPU timeQueue1 waiting on the serverAvailabilitywhen idle for 2 min · never on battery
+ +
Node settings
+
+
+
+
+ Sequences + + + + + + + + +
+
SequenceThis PCServerState
+
Holy grail · Monvisooriginals · proxiesoriginals · proxies▲ settings differ
+
Harbour sunsetoriginals · proxiesoriginals · proxies● in sync
rendering on this PC as a node
+
Comet over the ridgeoriginals · proxies46 % received● uploading
+
Clouds over the Langheoriginals—local only
+
Construction cam · week 38proxiesoriginals · proxies● remote
+
Aurora, Tromsøoriginals · proxiesoriginals · proxies● in sync
+
Star trails, Colle del Nivoletoriginals · proxiesoriginals · proxies · 3 exports● in sync
+
Milan skyline dusk—originals · proxies · 1 export● remote
+ +
Last sync 10:15 · manifest diff 0.4 sServer archive 9.4 TB · 412 sequences · 6 usersOpen admin panel
+
+
+
+ 418 sequences640,118 photos9.4 TBConnected to "Studio NAS"2 jobs +
+
+
+
+ + diff --git a/docs/ui/mockups/Settings.html b/docs/ui/mockups/Settings.html new file mode 100644 index 00000000..6991a8d5 --- /dev/null +++ b/docs/ui/mockups/Settings.html @@ -0,0 +1,83 @@ + + + + +Titano — Settings + + + +
+
+ + Titano — Settings + + —▢✕ +
+
+ +
+
+ + + General + Archive + Import + Analysis + Rendering + Formats + Server + Updates + Licence + Advanced + + + +
+
+
RenderingChanges apply to the next job
+
+ Quality profile +
Best · Balanced · Fast
+ +
8 GBof 32 GB installed
+ Cache folder +
1.4 GB used · SSD · 612 GB free
+ Parallelism +
of 16 logical cores
+ Hardware encoding +
+
+
+
Encoders on this PCNVIDIA GeForce RTX 4070 · driver 560.94 · Media Foundation 10.0.26100
+
+
CodecEncoder10-bitMaxSelf-testUsed for
+
HEVCNVIDIA NVENC (hardware)Main108192×8192✓ 142 fps · ok4K archive · 4K HEVC · 1440p · cinema
+
H.264NVIDIA NVENC (hardware)—4096×4096✓ 188 fps · ok1080p share · social · square · 720p
+
AV1NVIDIA NVENC (hardware)10-bit8192×8192✓ 96 fps · oknot in any preset · available in Custom
+
H.264Microsoft (software)—4096×2304✓ 21 fps · okfallback for every H.264 preset
+
MJPEG · AVITitano (built in)—no limit✓ 64 fps · oklossless-ish intermediate
+
GIF · APNGTitano (built in)—1080p✓ okpreviews, social loops
+
+ Intel QSV and AMD AMF appear here on PCs that have them. HEVC and AV1 exist only as hardware encoders: without one, those presets fall back to H.264 and say so in the preset list. +
+
+
+
+
+
+ + diff --git a/docs/ui/mockups/Uploader.html b/docs/ui/mockups/Uploader.html new file mode 100644 index 00000000..653dc74e --- /dev/null +++ b/docs/ui/mockups/Uploader.html @@ -0,0 +1,70 @@ + + + + +Titano Uploader + + + +
+
+ + Titano Uploader + + —✕ +
+
+ + https://nas.local:8443 + · + alberto + · + Connected + + 1.9 TB free of 5 TB + +
+
+
+ + Drop photos, folders or a card here + +
+
+ Target + + + + +
+
+ Queue + 4,812 files · 96.2 GB · 38 MB/s · 41 min left + + + + Limit MB/s +
+
+
+
2026-09-28_18-02-11_0413.CR22,214 of 4,812 sent · 2,201 verified by the server · 0 retries
+
+
+ Watch folders + D:\Cam\Roof · every 60 s + \\garage-pi\cam · every 5 min + +
+ +
+ + + +
+
+
+ + diff --git a/docs/ui/mockups/Welcome.html b/docs/ui/mockups/Welcome.html new file mode 100644 index 00000000..83c9d379 --- /dev/null +++ b/docs/ui/mockups/Welcome.html @@ -0,0 +1,81 @@ + + + + +Titano — First run + + + +
+
+ + Titano + + —▢✕ +
+
+ +
+
Ready
+
+ + Year ▾ + Camera ▾ + Status ▾ +
+
No sequences yet
+
0 sequences0 photosNo archiveNot connected
+
+
+
+
+
+ + Welcome to TitanoWhere should your time-lapses live? + +
+
+ + + +
+
+ + + +
+
+
+ + New card inserted · SD 128 GBCanon EOS R5 · 4,812 photos · not yet known to Titano + + +
+
+ + diff --git a/global.json b/global.json new file mode 100644 index 00000000..d46d21e5 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} diff --git a/i18n/en/About.resx b/i18n/en/About.resx new file mode 100644 index 00000000..ce8aea99 --- /dev/null +++ b/i18n/en/About.resx @@ -0,0 +1,28 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Build + Data + Diagnostics bundle + Licence + View licence + Machine translated + Data folder + Releases + Suggest a fix + Runtime + System + Third-party code + None + Translation + Titano {0} available + Check for updates + Checking… + Up to date + Download + Check failed + Updates + diff --git a/i18n/en/Admin.resx b/i18n/en/Admin.resx new file mode 100644 index 00000000..0933d7a3 --- /dev/null +++ b/i18n/en/Admin.resx @@ -0,0 +1,323 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + API version + Database + TLS SHA-256 + Server name + Titano Server + Running for + Version + {0} changed the archive layoutlong + {0} started {1}long + {0} signed in · {1}long + failed sign-in as {0}long + {0} changed their passwordlong + {0} reset the password of {1}long + {0} created {1}long + {0} deleted {1}long + {0} edited a sequence · {1}long + {0} changed the server settingslong + {0} created user {1}long + {0} deleted user {1}long + {0} changed a user · {1}long + Cameras + Formats + File template + Name of new originals, e.g. {date}_{time}_{n:0000} + Folder template + Folder of new sequences, e.g. {year}/{date} {camera}; existing folders are never renamed + free + Health + Layout + Maintenance + Clean up stale caches and database entries + Name + Name of the archive shown to clients + Originals + Proxies + Long edge of the JPEG proxies built for editing and viewing + {0} px + Full size + Off + Job queued. + Rebuild + Rebuild the index from the sidecars on disk; files are not touched + Scan + Look for new and changed sequences on disk + Sequences + unverified + Verify + Read every original again and compare its SHA-256 + Cancel + Discard the changes + Close + Close this panel + Keep + Leave everything as it is + Load more + Show the next page + Refresh + Save + Save the changes on the server + Saved. + Recent activity + All logs + Open the audit log + Archive + Storage by year + discovery off + discovery on + {0} free + {0} queued · {1} done today · {2} failedlong + Jobs + up {0} · {1} · TLS {2} · {3}long + No activity yet + Nothing here yet + {0} sequences without proxieslong + Render nodes + of {0} + online + originals {0} + {0} photos · {1} cameras + Queue and history + Open the Jobs page + running + sequences + Storage + frames per day · {0} total · peak {1}long + Uploads · last 30 days + {0} workers + The server did not answer; try again.long + Adopt + Deep analysis + Duplicates + Import + Light analysis + Maintenance + Move + Orphans + Proxies + Rebuild + Render + Scan + Thumbnails + Upload + Verify + busy + cancelled + done + failed + idle + offline + paused + queued + running + Cancel + Cancel this job + Created + No jobs + Encoders + All + Cancelled + Done + Failed + Paused + Queued + Running + Show only jobs in this state + Forget + Remove this node; its running jobs go back to the queue + Forget {0}? + Last heartbeat + Kind + Show or hide the job log + {0} running · {1} nodes onlinelong + No render nodes + Node + Node + Render nodes + Owner + Pause + Stop at the next checkpoint and keep the progress + Background + Normal + Order in the queue: user jobs run before normal and background ones + User + Progress + Remove + Remove from the queue + Resume + Put the job back in the queue from its checkpoint + Retry + Queue the job again from its last checkpoint + server + State + Target + Language of this panel + Wrong user name or password.long + Only administrators can use this panel.long + Password + Your password; it is checked by the server only + Sign in + Sign in to administer this server + User + Your user name on this server + Archive layout + Job started + Sign-in + Failed sign-in + Password changed + Password reset + Sequence created + Sequence deleted + Sequence edited + Server settings + User created + User deleted + User changed + Details + Download + Save this log file + Nothing recorded yet + Log files + From + {0} lines + How many of the latest lines to show + Read the log again + Audit + Changes to users, sequences, the archive and settings + Server log + The latest lines of the server log, and the log files + Sign-ins + Who signed in, from where and when + What + When + Who + About + Version and certificate fingerprint + Archive + Archive path, templates, scan and verify + Dashboard + Storage, jobs and render nodes at a glance + Jobs + Queue, history and render nodes + Logs + Recent log lines and downloads + Settings + Server name, ports, TLS, limits and language + Users + Accounts, roles and quotas + Current password + The password you signed in with + The two passwords differ.long + New password + At least 10 characters; other sessions of this account end + Repeat + Type the new password again + Change password + Replace the password and continue to the panel + Choose a new password + Administrator + Editor + Uploader + Viewer + Chunk size (MiB) + Size of each upload chunk; smaller chunks resume faster on poor links + LAN discovery + Announce this server on the local network so clients find it + Fingerprint + SHA-256 of the certificate; clients ask the user to compare it once + HTTP port + Port of the admin panel and API over HTTP + HTTPS port + Port of the API over TLS for Titano clients + Job history (days) + Days finished jobs are kept + Language + Language of server messages when a client asks for none + Limits and retention + Set by the environment variable {0} + Max file (MB) + Largest single upload accepted + Network and TLS + Restart required + Saved ports, TLS, workers, chunk size or job history apply after a restart + Server + Server name + Name shown to clients and on the LAN + Self-signed + Own certificate + Reverse proxy + Certificate + PEM certificate file used in Own certificate mode + Private key + PEM private key file used in Own certificate mode + TLS mode + How HTTPS is provided + Session days + Days a client stays signed in without being used + Abandoned after (h) + Hours after which unfinished uploads are discarded + Workers + Jobs this server runs at the same time + Sign out + Sign out of the admin panel + Active + Password copied. + Copy the password + Create + Create the account + Delete… + Delete the account; its sequences are reassigned to you + The account and its sessions are removed; its sequences become yours.long + Delete + Delete {0}? + Disable + Disable: sessions end, files stay + Disabled + Display name + Shown in the client and in activity + Edit + Change name, role, quota or render-node right + Edit user + No users match + Enable + Re-enable the account + {0} free on the server + Last seen + {0} accounts · {1} active + must change password + Must change password + Always required for accounts created here + New user + Create an account; the user must change the password at first sign-in + Passwords: PBKDF2-SHA512, {0} characters minimum · tokens expire after {1} days idlelong + Quota + Originals uploaded by this user count against the quota; 0 = unlimited + {0} of {1} + Generate another + May act as render node + Lets this user's PC take render jobs from the server + Reset password + Set a temporary password; the user must replace it and their sessions end + Role + Everything, including users and settings + Import, edit, render, upload and download + Upload only; cannot edit sequences + Browse and download renders only + Search + Filter by user or display name + Sign-in log + Who signed in from where, and when + Status + Temporary password + Give this to the user; they must replace it at first sign-in + Uploads 30 d + User + Username + Letters, digits, dot and dash; cannot be changed later + diff --git a/i18n/en/Advisor.resx b/i18n/en/Advisor.resx new file mode 100644 index 00000000..fad2d883 --- /dev/null +++ b/i18n/en/Advisor.resx @@ -0,0 +1,107 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + {0} frames are black (lens cap or missed exposure).{0} frame count + The camera body changes {0} times.{0} change count + The camera clock jumps {0} times (largest jump {1:0} s).{0} jump count; {1} largest jump in seconds, signed + Clouds cover about {0:0}% of the sky on average.{0} mean cloud coverage in percent + Covers day and night: {0} day, {1} twilight and {2} night frames.{0} day frames; {1} twilight frames; {2} night frames + {0} frames repeat the previous frame.{0} frame count + {0} frames share their capture time with the previous frame.{0} frame count + {0} exposure changes, typically {1:0} frames apart, {2:+0.0;-0.0;0} EV in total.{0} step count; {1} median frames between steps (0 with one step); {2} summed camera EV change + Brightness flickers by {0:0.###} EV around its smooth course.{0} RMS flicker in EV + {0} gaps in the cadence; the longest lasts {1:0} s.{0} gap count; {1} longest gap in seconds + Intervals vary by {0:0.##} s around {1:0.##} s.{0} interval jitter (median absolute deviation) in seconds; {1} median interval in seconds + The lens changes {0} times.{0} change count + {0} frames have no shutter time or aperture in their metadata.{0} frame count + {0} frames have a different orientation.{0} frame count + {0} frames differ from the main size {1}×{2}.{0} frame count; {1} main width in pixels; {2} main height in pixels + Only {0} of {1} frames have a capture time, so cadence and gaps cannot be measured.{0} frames with a capture time; {1} frames in total + {0} frames are out of time order.{0} frame count + The view drifts by {0:0.##} px per frame (pan or slider).{0} drift in source pixels per frame + The view jumps at {0} frames (camera moved or bumped).{0} frame count + Shot in {0} separate sessions.{0} session count + The camera shakes by {0:0.##} px RMS; hiding it costs {1:0.#}% of the frame.{0} shake RMS in source pixels; {1} crop cost in percent of the area + Stars are visible on {0} frames.{0} frame count + {0} logged exposure changes never reached the pixels.{0} step count + No time zone recorded; a UTC offset of {0} min was estimated from the longitude.{0} UTC offset in minutes + {0} frames could not be decoded.{0} frame count + Colour balance jumps by {0:0.#}% between frames.{0} RMS colour-ratio jitter in percent + {0} frames are blown out to white.{0} frame count + Needs the deep analysis of the pixels, which has not run yet; nothing was changed.no placeholders + Shutter time or aperture is missing from the metadata, so this cannot be decided; nothing was changed.no placeholders + Too few frame pairs to measure motion; nothing was changed.no placeholders + Shake was measurable on only {0}% of the frames (too little texture); nothing was changed.{0} percent of frame pairs with a measured shift + The source resolution is unknown; nothing was changed.no placeholders + Only {0} of {1} frames have a capture time, so this cannot be measured; nothing was changed.{0} frames with a capture time; {1} frames in total + Construction cam — {0} {1} {2} fps, adaptive timing{0} resolution label such as 1080p; {1} codec label such as H.264; {2} frame rate + Holy grail sunset — {0} {1} {2} fps, transitions {3}{0} resolution label such as 4K; {1} codec label such as HEVC; {2} frame rate; {3} transition length in frames + Night sky — {0} {1} {2} fps, deflicker {3}{0} resolution label such as 4K; {1} codec label such as HEVC Main10; {2} frame rate; {3} deflicker window in frames + Night sky — {0} {1} {2} fps, deflicker {3}, stabilise{0} resolution label such as 4K; {1} codec label such as HEVC Main10; {2} frame rate; {3} deflicker window in frames + Social vertical {0}×{1}{0} width in pixels; {1} height in pixels + Standard — {0} {1} {2} fps{0} resolution label such as 1080p; {1} codec label such as H.264; {2} frame rate + {0} sessions over {1} days with pauses: adaptive timing in a widely compatible 1080p file.{0} session count; {1} capture span in days + {0} exposure steps across a {1} EV change of light: smooth day-to-night transitions.{0} received step count; {1} change of scene brightness in EV + Stars or a dark sky on {0}% of the frames: dark gradients need 10 bits and steady brightness.{0} percent of frames with stars, or of dark frames + A 9:16 crop for phones and social feeds.no placeholders + General settings for this sequence.no placeholders + The {0}×{1} source cropped to 16:9 keeps {2}% of its height.{0} source width in pixels; {1} source height in pixels; {2} kept height in percent + The source is already 16:9.no placeholders + Portrait source: 9:16 fills a phone screen.no placeholders + The {0}×{1} source cropped to 16:9 keeps {2}% of its width.{0} source width in pixels; {1} source height in pixels; {2} kept width in percent + Flicker is {0} EV, below the visible 0.02 EV: deflicker stays off.{0} RMS flicker in EV + Brightness deviates by {0} EV from its smooth course: deflicker removes the flicker.{0} RMS flicker in EV + {0} black, white, duplicate or unreadable frames would flash or stutter in the video: excluded.{0} frame count + Night sky: 10-bit HEVC keeps dark gradients free of banding.no placeholders + Best preset for a {0}×{1} output with the available encoders.{0} output width in pixels; {1} output height in pixels + Portrait framing: vertical 1080×1920 for phones.no placeholders + The plan is scaled so the {0} frames last {1} s at {2} fps.{0} frame count; {1} target duration in seconds; {2} frame rate + Balanced flow quality is enough for motion blur and previews.no placeholders + Interpolated frames need per-pixel motion: best flow quality.no placeholders + Moderate motion ({0} px per frame): the 24 fps cinema rate gives a {1} s clip.{0} speed of moving content in output pixels per frame; {1} clip duration in seconds + Slow or unmeasured motion: 30 fps gives a {0} s clip.{0} clip duration in seconds + Fast motion ({0} px per frame): 24 fps slows it down; the clip lasts {1} s.{0} speed of moving content in output pixels per frame; {1} clip duration in seconds + {0} frames fill {1} s best at {2} fps.{0} frame count; {1} target duration in seconds; {2} frame rate + {0} frames: 60 fps keeps the clip to {1} s.{0} frame count; {1} clip duration in seconds + Capture over several sessions: 30 fps gives a {0} s clip.{0} clip duration in seconds + Only {0} frames: 24 fps keeps the clip {1} s long.{0} frame count; {1} clip duration in seconds + The horizon sits {0}% from the top: the crop places it on the nearest third.{0} horizon position in percent of the source height + Frame {0} is sharp and well exposed, without clipped highlights.{0} frame number, counted from 1 + {0} exposure changes in the metadata (pixels not checked yet): each is spread over a smooth transition.{0} logged step count + Exposure settings never change: no transitions needed.no placeholders + The camera logged {0} exposure changes but the pixels show none: no transitions needed.{0} logged step count + {0} exposure changes reached the pixels: each is spread over a smooth transition.{0} received step count + The exposure already gives a {0}° shutter angle, at least the {1}° target: no synthetic blur needed.{0} real shutter angle in degrees; {1} target angle in degrees + Content moves only {0} px per frame: blur would be invisible, so it stays off.{0} speed of moving content in output pixels per frame + Real shutter angle {0}° and motion of {1} px per frame: blurring to {2}° adds {3} px trails that hide strobing.{0} real shutter angle in degrees; {1} speed of moving content in output pixels per frame; {2} target angle in degrees; {3} added trail in output pixels + Horizon found with {0}% confidence: sky and land are deflickered separately.{0} mask confidence in percent + Sky separated by brightness with {0}% confidence: sky and land are deflickered separately.{0} mask confidence in percent + The sky/land split is only {0}% reliable: one curve for the whole frame is safer.{0} mask confidence in percent + The {0} encoder handles at most {1}×{2}.{0} encoder name; {1} maximum width in pixels; {2} maximum height in pixels + {0} frames decode only as {1}×{2} embedded previews, which cap the output.{0} frame count; {1} preview width in pixels; {2} preview height in pixels + Largest standard size within the {0}×{1} source.{0} source width in pixels; {1} source height in pixels + 180° is the film look; the real shutter angle is {0}° ({1} s exposure every {2} s).{0} real shutter angle in degrees; {1} median exposure time in seconds; {2} median interval in seconds + Shake of {0} px at output size, but hiding it crops {1}% of the frame: check the framing.{0} shake RMS in output pixels; {1} crop cost in percent of the area + Measured shake of {0} px at output size (0.3 px or less): the camera was steady.{0} shake RMS in output pixels + Measured shake of {0} px at output size (above 0.3 px): stabilisation crops {1}% of the frame area.{0} shake RMS in output pixels; {1} crop cost in percent of the area + Smoothing the camera path over {0} frames removes shake and keeps deliberate pans.{0} smoothing sigma in frames + Strong flicker ({0} EV): every frame lands on the smooth curve.{0} RMS flicker in EV + Mild flicker ({0} EV): reliable frames keep 20% of their own variation.{0} RMS flicker in EV + Intervals vary by {0} s around {1} s: adaptive timing follows the capture clock so motion stays even.{0} interval jitter in seconds; {1} median interval in seconds + {0} gaps in the cadence: adaptive timing keeps the output pace true to capture time.{0} gap count + Steady {0} s interval (jitter {1} s): each photo becomes one video frame.{0} median interval in seconds; {1} jitter in seconds + Shot in {0} sessions with pauses up to {1} h: adaptive timing keeps the pauses short and the pace even.{0} session count; {1} longest pause in hours + {0} short gaps, but motion is unmeasured or fast: constant timing skips them cleanly.{0} gap count + {0} short gaps and smooth motion ({1} px per frame): interpolated frames fill the gaps.{0} gap count; {1} speed of moving content in output pixels per frame + A single exposure step: a {0}-frame transition keeps the change gentle.{0} transition length in frames + Exposure steps are {0} frames apart: transitions of half that ({1} frames) never overlap.{0} median frames between steps; {1} transition length in frames + Colour balance is steady ({0}% from frame to frame): no smoothing needed.{0} RMS colour-ratio jitter in percent + Colour balance jumps by {0}% from frame to frame: smoothing steadies it and keeps the slow drift.{0} RMS colour-ratio jitter in percent + Flicker stays correlated over {0} frames: a {1}-frame window spans four times that.{0} correlation length in frames; {1} window in frames + Flicker drifts over {0} frames: the window is capped at {1} frames so real changes of light survive.{0} flicker period or correlation length in frames; {1} window in frames + Flicker changes from frame to frame without a rhythm: the shortest robust window, {0} frames, removes it.{0} window in frames + Flicker repeats every {0} frames: a {1}-frame window averages four cycles.{0} flicker period in frames; {1} window in frames + diff --git a/i18n/en/Archive.resx b/i18n/en/Archive.resx new file mode 100644 index 00000000..a5952f47 --- /dev/null +++ b/i18n/en/Archive.resx @@ -0,0 +1,30 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + No archive yet + Another Titano ({0}) is writing here. Try again shortly.long: error sentence + The copy of {0} does not match the original.long: error sentence + {0} could not be added to the sequence.long: error sentence + {0} was written by a newer Titano (format {1}).long: error sentence + The archive {0} is offline.long: error sentence + The archive {0} is read-only.long: error sentence + {0} changed after the plan was made.long: error sentence + The card or folder {0} is no longer available.long: error sentence + The archive changed after this plan was made.long: error sentence + Dry run: nothing was changed.long: job log line + Not indexed: {0} ({1})long: job log line + Changed: {0}long: job log line + Damaged: {0}long: job log line + Missing: {0}long: job log line + {0}: {1} made, {2} reused, {3} unreadablelong: job log line + {0} copied, {1} skipped, {2} failedlong: job log line + Not copied: {0} ({1})long: job log line + {0} stale locks, {1} temporary files, {2} packs compacted, {3} duplicate flags changedlong: job log line + {0} unindexed photos, {1} missing photoslong: job log line + {0} folders, {1} indexed, {2} adopted, {3} removedlong: job log line + Sequence not found: {0}long: job log line + {0} photos checked, {1} intact, {2} hashed, {3} with problemslong: job log line + diff --git a/i18n/en/Common.resx b/i18n/en/Common.resx new file mode 100644 index 00000000..bcf09a3a --- /dev/null +++ b/i18n/en/Common.resx @@ -0,0 +1,16 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Auto + {0} d {1} h + {0} h {1} m + {0} min + {0} s + n/a + Open + Open logs + {0} % + diff --git a/i18n/en/Editor.resx b/i18n/en/Editor.resx new file mode 100644 index 00000000..2de00b56 --- /dev/null +++ b/i18n/en/Editor.resx @@ -0,0 +1,8 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Pick a sequence in the Library + diff --git a/i18n/en/Errors.resx b/i18n/en/Errors.resx new file mode 100644 index 00000000..a57f5095 --- /dev/null +++ b/i18n/en/Errors.resx @@ -0,0 +1,25 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + The archive could not be opened.long + Enter a whole number from {0} to {1}. + Enter a folder. + This is not a valid folder path. + This path is a file, not a folder. + The drive of this folder is not available. + Enter a full path that starts with a drive or a network share. + Enter a server address such as nas.local:8443 or https://titano.example.com. + This file does not contain Titano settings. + The template is empty. + Empty token at position {1}: write a name between the braces. + File names cannot contain a slash; put folders in the folder template. + The format after the colon does not suit its token. + Names would repeat: add the frame number, the time or the original name. + The brace opened at position {1} is never closed. + Unknown token “{0}” at position {1}. + The closing brace at position {1} has no opening one; double it for a literal brace. + Something went wrong. + diff --git a/i18n/en/Export.resx b/i18n/en/Export.resx new file mode 100644 index 00000000..b5dafdeb --- /dev/null +++ b/i18n/en/Export.resx @@ -0,0 +1,60 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + {0}-bit output is not available with this encoder; encoding at {1}-bit.long; {0} requested bit depth; {1} bit depth used + Bit rate capped at {1} bit/s, the maximum of level {0}.long; {0} codec level name; {1} maximum bit rate in bit/s + No {0} encoder on this PC; H.264 is used instead.long; {0} codec name + The server cannot encode {0}; a render node or the desktop client will.long; {0} codec name + No encoder available for {0}.long; {0} codec name + Resolution reduced to {1}, the maximum of {0}.long; {0} encoder name; {1} size as WIDTHxHEIGHT + Resolution reduced to {1}, the maximum of level {0}.long; {0} codec level name; {1} size as WIDTHxHEIGHT + No hardware encoder: {0} encodes in software, which is slower.long; {0} encoder name + {0} cannot encode 10-bit; 8-bit is used.long; {0} encoder name + Playback rate not understood; the export frame rate is used.long + No capture times: frames are spaced evenly.long + Every frame is excluded.long + The time curve went backwards and was straightened.long + 1080p 60 fpsinvariant + Share 1080p + 1440p H.264invariant + 4K 60 fpsinvariant + 4K archive + 4K AV1invariant + 4K H.264invariant + 4K HEVCinvariant + 8K archive + Animated PNG + Cinema 21:9invariant + DCI 4Kinvariant + Animated GIF + JPEG frames + Linear DNG + MJPEG AVIinvariant + PNG frames + Portrait 4:5 + Preview 720p + Square 1:1 + TIFF 16-bit + Vertical 9:16 + The preset's {1} frame replaces the {0} aspect ratio.long; {0} requested aspect ratio; {1} preset frame as W:H + Aspect ratio “{0}” not understood; the source aspect ratio is used.long; {0} aspect ratio text as entered + Motion blur is off while frames are stacked.long + The crop lies outside the frame and is ignored.long + Easing “{0}” not understood; linear is used.long; {0} easing name as entered + The keyframe at frame {0} is invalid and was skipped.long; {0} source frame number + Highlight knee {0} is out of range and is ignored.long; {0} knee value as entered + Every frame is excluded; there is nothing to render.long + No sky and land mask; deflicker uses the whole frame.long + The sky and land mask is uncertain (confidence {0}); deflicker uses the whole frame.long; {0} mask confidence between 0 and 1 + Strong shake: stabilisation would keep only {0} of the frame, so borders may show.long; {0} kept fraction of the frame between 0 and 1 + Stabilisation is unavailable: too little detail to track.long + The container does not suit the codec; the codec's container is used.long + Unknown codec; the preset's codec is used.long + Unknown frame rate; the preset's frame rate is used.long + Unknown preset; the default preset is used.long + Unknown profile; the codec's default profile is used.long + Unknown rate control; the preset's rate control is used.long + diff --git a/i18n/en/Import.resx b/i18n/en/Import.resx new file mode 100644 index 00000000..1dd4adb7 --- /dev/null +++ b/i18n/en/Import.resx @@ -0,0 +1,8 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Insert a card or pick a folder + diff --git a/i18n/en/Jobs.resx b/i18n/en/Jobs.resx new file mode 100644 index 00000000..a165f36d --- /dev/null +++ b/i18n/en/Jobs.resx @@ -0,0 +1,66 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Cancel + Folder + Move up + Open + Pause + Remove + Resume + Retry + Show + {0} left + Clear done + Kind + Left + Progress + Speed + State + Target + Where + {0} / {1} + No jobs yet + All · {0} + Done · {0} + Failed · {0} + Queued · {0} + Running · {0} + History keeps {0} day + History keeps {0} days + Adopt folder + Deep analysis + Duplicates + Import + Light analysis + Maintenance + Move archive + Orphans + Proxies + Rebuild index + Render + Scan + Thumbnails + Upload + Verify + after {0} + next + No log lines yet + Pause all + Rendering settings + Search target or kind + {0} fps + {0}/s + cancelled + done + failed + paused + queued + running + {0} · {1} + this PC + Workers {0} / {1} + diff --git a/i18n/en/Library.resx b/i18n/en/Library.resx new file mode 100644 index 00000000..8d365087 --- /dev/null +++ b/i18n/en/Library.resx @@ -0,0 +1,70 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Analyse + Clear selection + Export list + Folder + Open + Proxies + Verify + Adopt a folder + Clear filters + Camera + Date + Folder + Frames + Interval + Sequence + Size + Span + State + Tags + No sequences yet + Adopt a folder + Connect to a server + Import a card + Open an archive + List exported + Show + Export the list to + All cameras + Any status + All tags + All years + Camera + Status + Analysed + Without proxies + Not analysed + Not verified + With proxies + Verified + With warnings + Tags + Year + {0} s + No sequences match the filters + {0} queued · {1} + Rescan + Search title, camera, tag + {0:N0} selected + {0:N0} selected + Sort + Most frames + Newest first + Oldest first + Largest first + Title + Analysed + Analysing + Proxies + Remote + Synced + View + Grid + List + diff --git a/i18n/en/Server.resx b/i18n/en/Server.resx new file mode 100644 index 00000000..512ef763 --- /dev/null +++ b/i18n/en/Server.resx @@ -0,0 +1,101 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + nas.local:8443invariant + Certificate + Forget + Keep + Titano trusts this certificate for this server. Forgetting it disconnects, and the next connection asks again.long + Server certificate + TLS {0} trusted {1} + Connect + Disconnect + Not connected to a server + Too many failed sign-ins; the account is locked for a while.long + Wrong user name or password.long + The request is not valid.long + The server certificate changed; confirm it and sign in again.long + This upload has no such chunk.long + The chunk has the wrong size.long + The file could not be stored in the archive; try again.long + The security token is missing; reload the page.long + The connection failed; the log has the details.long + Your account cannot do this.long + The file arrived damaged; upload it again.long + Open the admin panel over HTTPS to sign in.long + Some chunks are still missing.long + The server is out of disk space.long + Unexpected server error; try again.long + That is not a valid server address.long + Wrong user name or password.long + The paging cursor is not valid; start from the first page.long + The file name is not valid.long + A filter value is not valid.long + The SHA-256 must be 64 hexadecimal characters.long + This job kind cannot be started here.long + The job parameters are not valid.long + The priority must be background, normal or user.long + The role must be admin, editor, uploader or viewer.long + The setting {0} is not valid.long + The settings must be valid JSON.long + The job cannot do that in its current state.long + The naming template is not valid.long + Use letters, digits, dot, dash or underscore.long + This job is no longer assigned to this node.long + This server cannot run that kind of job.long + The last administrator cannot be removed or disabled.long + This method is not allowed here.long + Not found.long + That address is not a Titano Server.long + Change your password first.long + This upload would exceed your quota.long + Too many attempts; wait a minute and try again.long + Choose a password different from the current one.long + You cannot do this to your own account.long + The session expired; sign in again.long + An environment variable sets this; change it there.long + The sequence changed on the server; reload it and apply your edit again.long + The request is larger than the server accepts.long + Too many uploads at once; retry shortly.long + Sign in to continue.long + The server does not answer; check the address and the network.long + Send the body as JSON.long + The certificate was not trusted, so nothing was sent.long + This upload is not accepting that request now.long + That user name is taken.long + Use at least {0} characters.long + Connect with a WebSocket.long + The current password is wrong.long + This upload belongs to a render job.long + Servers found + Account + Server + Status + {0} ms + Cancel + Password + Sign in + Sign in + User + {0} of {1} + {0} used + Offer this PC as render node + Admin + Editor + Uploader + Viewer + Titano time-lapse archive, uploads, jobs and rendering server.long + Sign out + Connected + Connecting… + Disconnected + Not connected + Trust + Cancel + {0} uses a certificate Titano does not know yet. Compare the fingerprint with the one in the server's admin panel before you trust it.long + Trust this server? + v{0} + diff --git a/i18n/en/Settings.resx b/i18n/en/Settings.resx new file mode 100644 index 00000000..1604e694 --- /dev/null +++ b/i18n/en/Settings.resx @@ -0,0 +1,110 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Database + Index backed up + Back up now + Data folder + Diagnostics + Diagnostics bundle saved + Save the diagnostics bundle to + Export bundle + Logs + Portable mode + Off + On + File names + Folders + {0} free + Full size + Choose the archive folder + Preview + Proxy size + Archive folder + Back to Auto + Choose folder + Export… + Settings exported + Export the settings to + Check on start + Language + Theme + Dark + Light + System + Updates + Usage counts + Send anonymous counts + Import… + Settings imported + Titano settings + Import settings + Advanced + Analysis + Archive + Formats + General + Import + Licence + Rendering + Server + Storage + Updates + Auto · {0} + Low priority while editing + Codec + Encoder + Max + Self-test + 10-bit + of {0} logical cores + {0} (built in) + {0} (hardware) + {0} (software) + {0} encoder + {0} encoders + Encoders on this PC + failed + {0} GB + Hardware encoding + of {0} GB installed + Memory budget + no limit + Parallelism + {0} fps · ok + Prefer hardware + Hardware for previews only + Quality profile + Balanced + Best + Fast + Re-detect + Run self-test + Software only + 10-bit + testing… + Reset section + Search settings + Trusted certificates + Default server + None + Render node + Clear + Spilled frames and decoded thumbnails are deleted and rebuilt when needed. Originals, proxies and renders are not touched.long + Clear the cache? + {0} freed + Cache folder + Keep + Cache limit + GB + Titano did not create this folder, so nothing was deleted.long + Choose the cache folder + Thumbnails in memory + thumbnails + {0} used · {1} free + {0} used + Latest version + diff --git a/i18n/en/Setup.resx b/i18n/en/Setup.resx new file mode 100644 index 00000000..23dab393 --- /dev/null +++ b/i18n/en/Setup.resx @@ -0,0 +1,49 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Cancel + Close + Close programs + Install + Launch + Retry + Uninstall + Update + Server for Windows + Titano + Uploader + {0} is installed. + {0} was removed. + Windows denied access to the folder.long + The command line is not valid.long + There is not enough free disk space.long + Administrator approval was declined.long + Setup could not finish.long + {0} is not installed.long + This installer is damaged; download it again.long + {0} did not close.long + Some files could not be removed.long + Components + Folder + Language + Options + Install for + Browse + Version {0} · installed {1} + Version {0} + Desktop shortcut + Start when done + Start menu + Installing {0} + Removing {0} + Close {0} to continue. + All users + Just me + {0} needed + Remove my data + {0} Setup + Remove {0} + diff --git a/i18n/en/Shell.resx b/i18n/en/Shell.resx new file mode 100644 index 00000000..a2ff72aa --- /dev/null +++ b/i18n/en/Shell.resx @@ -0,0 +1,40 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Titanoinvariant + Ready + Ready · {0} jobs queued + About + Archive + Import + Jobs + Library + Sequence + Server + Settings + Connected to "{0}" + {0:N0} job + {0:N0} jobs + No archive + Not connected + {0:N0} photo + {0:N0} photos + {0:N0} sequence + {0:N0} sequences + Adopt an existing folder + Change… + Choose… + Help improve Titano with anonymous usage countslong + Continue + Found + Create a local archive + {0} · {1} free + Choose where the archive lives + Where should your time-lapses live?long + Connect to a server + {0} on this network · {1} + Welcome to Titano + diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx new file mode 100644 index 00000000..7ca6cbe4 --- /dev/null +++ b/i18n/en/Tooltips.resx @@ -0,0 +1,254 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Ask the public releases page for a newer version · a few seconds + Zip the logs and an environment report into a folder you choose; settings and passwords are not included + Open the release page in the browser + Open the licence in the browser + Open the folder with database, settings and logs + Open the public releases page in the browser + Every language but English is machine-translated; propose a better wording on the public issue tracker + Titano uses no third-party code: everything beyond .NET and Windows is written in-house + Dismiss + Open the folder with the log files + Return to the advisor's value + Stop this job; Retry continues later from its last checkpoint + Hide finished jobs from the list; they stay in the history + Every job + Finished jobs + Stopped with an error or cancelled + Waiting for a worker + Working now or paused + Show the folder in Explorer + Hide the log + Finished jobs older than this are removed when Titano starts + Raise the priority: it runs before jobs of lower priority + Open what this job worked on + Pause at the next checkpoint; Resume continues from there + Pause every running job; the queue keeps its order + Hold this job in the queue until you resume it + Remove from the queue; the job is cancelled + Parallelism, hardware preference, memory budget + Put the job back in the queue; it continues from its checkpoint + Run again from the last checkpoint + Filter by target or kind as you type + Open what this job worked on to see the problem + Show the last lines of the log + Cancelled; Retry continues from the last checkpoint + Finished; the run time follows the dot + Stopped with an error; Retry continues from the last checkpoint + Paused; Resume continues from the checkpoint + Waiting for a worker on this PC + Working now + Jobs running on this PC out of the job engine's workers + Index photos you already have, in place; choose their top folder + Deep analysis of every frame · runs as a job in the background + Deep analysis of the selected sequences · runs as one job + Show only one camera + Click selects · Ctrl+click adds · double-click opens · move over the picture to scrub + Show every sequence again + Deselect every sequence + Work with the archive of a Titano Server + Save the selected rows as CSV in a folder you choose + Show the sequence folder in Explorer + Cards with thumbnails + Copy and verify photos from a memory card + Table with sortable columns + Open in the sequence editor · Enter + Use an existing archive folder on this PC or the network + Build JPEG proxies for fast editing · runs as a job + Build proxies of the selected sequences · runs as one job + Rescan the archive for changes · runs as a job + Click selects · double-click opens + Search titles, camera makes and models, and tags as you type + Add to the selection or remove from it + Show the file in Explorer + Order of the sequences + Sort by first capture; click again to reverse + Sort by number of frames, most first + Sort by size on disk, largest first + Sort by title, A to Z + Filter by analysis, proxies, verification or warnings + Analysed: exposure, flicker and motion are measured + An analysis job is running on this sequence + Some frames are missing or unreadable; open the sequence for details + No proxies yet; editing reads the originals + Not analysed yet + JPEG proxies built for fast editing + Lives on the server; this PC has proxies at most + Rendered once + Rendered {0:N0} times + The same on this PC and on the server + {0:N0} warning; open the sequence for details + {0:N0} warnings; open the sequence for details + Show only one tag + Re-read every file and compare its hash with the index · runs as a job + Verify the hashes of the selected sequences · runs as one job + Show only one year of first capture + Version, diagnostics and links + Scan, verify and maintain the archive · Ctrl+4 + Import photos from a card or folder · Ctrl+2 + Queue and history of long operations · Ctrl+5 + Browse every sequence of the archive · Ctrl+1 + Edit and render the open sequence · Ctrl+3 + Connection, sync and render node · Ctrl+6 + Preferences of this PC · Ctrl+, + Address of the Titano Server; https is assumed · Enter connects + Show the full fingerprint, or forget the trust + Fingerprint trusted on first use; a change blocks the connection and asks you again + Identify the server, confirm a new certificate, then sign in · Enter + Close the session and work with the local archive only; you stay signed in + Do not connect; nothing is sent to this server + SHA-256 fingerprint of the server certificate + Forget this certificate; the next connection asks again + Servers found on this network and used before + Keep trusting this certificate + Close without signing in · Esc + Sent only to this server; Titano keeps a session token, never the password + Your user name on the server + Space you use on the server out of your quota + Let the server send render jobs to this PC when it is idle; uses your GPU encoders + Admins manage users, the archive and the server + Editors import, edit and render; only admins manage users + Uploaders send photos; editing needs an editor + Viewers browse and download + Sign in; the token is stored encrypted for this Windows user · Enter + Sign out; the token is removed from this PC + Connection to the server + Trust this certificate for this server and continue to sign in + Use this address + Graphics adapter and Media Foundation encoders found + Free space on the archive drive + Root of the local archive; files are not moved · Enter applies, Esc reverts + Lower the job priority while Titano is in front so the interface stays fluid + Copy the index to the backups folder; the newest three are kept · a few seconds + Choose the archive folder + Choose the cache folder; a fast SSD helps + Where frames spill and thumbnails are kept; a fast SSD helps · Enter applies, Esc reverts + Largest size of the disk cache in GB · Enter applies, Esc reverts + Space the cache uses and free space on its drive + Look for a new release when Titano starts · no data is sent + Delete the cache contents now + Delete spilled frames and cached thumbnails; asks first + Database, settings, logs and caches of this PC + Server Titano connects to at start; changing it signs out · Enter applies, Esc reverts + Zip the logs and an environment report into a folder you choose + Save every setting as JSON, without the session token + File name of each frame, for example {date}_{time}_{n:0000}; the extension is added · Enter applies, Esc reverts + Archive folders, for example {year}/{date} {camera}; a slash starts a subfolder · Enter applies, Esc reverts + Load settings from a JSON file; the session and the window layout stay as they are + Keep the cache as it is + Language of the interface · applies immediately + Daily log files, kept for 14 days + Frames stay in memory up to this budget, then spill to the cache folder + Auto: a quarter of installed memory + Back to Auto: a quarter of installed memory + Open the data folder in Explorer + Portable mode, logs, diagnostics, database backup + Archive folder, naming templates, proxy size + Language, theme, usage counts + Quality profile, memory budget, parallelism, encoders + Default server, render node, trusted certificates + Cache folder, thumbnails in memory, cache limit + Update check on start + Worker threads for decoding and processing · Enter applies, Esc reverts + Auto: cores minus four so the interface stays responsive + Back to Auto: cores minus four + On when portable.txt sits next to Titano.exe: all data stays in its data folder + Use a hardware encoder when one supports the preset; software otherwise + First three names of a sample import with these templates + Hardware for previews, software for archive presets + Long edge of the JPEG proxies built for new sequences + Balanced suits most work; Best doubles sampling and never spills; Fast is for previews + List the encoders again after a driver or codec install + Return every control of this section to its default + Find a setting by name + Encode a short synthetic clip with every encoder and report pass or fail and speed · about a minute + Speed on the synthetic 1280×720 test clip + Always the Microsoft software H.264 encoder; slower, identical everywhere + Dark interface (default) + Light interface + Follow the Windows app mode + Decoded thumbnails kept in memory; more scrolls faster and uses more RAM · Enter applies + Send a daily anonymous count of versions and languages in use; nothing else, off by default + Install in Program Files for every account · asks for administrator approval + Return to the options without changing anything + Choose the installation folder + Close setup + Ask the running programs to close · each one handles its unsaved work + Install this program + Runs Titano Server on this PC for other devices and render nodes + The desktop app to import, archive and render time-lapses + Sends photos from watched folders to a Titano Server + Add shortcuts to the desktop + Where the programs are installed · your data stays in its own folder + Enter a full folder path that is not a drive root or a system folder + Copy the selected programs and register them with Windows + Folder of the installed programs + Install in your user folder · no administrator rights needed + Language of this setup + Open the program when setup finishes + Open the installed program + Already installed here · uninstall it first to change folder or scope + Also delete database, settings and logs in %LOCALAPPDATA%\Titano · photos in archives are not touched + Run the same step again + Add the programs to the Start menu + Remove programs, shortcuts and file types · your data is kept unless selected + Replace the installed version in place · your data is kept + Collapse navigation to icons + Show navigation names + Pause the job shown; it continues from its checkpoint when resumed + Stop the current job · it can be resumed later + Add a folder to watch + Pick files, a folder or a card + Pick one or more photos + Pick a folder or a card; every photo inside is added + Do not connect to this server + Choose the sequence + Close settings + Delete each source file once the server has verified it + Delete the local file only after the server has confirmed its hash; asks before turning on + Titano Server found on this network · click to use it + SHA-256 fingerprint of the server certificate + Leave source files where they are + Bandwidth limit in MB/s; 0 means no limit + Closing the window keeps the uploader running in the tray + Title of the new sequence; leave empty to let the server name it + Your password; only a sign-in token is kept, encrypted for your Windows account + Pause; the queue survives a restart + Space left in your quota on the server + Stop watching this folder; files already uploaded stay on the server + Resume uploading + Try again + Try this file again now + Address of the Titano Server, such as https://nas.local:8443 + Server, sign in, bandwidth, startup, tray + Check the server certificate and sign in + Sign out and forget the saved token + Run when you sign in to Windows + Stop and clear the queue; uploaded files stay on the server + Create one new sequence with a title you type + Add every file to one existing sequence + The server splits the files into sessions and creates the sequences + Remember this certificate; trust it only if the fingerprint matches the one on the server + Your user name on the Titano Server + Checked every {0}; a file is uploaded once it has stopped growing · click to change or remove + The folder cannot be reached; it is checked again every {0} · click to change or remove + Network share; polled every {0} because change notifications are unreliable on SMB · click to change or remove + Check the folder at this interval + Index photos you already have, without moving them + Choose another folder for the archive + Choose the folder to adopt + Start with the highlighted choice · Enter + Announced on this network a moment ago + Interface language; you can change it later in Settings + Creates the folder layout and the index here; you can move it later + Sign in to a Titano Server on your network or on the internet + Close + Maximize + Minimize + Restore + diff --git a/i18n/en/Uploader.resx b/i18n/en/Uploader.resx new file mode 100644 index 00000000..4dbacf76 --- /dev/null +++ b/i18n/en/Uploader.resx @@ -0,0 +1,107 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Add folder + Close + Pause + Resume + Retry + Stop + Titano Uploaderinvariant + All files + Browse… + Files… + Add photos + Folder or card… + Folder or card + Photos + Watch a folder + https://nas.local:8443invariant + Wrong user name or password.long + The server reported an error.long + Enter an address such as https://nas.local:8443.long + This address is not a Titano Server.long + The server did not answer.long + The server certificate was not trusted.long + Found + Password + Server + Sign in + Connect to server + User + Delete after upload + Keep files + Each file is deleted from this PC only after the server has verified its hash.long + Delete source files? + Drop photos, folders or a card herelong + The file changed while it was read.long + The file is no longer there.long + The file could not be read.long + The server refused the file: {0}long + The upload failed; the log has the details.long + Not connected + {0} free of {1} + Limit + MB/sinvariant + Delete after upload + Minimise to tray + Start with Windows + {0:N0} failed + {0:N0} retry + {0:N0} retries + {0:N0} of {1:N0} sent + {0:N0} verified by the server + Done + Nothing queued + {0:N0} file + {0:N0} files + Queue + {0} left + Paused + Waiting for server + Bandwidth + Files + Server + Sign out + Startup + Settings + User + Failed + Hashing + Queued + On server + Uploading + Verified + Connected + Offline + Signed out + Signing in + Target + New + Sequence + Group into sessions + Title + {0:N0} file added + {0:N0} files added + The server certificate changed.long + Choose a sequence first. + No new photos were found there.long + The server ended the session.long + {0:N0} file verified by the serverlong + {0:N0} files verified by the serverlong + Upload complete + Exit + Show + Trust + Cancel + Compare this fingerprint with the one shown on the server.long + Trust this server? + {0}/s + {0} · every {1} + Every {0} + Watch folders + Remove + diff --git a/i18n/it/About.it.resx b/i18n/it/About.it.resx new file mode 100644 index 00000000..2370ca1e --- /dev/null +++ b/i18n/it/About.it.resx @@ -0,0 +1,28 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Build + Dati + Pacchetto diagnostico + Licenza + Leggi la licenza + Traduzione automatica + Cartella dati + Versioni + Suggerisci una correzione + Runtime + Sistema + Codice di terzi + Nessuno + Traduzione + Titano {0} disponibile + Cerca aggiornamenti + Verifica in corso… + Aggiornato + Scarica + Verifica non riuscita + Aggiornamenti + diff --git a/i18n/it/Admin.it.resx b/i18n/it/Admin.it.resx new file mode 100644 index 00000000..e1bdb0f1 --- /dev/null +++ b/i18n/it/Admin.it.resx @@ -0,0 +1,323 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Versione API + Database + TLS SHA-256 + Nome server + Titano Server + In esecuzione da + Versione + {0} ha modificato l'organizzazione dell'archivio + {0} ha avviato {1} + {0} ha effettuato l'accesso · {1} + accesso fallito come {0} + {0} ha cambiato la propria password + {0} ha reimpostato la password di {1} + {0} ha creato {1} + {0} ha eliminato {1} + {0} ha modificato una sequenza · {1} + {0} ha modificato le impostazioni del server + {0} ha creato l'utente {1} + {0} ha eliminato l'utente {1} + {0} ha modificato un utente · {1} + Fotocamere + Formati + Modello file + Nome dei nuovi originali, es. {date}_{time}_{n:0000} + Modello cartelle + Cartella delle nuove sequenze, es. {year}/{date} {camera}; le cartelle esistenti non vengono mai rinominate + liberi + Stato + Organizzazione + Manutenzione + Pulisci cache obsolete e voci del database + Nome + Nome dell'archivio mostrato ai client + Originali + Proxy + Lato lungo dei proxy JPEG creati per modifica e visione + {0} px + Dimensione piena + Disattivati + Job in coda. + Ricostruisci + Ricostruisci l'indice dai file sidecar su disco; i file non vengono toccati + Scansiona + Cerca sequenze nuove e modificate sul disco + Sequenze + non verificate + Verifica + Rileggi ogni originale e confronta il suo SHA-256 + Annulla + Scarta le modifiche + Chiudi + Chiudi questo pannello + Mantieni + Lascia tutto com'è + Carica altri + Mostra la pagina successiva + Aggiorna + Salva + Salva le modifiche sul server + Salvato. + Attività recenti + Tutti i log + Apri il registro di controllo + Archivio + Spazio per anno + rilevamento spento + rilevamento attivo + {0} liberi + {0} in coda · {1} completati oggi · {2} falliti + Job + attivo da {0} · {1} · TLS {2} · {3} + Nessuna attività + Ancora niente qui + {0} sequenze senza proxy + Nodi di rendering + di {0} + online + originali {0} + {0} foto · {1} fotocamere + Coda e cronologia + Apri la pagina Job + in corso + sequenze + Spazio + foto al giorno · {0} totali · picco {1} + Caricamenti · ultimi 30 giorni + {0} worker + Il server non ha risposto; riprova. + Adozione + Analisi completa + Duplicati + Importazione + Analisi rapida + Manutenzione + Spostamento + Orfani + Proxy + Ricostruzione + Rendering + Scansione + Miniature + Caricamento + Verifica + occupato + annullato + completato + fallito + inattivo + offline + in pausa + in coda + in corso + Annulla + Annulla questo job + Creato + Nessun job + Encoder + Tutti + Annullati + Completati + Falliti + In pausa + In coda + In corso + Mostra solo i job in questo stato + Dimentica + Rimuovi questo nodo; i suoi job in corso tornano in coda + Dimenticare {0}? + Ultimo segnale + Tipo + Mostra o nascondi il log del job + {0} in corso · {1} nodi online + Nessun nodo di rendering + Nodo + Nodo + Nodi di rendering + Proprietario + Pausa + Fermati al prossimo punto di controllo e mantieni l'avanzamento + Background + Normale + Ordine in coda: i job utente partono prima di quelli normali e in background + Utente + Avanzamento + Rimuovi + Rimuovi dalla coda + Riprendi + Rimetti il job in coda dal suo punto di controllo + Riprova + Rimetti in coda il job dall'ultimo punto di controllo + server + Stato + Oggetto + Lingua di questo pannello + Nome utente o password errati. + Solo gli amministratori possono usare questo pannello. + Password + La tua password; la verifica solo il server + Accedi + Accedi per amministrare questo server + Utente + Il tuo nome utente su questo server + Organizzazione archivio + Job avviato + Accesso + Accesso fallito + Password cambiata + Password reimpostata + Sequenza creata + Sequenza eliminata + Sequenza modificata + Impostazioni server + Utente creato + Utente eliminato + Utente modificato + Dettagli + Scarica + Salva questo file di log + Ancora nessuna registrazione + File di log + Da + {0} righe + Quante delle ultime righe mostrare + Rileggi il log + Controllo + Modifiche a utenti, sequenze, archivio e impostazioni + Log del server + Le ultime righe del log del server e i file di log + Accessi + Chi ha effettuato l'accesso, da dove e quando + Cosa + Quando + Chi + Informazioni + Versione e impronta del certificato + Archivio + Percorso archivio, modelli, scansione e verifica + Panoramica + Spazio, attività e nodi di rendering in sintesi + Attività + Coda, cronologia e nodi di rendering + Log + Ultime righe di log e download + Impostazioni + Nome server, porte, TLS, limiti e lingua + Utenti + Account, ruoli e quote + Password attuale + La password con cui hai effettuato l'accesso + Le due password non coincidono. + Nuova password + Almeno 10 caratteri; le altre sessioni di questo account terminano + Ripeti + Digita di nuovo la nuova password + Cambia password + Sostituisci la password e continua nel pannello + Scegli una nuova password + Amministratore + Editor + Caricamento + Lettore + Dimensione blocco (MiB) + Dimensione di ogni blocco di caricamento; blocchi piccoli riprendono prima su linee lente + Rilevamento LAN + Annuncia questo server nella rete locale così che i client lo trovino + Impronta + SHA-256 del certificato; i client chiedono all'utente di confrontarlo una volta + Porta HTTP + Porta del pannello e delle API in HTTP + Porta HTTPS + Porta delle API in TLS per i client Titano + Cronologia job (giorni) + Giorni di conservazione dei job conclusi + Lingua + Lingua dei messaggi del server se il client non ne chiede una + Limiti e conservazione + Impostato dalla variabile d'ambiente {0} + File massimo (MB) + Caricamento singolo più grande accettato + Rete e TLS + Riavvio richiesto + Porte, TLS, worker, dimensione blocchi o cronologia job salvati valgono dopo un riavvio + Server + Nome server + Nome mostrato ai client e nella rete locale + Autofirmato + Certificato proprio + Reverse proxy + Certificato + File del certificato PEM usato in modalità Certificato proprio + Chiave privata + File della chiave privata PEM usato in modalità Certificato proprio + Modalità TLS + Come viene fornito HTTPS + Giorni di sessione + Giorni in cui un client resta connesso senza essere usato + Abbandono dopo (h) + Ore dopo le quali i caricamenti incompleti vengono scartati + Worker + Job che questo server esegue contemporaneamente + Esci + Esci dal pannello di amministrazione + Attivo + Password copiata. + Copia la password + Crea + Crea l'account + Elimina… + Elimina l'account; le sue sequenze vengono assegnate a te + L'account e le sue sessioni vengono rimossi; le sue sequenze diventano tue. + Elimina + Eliminare {0}? + Disattiva + Disattiva: le sessioni terminano, i file restano + Disattivato + Nome visualizzato + Mostrato nel client e nelle attività + Modifica + Cambia nome, ruolo, quota o diritto di nodo di rendering + Modifica utente + Nessun utente corrisponde + Attiva + Riattiva l'account + {0} liberi sul server + Ultimo accesso + {0} account · {1} attivi + deve cambiare password + Cambio password obbligatorio + Sempre richiesto per gli account creati qui + Nuovo utente + Crea un account; l'utente deve cambiare la password al primo accesso + Password: PBKDF2-SHA512, almeno {0} caratteri · i token scadono dopo {1} giorni di inattività + Quota + Gli originali caricati da questo utente contano nella quota; 0 = illimitata + {0} di {1} + Generane un'altra + Può fare da nodo di rendering + Permette al PC di questo utente di prendere job di rendering dal server + Reimposta password + Imposta una password temporanea; l'utente deve sostituirla e le sue sessioni terminano + Ruolo + Tutto, compresi utenti e impostazioni + Importa, modifica, esegue rendering, carica e scarica + Solo caricamento; non può modificare le sequenze + Solo consultazione e download dei rendering + Cerca + Filtra per nome utente o nome visualizzato + Registro accessi + Chi ha effettuato l'accesso, da dove e quando + Stato + Password temporanea + Comunicala all'utente; dovrà sostituirla al primo accesso + Caricamenti 30 g + Utente + Nome utente + Lettere, cifre, punto e trattino; non si può cambiare in seguito + diff --git a/i18n/it/Advisor.it.resx b/i18n/it/Advisor.it.resx new file mode 100644 index 00000000..88685171 --- /dev/null +++ b/i18n/it/Advisor.it.resx @@ -0,0 +1,107 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + {0} fotogrammi sono neri (tappo sull'obiettivo o scatto mancato). + Il corpo macchina cambia {0} volte. + L'orologio della fotocamera salta {0} volte (salto maggiore {1:0} s). + Le nuvole coprono in media circa il {0:0}% del cielo. + Copre giorno e notte: {0} fotogrammi di giorno, {1} al crepuscolo e {2} di notte. + {0} fotogrammi ripetono il precedente. + {0} fotogrammi hanno lo stesso orario di scatto del precedente. + {0} cambi di esposizione, di solito ogni {1:0} fotogrammi, {2:+0.0;-0.0;0} EV in totale. + La luminosità sfarfalla di {0:0.###} EV attorno al suo andamento regolare. + {0} pause nella cadenza; la più lunga dura {1:0} s. + Gli intervalli variano di {0:0.##} s attorno a {1:0.##} s. + L'obiettivo cambia {0} volte. + {0} fotogrammi non hanno tempo di scatto o diaframma nei metadati. + {0} fotogrammi hanno un orientamento diverso. + {0} fotogrammi hanno dimensioni diverse da {1}×{2}. + Solo {0} fotogrammi su {1} hanno un orario di scatto: cadenza e pause non sono misurabili. + {0} fotogrammi sono fuori ordine temporale. + L'inquadratura scorre di {0:0.##} px per fotogramma (panoramica o slider). + L'inquadratura salta in {0} fotogrammi (fotocamera spostata o urtata). + Ripreso in {0} sessioni separate. + La fotocamera vibra di {0:0.##} px RMS; compensarla costa il {1:0.#}% dell'inquadratura. + Le stelle sono visibili in {0} fotogrammi. + {0} cambi di esposizione registrati non hanno raggiunto i pixel. + Fuso orario non registrato; uno scostamento UTC di {0} min è stato stimato dalla longitudine. + {0} fotogrammi non sono decodificabili. + Il bilanciamento del colore varia del {0:0.#}% tra un fotogramma e l'altro. + {0} fotogrammi sono completamente bruciati. + Serve l'analisi approfondita dei pixel, non ancora eseguita; nulla è stato cambiato. + Tempo di scatto o diaframma mancano nei metadati, quindi non si può decidere; nulla è stato cambiato. + Troppo poche coppie di fotogrammi per misurare il movimento; nulla è stato cambiato. + La vibrazione era misurabile solo sul {0}% dei fotogrammi (poca texture); nulla è stato cambiato. + La risoluzione della sorgente è sconosciuta; nulla è stato cambiato. + Solo {0} fotogrammi su {1} hanno un orario di scatto, quindi non è misurabile; nulla è stato cambiato. + Cantiere — {0} {1} {2} fps, temporizzazione adattiva + Tramonto holy grail — {0} {1} {2} fps, transizioni {3} + Cielo notturno — {0} {1} {2} fps, deflicker {3} + Cielo notturno — {0} {1} {2} fps, deflicker {3}, stabilizza + Social verticale {0}×{1} + Standard — {0} {1} {2} fps + {0} sessioni in {1} giorni con pause: temporizzazione adattiva in un file 1080p ampiamente compatibile. + {0} cambi di esposizione su una variazione di luce di {1} EV: transizioni morbide tra giorno e notte. + Stelle o cielo scuro nel {0}% dei fotogrammi: i gradienti scuri richiedono 10 bit e luminosità stabile. + Un ritaglio 9:16 per telefoni e social. + Impostazioni generali per questa sequenza. + La sorgente {0}×{1} ritagliata a 16:9 conserva il {2}% dell'altezza. + La sorgente è già in 16:9. + Sorgente verticale: il 9:16 riempie lo schermo di un telefono. + La sorgente {0}×{1} ritagliata a 16:9 conserva il {2}% della larghezza. + Lo sfarfallio è di {0} EV, sotto gli 0,02 EV visibili: il deflicker resta spento. + La luminosità si discosta di {0} EV dal suo andamento regolare: il deflicker elimina lo sfarfallio. + {0} fotogrammi neri, bianchi, duplicati o illeggibili lampeggerebbero o farebbero scattare il video: esclusi. + Cielo notturno: HEVC a 10 bit evita le bande nei gradienti scuri. + Il preset migliore per un'uscita {0}×{1} con i codificatori disponibili. + Inquadratura verticale: 1080×1920 per telefoni. + Il piano viene scalato perché i {0} fotogrammi durino {1} s a {2} fps. + La qualità del flusso bilanciata basta per la sfocatura di movimento e le anteprime. + I fotogrammi interpolati richiedono il movimento per pixel: qualità del flusso massima. + Movimento moderato ({0} px per fotogramma): la cadenza cinema di 24 fps dà una clip di {1} s. + Movimento lento o non misurato: a 30 fps la clip dura {0} s. + Movimento rapido ({0} px per fotogramma): a 24 fps rallenta; la clip dura {1} s. + {0} fotogrammi riempiono al meglio {1} s a {2} fps. + {0} fotogrammi: a 60 fps la clip dura {1} s. + Ripresa in più sessioni: a 30 fps la clip dura {0} s. + Solo {0} fotogrammi: a 24 fps la clip dura {1} s. + L'orizzonte è al {0}% dall'alto: il ritaglio lo porta sul terzo più vicino. + Il fotogramma {0} è nitido e ben esposto, senza alte luci bruciate. + {0} cambi di esposizione nei metadati (pixel non ancora verificati): ognuno viene distribuito su una transizione morbida. + Le impostazioni di esposizione non cambiano mai: nessuna transizione necessaria. + La fotocamera ha registrato {0} cambi di esposizione ma i pixel non ne mostrano: nessuna transizione necessaria. + {0} cambi di esposizione hanno raggiunto i pixel: ognuno viene distribuito su una transizione morbida. + L'esposizione dà già un angolo di {0}°, almeno i {1}° previsti: nessuna sfocatura sintetica necessaria. + Il contenuto si sposta solo di {0} px per fotogramma: la sfocatura sarebbe invisibile, quindi resta spenta. + Angolo reale {0}° e movimento di {1} px per fotogramma: la sfocatura a {2}° aggiunge scie di {3} px che nascondono gli scatti. + Orizzonte trovato con affidabilità del {0}%: cielo e terreno vengono corretti separatamente. + Cielo separato per luminosità con affidabilità del {0}%: cielo e terreno vengono corretti separatamente. + La separazione cielo/terreno è affidabile solo al {0}%: una curva unica per tutta l'immagine è più sicura. + Il codificatore {0} gestisce al massimo {1}×{2}. + {0} fotogrammi si decodificano solo come anteprime incorporate {1}×{2}, che limitano l'uscita. + La dimensione standard più grande entro la sorgente {0}×{1}. + 180° è l'aspetto cinematografico; l'angolo d'otturatore reale è {0}° (esposizione di {1} s ogni {2} s). + Vibrazione di {0} px alla risoluzione di uscita, ma compensarla ritaglia il {1}% dell'inquadratura: controlla il taglio. + Vibrazione misurata di {0} px alla risoluzione di uscita (al massimo 0,3 px): la fotocamera era stabile. + Vibrazione misurata di {0} px alla risoluzione di uscita (oltre 0,3 px): la stabilizzazione ritaglia il {1}% dell'area. + Smussare il percorso della fotocamera su {0} fotogrammi elimina la vibrazione e conserva le panoramiche volute. + Sfarfallio forte ({0} EV): ogni fotogramma viene portato sulla curva regolare. + Sfarfallio lieve ({0} EV): i fotogrammi affidabili conservano il 20% della propria variazione. + Gli intervalli variano di {0} s attorno a {1} s: la temporizzazione adattiva segue l'orario di scatto e rende il movimento uniforme. + {0} pause nella cadenza: la temporizzazione adattiva mantiene il ritmo fedele all'orario di scatto. + Intervallo costante di {0} s (variazione {1} s): ogni foto diventa un fotogramma del video. + Ripreso in {0} sessioni con pause fino a {1} h: la temporizzazione adattiva accorcia le pause e mantiene il ritmo. + {0} brevi pause, ma il movimento non è misurato o è rapido: la temporizzazione costante le salta in modo pulito. + {0} brevi pause e movimento regolare ({1} px per fotogramma): i fotogrammi interpolati riempiono le pause. + Un solo cambio di esposizione: una transizione di {0} fotogrammi lo rende graduale. + I cambi di esposizione distano {0} fotogrammi: transizioni lunghe la metà ({1} fotogrammi) non si sovrappongono mai. + Il bilanciamento del colore è stabile ({0}% tra fotogrammi): nessuno smussamento necessario. + Il bilanciamento del colore varia del {0}% tra fotogrammi: lo smussamento lo stabilizza e mantiene la deriva lenta. + Lo sfarfallio resta correlato per {0} fotogrammi: una finestra di {1} fotogrammi ne copre quattro volte tanto. + Lo sfarfallio varia su {0} fotogrammi: la finestra è limitata a {1} fotogrammi per conservare i veri cambi di luce. + Lo sfarfallio cambia da un fotogramma all'altro senza ritmo: la finestra robusta più corta, {0} fotogrammi, lo elimina. + Lo sfarfallio si ripete ogni {0} fotogrammi: una finestra di {1} fotogrammi media quattro cicli. + diff --git a/i18n/it/Archive.it.resx b/i18n/it/Archive.it.resx new file mode 100644 index 00000000..62523790 --- /dev/null +++ b/i18n/it/Archive.it.resx @@ -0,0 +1,30 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Nessun archivio + Un altro Titano ({0}) sta scrivendo qui. Riprova tra poco. + La copia di {0} non corrisponde all'originale. + Impossibile aggiungere {0} alla sequenza. + {0} è stato scritto da un Titano più recente (formato {1}). + L'archivio {0} non è raggiungibile. + L'archivio {0} è di sola lettura. + {0} è cambiato dopo la creazione del piano. + La scheda o cartella {0} non è più disponibile. + L'archivio è cambiato dopo la creazione del piano. + Prova: nulla è stato modificato. + Non indicizzata: {0} ({1}) + Modificato: {0} + Danneggiato: {0} + Mancante: {0} + {0}: {1} create, {2} riusate, {3} illeggibili + {0} copiate, {1} saltate, {2} non riuscite + Non copiata: {0} ({1}) + {0} blocchi scaduti, {1} file temporanei, {2} pacchetti compattati, {3} segni di duplicato cambiati + {0} foto non indicizzate, {1} foto mancanti + {0} cartelle, {1} indicizzate, {2} adottate, {3} rimosse + Sequenza non trovata: {0} + {0} foto controllate, {1} integre, {2} con impronta nuova, {3} con problemi + diff --git a/i18n/it/Common.it.resx b/i18n/it/Common.it.resx new file mode 100644 index 00000000..8794e75b --- /dev/null +++ b/i18n/it/Common.it.resx @@ -0,0 +1,16 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Auto + {0} g {1} h + {0} h {1} m + {0} min + {0} s + n/d + Apri + Apri log + {0}% + diff --git a/i18n/it/Editor.it.resx b/i18n/it/Editor.it.resx new file mode 100644 index 00000000..a0b523f2 --- /dev/null +++ b/i18n/it/Editor.it.resx @@ -0,0 +1,8 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Scegli una sequenza in Libreria + diff --git a/i18n/it/Errors.it.resx b/i18n/it/Errors.it.resx new file mode 100644 index 00000000..d3b8318d --- /dev/null +++ b/i18n/it/Errors.it.resx @@ -0,0 +1,25 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Impossibile aprire l'archivio. + Inserisci un numero intero da {0} a {1}. + Inserisci una cartella. + Questo non è un percorso di cartella valido. + Questo percorso è un file, non una cartella. + L'unità di questa cartella non è disponibile. + Inserisci un percorso completo che inizi con un'unità o una condivisione di rete. + Inserisci l'indirizzo di un server, ad esempio nas.local:8443 o https://titano.example.com. + Questo file non contiene impostazioni di Titano. + Il modello è vuoto. + Segnaposto vuoto alla posizione {1}: scrivi un nome tra le parentesi graffe. + I nomi dei file non possono contenere la barra; metti le cartelle nel modello delle cartelle. + Il formato dopo i due punti non è adatto al suo segnaposto. + I nomi si ripeterebbero: aggiungi il numero del fotogramma, l'ora o il nome originale. + La parentesi graffa aperta alla posizione {1} non viene mai chiusa. + Segnaposto sconosciuto «{0}» alla posizione {1}. + La parentesi graffa chiusa alla posizione {1} non ha un'apertura; raddoppiala per una graffa letterale. + Si è verificato un problema. + diff --git a/i18n/it/Export.it.resx b/i18n/it/Export.it.resx new file mode 100644 index 00000000..513b88a6 --- /dev/null +++ b/i18n/it/Export.it.resx @@ -0,0 +1,60 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Uscita a {0} bit non disponibile con questo encoder; codifica a {1} bit. + Bit rate limitato a {1} bit/s, il massimo del livello {0}. + Nessun encoder {0} su questo PC; viene usato H.264. + Il server non può codificare {0}; lo farà un nodo di rendering o il client desktop. + Nessun encoder disponibile per {0}. + Risoluzione ridotta a {1}, il massimo di {0}. + Risoluzione ridotta a {1}, il massimo del livello {0}. + Nessun encoder hardware: {0} codifica via software, più lentamente. + {0} non codifica a 10 bit; viene usato 8 bit. + Velocità di riproduzione non valida; viene usata la frequenza di esportazione. + Nessun orario di scatto: fotogrammi distribuiti in modo uniforme. + Tutti i fotogrammi sono esclusi. + La curva del tempo tornava indietro ed è stata corretta. + 1080p 60 fps + Condivisione 1080p + 1440p H.264 + 4K 60 fps + Archivio 4K + 4K AV1 + 4K H.264 + 4K HEVC + Archivio 8K + PNG animato + Cinema 21:9 + DCI 4K + GIF animata + Fotogrammi JPEG + DNG lineare + MJPEG AVI + Fotogrammi PNG + Ritratto 4:5 + Anteprima 720p + Quadrato 1:1 + TIFF 16 bit + Verticale 9:16 + Il formato {1} del preset sostituisce le proporzioni {0}. + Proporzioni «{0}» non valide; vengono usate quelle della sorgente. + La sfocatura di movimento è disattivata mentre i fotogrammi sono sovrapposti. + Il ritaglio è fuori dall'immagine e viene ignorato. + Andamento «{0}» non valido; viene usato quello lineare. + Il fotogramma chiave {0} non è valido ed è stato saltato. + Compressione delle alte luci {0} fuori intervallo, ignorata. + Tutti i fotogrammi sono esclusi: non c'è nulla da renderizzare. + Nessuna maschera cielo/terra; il deflicker usa l'intera immagine. + La maschera cielo/terra è incerta (affidabilità {0}); il deflicker usa l'intera immagine. + Vibrazioni forti: la stabilizzazione conserverebbe solo {0} dell'immagine, i bordi possono vedersi. + Stabilizzazione non disponibile: troppo pochi dettagli da tracciare. + Il contenitore non è adatto al codec; viene usato quello del codec. + Codec sconosciuto; viene usato quello del preset. + Frequenza sconosciuta; viene usata quella del preset. + Preset sconosciuto; viene usato quello predefinito. + Profilo sconosciuto; viene usato quello predefinito del codec. + Controllo del bit rate sconosciuto; viene usato quello del preset. + diff --git a/i18n/it/Import.it.resx b/i18n/it/Import.it.resx new file mode 100644 index 00000000..1d75e138 --- /dev/null +++ b/i18n/it/Import.it.resx @@ -0,0 +1,8 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Inserisci una scheda o una cartella + diff --git a/i18n/it/Jobs.it.resx b/i18n/it/Jobs.it.resx new file mode 100644 index 00000000..29507c5b --- /dev/null +++ b/i18n/it/Jobs.it.resx @@ -0,0 +1,66 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Annulla + Cartella + Anticipa + Apri + Pausa + Rimuovi + Riprendi + Riprova + Mostra + {0} rimanenti + Rimuovi concluse + Tipo + Rimanente + Avanzamento + Velocità + Stato + Oggetto + Dove + {0} / {1} + Nessuna attività + Tutte · {0} + Concluse · {0} + Non riuscite · {0} + In coda · {0} + In corso · {0} + Cronologia di {0} giorno + Cronologia di {0} giorni + Adozione cartella + Analisi approfondita + Duplicati + Importazione + Analisi rapida + Manutenzione + Spostamento archivio + File orfani + Proxy + Ricostruzione indice + Rendering + Scansione + Miniature + Caricamento + Verifica + dopo {0} + prossima + Ancora nessuna riga di log + Sospendi tutte + Impostazioni di rendering + Cerca oggetto o tipo + {0} fps + {0}/s + annullata + conclusa + non riuscita + in pausa + in coda + in corso + {0} · {1} + questo PC + Processi {0} / {1} + diff --git a/i18n/it/Library.it.resx b/i18n/it/Library.it.resx new file mode 100644 index 00000000..cbf7ca1a --- /dev/null +++ b/i18n/it/Library.it.resx @@ -0,0 +1,70 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Analizza + Deseleziona tutto + Esporta elenco + Cartella + Apri + Proxy + Verifica + Adotta una cartella + Azzera i filtri + Fotocamera + Data + Cartella + Fotogrammi + Intervallo + Sequenza + Dimensione + Durata + Stato + Tag + Nessuna sequenza + Adotta una cartella + Connetti a un server + Importa una scheda + Apri un archivio + Elenco esportato + Mostra + Esporta l'elenco in + Tutte le fotocamere + Qualsiasi stato + Tutti i tag + Tutti gli anni + Fotocamera + Stato + Analizzate + Senza proxy + Non analizzate + Non verificate + Con proxy + Verificate + Con avvisi + Tag + Anno + {0} s + Nessuna sequenza corrisponde + {0} in coda · {1} + Ripeti scansione + Cerca titolo, fotocamera, tag + {0:N0} selezionata + {0:N0} selezionate + Ordina + Più fotogrammi + Più recenti + Meno recenti + Più grandi + Titolo + Analizzata + In analisi + Proxy + Remota + Sincronizzata + Vista + Griglia + Elenco + diff --git a/i18n/it/Server.it.resx b/i18n/it/Server.it.resx new file mode 100644 index 00000000..fb5bdb68 --- /dev/null +++ b/i18n/it/Server.it.resx @@ -0,0 +1,100 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Certificato + Dimentica + Mantieni + Titano considera attendibile questo certificato per questo server. Se lo dimentichi la connessione si chiude e la prossima volta te lo chiederà di nuovo. + Certificato del server + TLS {0} attendibile dal {1} + Connetti + Disconnetti + Non connesso a un server + Troppi accessi falliti; l'account è bloccato per un po'. + Nome utente o password errati. + La richiesta non è valida. + Il certificato del server è cambiato; confermalo e accedi di nuovo. + Questo caricamento non ha quel blocco. + Il blocco ha la dimensione sbagliata. + Il file non è stato salvato nell'archivio; riprova. + Manca il token di sicurezza; ricarica la pagina. + La connessione non è riuscita; i dettagli sono nel log. + Il tuo account non può farlo. + Il file è arrivato danneggiato; caricalo di nuovo. + Apri il pannello di amministrazione in HTTPS per accedere. + Mancano ancora alcuni blocchi. + Il server ha esaurito lo spazio su disco. + Errore imprevisto del server; riprova. + Questo non è un indirizzo di server valido. + Nome utente o password errati. + Il cursore di paginazione non è valido; ricomincia dalla prima pagina. + Il nome del file non è valido. + Un valore di filtro non è valido. + Lo SHA-256 deve avere 64 caratteri esadecimali. + Questo tipo di job non si può avviare qui. + I parametri del job non sono validi. + La priorità deve essere background, normal o user. + Il ruolo deve essere admin, editor, uploader o viewer. + L'impostazione {0} non è valida. + Le impostazioni devono essere JSON valido. + Il job non può farlo nello stato attuale. + Il modello dei nomi non è valido. + Usa lettere, cifre, punto, trattino o trattino basso. + Questo job non è più assegnato a questo nodo. + Questo server non può eseguire quel tipo di job. + L'ultimo amministratore non può essere rimosso o disattivato. + Metodo non consentito qui. + Non trovato. + Questo indirizzo non è un Titano Server. + Cambia prima la password. + Questo caricamento supererebbe la tua quota. + Troppi tentativi; attendi un minuto e riprova. + Scegli una password diversa da quella attuale. + Non puoi farlo sul tuo account. + La sessione è scaduta; accedi di nuovo. + È impostato da una variabile d'ambiente; modificala lì. + La sequenza è cambiata sul server; ricaricala e riapplica la modifica. + La richiesta supera la dimensione accettata dal server. + Troppi caricamenti insieme; riprova tra poco. + Accedi per continuare. + Il server non risponde; controlla l'indirizzo e la rete. + Invia il corpo come JSON. + Il certificato non è stato accettato, quindi non è stato inviato nulla. + Questo caricamento ora non accetta la richiesta. + Questo nome utente è già in uso. + Usa almeno {0} caratteri. + Connettiti con un WebSocket. + La password attuale è errata. + Questo caricamento appartiene a un job di rendering. + Server trovati + Account + Server + Stato + {0} ms + Annulla + Password + Accedi + Accedi + Utente + {0} di {1} + {0} usati + Offri questo PC per il rendering + Amministratore + Editor + Caricatore + Visualizzatore + Server Titano per archivio time-lapse, caricamenti, job e rendering. + Esci + Connesso + Connessione… + Disconnesso + Non connesso + Considera attendibile + Annulla + {0} usa un certificato che Titano non conosce ancora. Confronta l'impronta con quella del pannello di amministrazione del server prima di considerarlo attendibile. + Ti fidi di questo server? + v{0} + diff --git a/i18n/it/Settings.it.resx b/i18n/it/Settings.it.resx new file mode 100644 index 00000000..198c180c --- /dev/null +++ b/i18n/it/Settings.it.resx @@ -0,0 +1,110 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Database + Copia dell'indice salvata + Salva una copia + Cartella dati + Diagnostica + Pacchetto diagnostico salvato + Salva il pacchetto in + Esporta pacchetto + Log + Modalità portatile + Disattivata + Attiva + Nomi dei file + Cartelle + {0} liberi + Dimensione piena + Scegli la cartella dell'archivio + Anteprima + Dimensione proxy + Cartella archivio + Torna ad Auto + Scegli cartella + Esporta… + Impostazioni esportate + Esporta le impostazioni in + Controlla all'avvio + Lingua + Tema + Scuro + Chiaro + Sistema + Aggiornamenti + Statistiche d'uso + Invia conteggi anonimi + Importa… + Impostazioni importate + Impostazioni di Titano + Importa impostazioni + Avanzate + Analisi + Archivio + Formati + Generale + Importazione + Licenza + Rendering + Server + Spazio su disco + Aggiornamenti + Auto · {0} + Priorità bassa in modifica + Codec + Encoder + Massimo + Autotest + 10 bit + di {0} core logici + {0} (integrato) + {0} (hardware) + {0} (software) + {0} encoder + {0} encoder + Encoder su questo PC + non riuscito + {0} GB + Codifica hardware + di {0} GB installati + Memoria disponibile + nessun limite + Parallelismo + {0} fps · ok + Preferisci hardware + Hardware solo per anteprime + Profilo di qualità + Bilanciato + Massima qualità + Veloce + Rileva di nuovo + Esegui autotest + Solo software + 10 bit + in prova… + Ripristina sezione + Cerca impostazioni + Certificati attendibili + Server predefinito + Nessuno + Nodo di rendering + Svuota + I fotogrammi temporanei e le miniature vengono eliminati e ricreati quando servono. Originali, proxy ed esportazioni restano intatti. + Svuotare la cache? + {0} liberati + Cartella cache + Mantieni + Limite della cache + GB + Questa cartella non è stata creata da Titano, quindi non è stato eliminato nulla. + Scegli la cartella della cache + Miniature in memoria + miniature + {0} usati · {1} liberi + {0} usati + Ultima versione + diff --git a/i18n/it/Setup.it.resx b/i18n/it/Setup.it.resx new file mode 100644 index 00000000..b2588356 --- /dev/null +++ b/i18n/it/Setup.it.resx @@ -0,0 +1,49 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Annulla + Chiudi + Chiudi programmi + Installa + Avvia + Riprova + Disinstalla + Aggiorna + Server per Windows + Titano + Uploader + {0} è installato. + {0} è stato rimosso. + Windows ha negato l'accesso alla cartella.long + La riga di comando non è valida.long + Lo spazio libero su disco non è sufficiente.long + L'autorizzazione di amministratore è stata negata.long + L'installazione non è stata completata.long + {0} non è installato.long + Il programma di installazione è danneggiato; scaricalo di nuovo.long + {0} non si è chiuso.long + Alcuni file non sono stati rimossi.long + Componenti + Cartella + Lingua + Opzioni + Installa per + Sfoglia + Versione {0} · installata {1} + Versione {0} + Collegamento sul desktop + Avvia al termine + Menu Start + Installazione di {0} + Rimozione di {0} + Chiudi {0} per continuare. + Tutti gli utenti + Solo per me + {0} necessari + Rimuovi i miei dati + Installazione di {0} + Rimozione di {0} + diff --git a/i18n/it/Shell.it.resx b/i18n/it/Shell.it.resx new file mode 100644 index 00000000..6da87848 --- /dev/null +++ b/i18n/it/Shell.it.resx @@ -0,0 +1,39 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Pronto + Pronto · {0} attività in coda + Informazioni + Archivio + Importa + Attività + Libreria + Sequenza + Server + Impostazioni + Connesso a «{0}» + {0:N0} attività + {0:N0} attività + Nessun archivio + Non connesso + {0:N0} foto + {0:N0} foto + {0:N0} sequenza + {0:N0} sequenze + Adotta una cartella esistente + Cambia… + Scegli… + Aiuta a migliorare Titano con conteggi d'uso anonimi + Continua + Trovato + Crea un archivio locale + {0} · {1} liberi + Scegli dove tenere l'archivio + Dove vuoi conservare i tuoi time-lapse? + Connettiti a un server + {0} in questa rete · {1} + Benvenuto in Titano + diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx new file mode 100644 index 00000000..c81ad08f --- /dev/null +++ b/i18n/it/Tooltips.it.resx @@ -0,0 +1,254 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Chiede alla pagina pubblica delle versioni se ne esiste una più recente · pochi secondi + Comprime i log e un rapporto sull'ambiente in una cartella a tua scelta; impostazioni e password non sono incluse + Apre la pagina della versione nel browser + Apre la licenza nel browser + Apri la cartella con database, impostazioni e log + Apri la pagina pubblica delle versioni nel browser + Tutte le lingue tranne l'inglese sono tradotte automaticamente; proponi una formulazione migliore nel tracker pubblico + Titano non usa codice di terze parti: tutto ciò che va oltre .NET e Windows è scritto internamente + Chiudi + Apri la cartella dei file di log + Torna al valore consigliato + Ferma questa attività; Riprova la continua più tardi dall'ultimo punto di ripresa + Nasconde le attività concluse dall'elenco; restano nella cronologia + Tutte le attività + Attività concluse + Fermate per un errore o annullate + In attesa di un processo libero + In esecuzione o in pausa + Mostra la cartella in Esplora file + Nasconde il log + Le attività concluse più vecchie vengono rimosse all'avvio di Titano + Alza la priorità: verrà eseguita prima delle attività a priorità più bassa + Apre l'oggetto di questa attività + Mette in pausa al prossimo punto di ripresa; Riprendi continua da lì + Mette in pausa tutte le attività in corso; la coda mantiene il suo ordine + Trattiene l'attività in coda finché non la riprendi + Rimuove dalla coda; l'attività viene annullata + Parallelismo, preferenza hardware, memoria disponibile + Rimette l'attività in coda; riparte dal suo punto di ripresa + Esegue di nuovo dall'ultimo punto di ripresa + Filtra per oggetto o tipo mentre scrivi + Apre l'oggetto dell'attività per vedere il problema + Mostra le ultime righe del log + Annullata; Riprova continua dall'ultimo punto di ripresa + Conclusa; dopo il punto c'è la durata + Fermata per un errore; Riprova continua dall'ultimo punto di ripresa + In pausa; Riprendi continua dal punto di ripresa + In attesa di un processo libero su questo PC + In esecuzione + Attività in esecuzione su questo PC rispetto ai processi disponibili + Indicizza le foto che hai già, dove si trovano; scegli la loro cartella principale + Analisi approfondita di ogni fotogramma · viene eseguita come attività in background + Analisi approfondita delle sequenze selezionate · un'unica attività + Mostra una sola fotocamera + Clic seleziona · Ctrl+clic aggiunge · doppio clic apre · scorri sull'immagine per sfogliare + Mostra di nuovo tutte le sequenze + Deseleziona tutte le sequenze + Lavora con l'archivio di un Titano Server + Salva le righe selezionate come CSV in una cartella a tua scelta + Mostra la cartella della sequenza in Esplora file + Schede con miniature + Copia e verifica le foto da una scheda di memoria + Tabella con colonne ordinabili + Apre nell'editor della sequenza · Invio + Usa una cartella archivio esistente su questo PC o in rete + Crea proxy JPEG per una modifica veloce · viene eseguita come attività + Crea i proxy delle sequenze selezionate · un'unica attività + Ripete la scansione dell'archivio per trovare modifiche · viene eseguita come attività + Clic seleziona · doppio clic apre + Cerca titoli, marche e modelli di fotocamera e tag mentre scrivi + Aggiunge alla selezione o la toglie + Mostra il file in Esplora file + Ordine delle sequenze + Ordina per primo scatto; fai clic di nuovo per invertire + Ordina per numero di fotogrammi, dal più alto + Ordina per spazio su disco, dalla più grande + Ordina per titolo, dalla A alla Z + Filtra per analisi, proxy, verifica o avvisi + Analizzata: esposizione, flicker e movimento sono misurati + Un'attività di analisi è in corso su questa sequenza + Alcuni fotogrammi mancano o sono illeggibili; apri la sequenza per i dettagli + Ancora nessun proxy; la modifica legge gli originali + Non ancora analizzata + Proxy JPEG pronti per una modifica veloce + Si trova sul server; questo PC ne ha al massimo i proxy + Esportata una volta + Esportata {0:N0} volte + Uguale su questo PC e sul server + {0:N0} avviso; apri la sequenza per i dettagli + {0:N0} avvisi; apri la sequenza per i dettagli + Mostra un solo tag + Rilegge ogni file e ne confronta l'hash con l'indice · viene eseguita come attività + Verifica gli hash delle sequenze selezionate · un'unica attività + Mostra un solo anno del primo scatto + Versione, diagnostica e collegamenti + Scansiona, verifica e gestisci l'archivio · Ctrl+4 + Importa foto da una scheda o una cartella · Ctrl+2 + Coda e cronologia delle operazioni lunghe · Ctrl+5 + Sfoglia tutte le sequenze dell'archivio · Ctrl+1 + Modifica e renderizza la sequenza aperta · Ctrl+3 + Connessione, sincronizzazione e nodo di rendering · Ctrl+6 + Preferenze di questo PC · Ctrl+, + Indirizzo del Titano Server; si presume https · Invio per connettersi + Mostra l'impronta completa o revoca la fiducia + Impronta accettata al primo utilizzo; se cambia, la connessione si blocca e te lo chiede di nuovo + Identifica il server, conferma un certificato nuovo e poi accedi · Invio + Chiude la sessione e lavora solo con l'archivio locale; l'accesso resta salvato + Non connetterti; a questo server non viene inviato nulla + Impronta SHA-256 del certificato del server + Dimentica questo certificato; alla prossima connessione verrà chiesto di nuovo + Server trovati in questa rete e usati in precedenza + Continua a considerare attendibile questo certificato + Chiude senza accedere · Esc + Inviata solo a questo server; Titano conserva un token di sessione, mai la password + Il tuo nome utente sul server + Spazio che usi sul server rispetto alla tua quota + Permette al server di inviare rendering a questo PC quando è inattivo; usa gli encoder della tua GPU + Gli amministratori gestiscono utenti, archivio e server + Gli editor importano, modificano ed esportano; solo gli amministratori gestiscono gli utenti + I caricatori inviano foto; per modificare serve un editor + I visualizzatori sfogliano e scaricano + Accedi; il token viene salvato cifrato per questo utente di Windows · Invio + Esci; il token viene rimosso da questo PC + Connessione al server + Considera attendibile questo certificato per questo server e prosegui con l'accesso + Usa questo indirizzo + Scheda grafica ed encoder Media Foundation trovati + Spazio libero sull'unità dell'archivio + Radice dell'archivio locale; i file non vengono spostati · Invio applica, Esc annulla + Abbassa la priorità delle attività mentre Titano è in primo piano, così l'interfaccia resta fluida + Copia l'indice nella cartella dei backup; vengono conservate le tre copie più recenti · pochi secondi + Scegli la cartella dell'archivio + Scegli la cartella della cache; un SSD veloce aiuta + Dove vanno i fotogrammi temporanei e le miniature; un SSD veloce aiuta · Invio applica, Esc annulla + Dimensione massima della cache su disco in GB · Invio applica, Esc annulla + Spazio usato dalla cache e spazio libero sulla sua unità + Cerca una nuova versione all'avvio di Titano · nessun dato viene inviato + Elimina adesso il contenuto della cache + Elimina fotogrammi temporanei e miniature in cache; prima chiede conferma + Database, impostazioni, log e cache di questo PC + Server a cui Titano si connette all'avvio; cambiarlo chiude l'accesso · Invio applica, Esc annulla + Comprime i log e un rapporto sull'ambiente in una cartella a tua scelta + Salva tutte le impostazioni in JSON, senza il token di sessione + Nome del file di ogni fotogramma, ad esempio {date}_{time}_{n:0000}; l'estensione viene aggiunta · Invio applica, Esc annulla + Cartelle dell'archivio, ad esempio {year}/{date} {camera}; la barra crea una sottocartella · Invio applica, Esc annulla + Carica le impostazioni da un file JSON; la sessione e la disposizione della finestra restano invariate + Lascia la cache com'è + Lingua dell'interfaccia · si applica subito + File di log giornalieri, conservati per 14 giorni + I fotogrammi restano in memoria fino a questo limite, poi passano nella cartella della cache + Auto: un quarto della memoria installata + Torna ad Auto: un quarto della memoria installata + Apri la cartella dati in Esplora file + Modalità portatile, log, diagnostica, backup del database + Cartella dell'archivio, modelli dei nomi, dimensione dei proxy + Lingua, tema, statistiche d'uso + Profilo di qualità, memoria, parallelismo, encoder + Server predefinito, nodo di rendering, certificati attendibili + Cartella della cache, miniature in memoria, limite della cache + Controllo degli aggiornamenti all'avvio + Thread di lavoro per decodifica ed elaborazione · Invio applica, Esc annulla + Auto: core meno quattro, così l'interfaccia resta reattiva + Torna ad Auto: core meno quattro + Attiva quando portable.txt si trova accanto a Titano.exe: tutti i dati restano nella sua cartella data + Usa un encoder hardware quando supporta il preset; altrimenti il software + I primi tre nomi di un'importazione di esempio con questi modelli + Hardware per le anteprime, software per i preset d'archivio + Lato lungo dei proxy JPEG creati per le nuove sequenze + Bilanciato va bene quasi sempre; Massima qualità raddoppia il campionamento e non usa la cache su disco; Veloce è per le anteprime + Elenca di nuovo gli encoder dopo l'installazione di un driver o di un codec + Riporta ogni controllo di questa sezione al valore predefinito + Trova un'impostazione per nome + Codifica una breve clip sintetica con ogni encoder e ne riporta esito e velocità · circa un minuto + Velocità sulla clip di prova sintetica 1280×720 + Sempre l'encoder software H.264 di Microsoft; più lento, identico ovunque + Interfaccia scura (predefinita) + Interfaccia chiara + Segui la modalità app di Windows + Miniature decodificate tenute in memoria; più sono, più lo scorrimento è veloce e più RAM serve · Invio applica + Invia ogni giorno un conteggio anonimo di versioni e lingue in uso; nient'altro, disattivato per impostazione predefinita + Installa in Programmi per tutti gli account · chiede l'autorizzazione di amministratore + Torna alle opzioni senza modificare nulla + Scegli la cartella di installazione + Chiudi l'installazione + Chiedi ai programmi aperti di chiudersi · ognuno gestisce il lavoro non salvato + Installa questo programma + Esegue Titano Server su questo PC per altri dispositivi e nodi di rendering + L'app desktop per importare, archiviare e renderizzare time-lapse + Invia le foto dalle cartelle monitorate a un Titano Server + Aggiungi collegamenti al desktop + Dove vengono installati i programmi · i tuoi dati restano nella loro cartella + Inserisci il percorso completo di una cartella che non sia la radice di un'unità o una cartella di sistema + Copia i programmi selezionati e registrali in Windows + Cartella dei programmi installati + Installa nella tua cartella utente · non servono diritti di amministratore + Lingua di questa installazione + Apri il programma al termine dell'installazione + Apri il programma installato + Già installato qui · disinstallalo prima per cambiare cartella o ambito + Elimina anche database, impostazioni e log in %LOCALAPPDATA%\Titano · le foto negli archivi non vengono toccate + Esegui di nuovo lo stesso passaggio + Aggiungi i programmi al menu Start + Rimuovi programmi, collegamenti e tipi di file · i dati restano salvo diversa scelta + Sostituisci la versione installata · i tuoi dati restano + Riduci la navigazione alle icone + Mostra i nomi della navigazione + Mette in pausa l'attività mostrata; quando la riprendi continua dal punto di ripresa + Ferma l'attività in corso · potrai riprenderla + Aggiungi una cartella da controllare + Scegli file, una cartella o una scheda + Scegli una o più foto + Scegli una cartella o una scheda; vengono aggiunte tutte le foto contenute + Non connetterti a questo server + Scegli la sequenza + Chiudi le impostazioni + Elimina ogni file originale dopo la verifica del server + Elimina il file locale solo dopo che il server ne ha confermato l'hash; chiede conferma prima di attivarsi + Titano Server trovato in questa rete · fai clic per usarlo + Impronta SHA-256 del certificato del server + Lascia i file originali dove sono + Limite di banda in MB/s; 0 significa nessun limite + Chiudendo la finestra l'uploader resta attivo nell'area di notifica + Titolo della nuova sequenza; lascialo vuoto per farlo scegliere al server + La tua password; viene conservato solo un token di accesso, cifrato per il tuo account Windows + Metti in pausa; la coda sopravvive a un riavvio + Spazio rimasto nella tua quota sul server + Smetti di controllare questa cartella; i file già inviati restano sul server + Riprendi l'invio + Riprova + Riprova subito questo file + Indirizzo del Titano Server, ad esempio https://nas.local:8443 + Server, accesso, banda, avvio, area di notifica + Controlla il certificato del server e accedi + Esci e dimentica il token salvato + Avvia quando accedi a Windows + Ferma e svuota la coda; i file inviati restano sul server + Crea una nuova sequenza con il titolo che scrivi + Aggiungi tutti i file a una sequenza esistente + Il server divide i file in sessioni e crea le sequenze + Ricorda questo certificato; accettalo solo se l'impronta coincide con quella sul server + Il tuo nome utente sul Titano Server + Controllata ogni {0}; un file viene inviato quando smette di crescere · fai clic per modificare o rimuovere + La cartella non è raggiungibile; viene ricontrollata ogni {0} · fai clic per modificare o rimuovere + Condivisione di rete; controllata ogni {0} perché le notifiche di modifica non sono affidabili su SMB · fai clic per modificare o rimuovere + Controlla la cartella con questo intervallo + Indicizza le foto che hai già, senza spostarle + Scegli un'altra cartella per l'archivio + Scegli la cartella da adottare + Inizia con la scelta evidenziata · Invio + Annunciato in questa rete poco fa + Lingua dell'interfaccia; puoi cambiarla più tardi nelle Impostazioni + Crea qui la struttura delle cartelle e l'indice; puoi spostarlo in seguito + Accedi a un Titano Server nella tua rete o su internet + Chiudi + Ingrandisci + Riduci a icona + Ripristina + diff --git a/i18n/it/Uploader.it.resx b/i18n/it/Uploader.it.resx new file mode 100644 index 00000000..e4eb6bb7 --- /dev/null +++ b/i18n/it/Uploader.it.resx @@ -0,0 +1,104 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Aggiungi cartella + Chiudi + Pausa + Riprendi + Riprova + Ferma + Tutti i file + Sfoglia… + File… + Aggiungi foto + Cartella o scheda… + Cartella o scheda + Foto + Controlla una cartella + Nome utente o password errati. + Il server ha segnalato un errore. + Inserisci un indirizzo come https://nas.local:8443. + Questo indirizzo non è un Titano Server. + Il server non ha risposto. + Il certificato del server non è stato accettato. + Trovati + Password + Server + Accedi + Connetti al server + Utente + Elimina dopo l'invio + Mantieni i file + Ogni file viene eliminato da questo PC solo dopo che il server ne ha verificato l'hash. + Eliminare i file originali? + Trascina qui foto, cartelle o una scheda + Il file è cambiato durante la lettura. + Il file non c'è più. + Impossibile leggere il file. + Il server ha rifiutato il file: {0} + Invio non riuscito; i dettagli sono nel log. + Non connesso + {0} liberi su {1} + Limite + Elimina dopo l'invio + Riduci nell'area notifiche + Avvia con Windows + {0:N0} non riusciti + {0:N0} nuovo tentativo + {0:N0} nuovi tentativi + {0:N0} di {1:N0} inviati + {0:N0} verificati dal server + Completato + Coda vuota + {0:N0} file + {0:N0} file + Coda + mancano {0} + In pausa + In attesa del server + Banda + File + Server + Esci + Avvio + Impostazioni + Utente + Non riuscito + Calcolo hash + In coda + Già sul server + Invio + Verificato + Connesso + Non in linea + Disconnesso + Accesso in corso + Destinazione + Nuova + Sequenza + Raggruppa in sessioni + Titolo + {0:N0} file aggiunto + {0:N0} file aggiunti + Il certificato del server è cambiato. + Scegli prima una sequenza. + Nessuna nuova foto trovata. + Il server ha chiuso la sessione. + {0:N0} file verificato dal server + {0:N0} file verificati dal server + Invio completato + Esci + Mostra + Accetta + Annulla + Confronta questa impronta con quella mostrata sul server. + Accettare questo server? + {0}/s + {0} · ogni {1} + Ogni {0} + Cartelle controllate + Rimuovi + diff --git a/src/Titano.App/About/UpdateCheck.cs b/src/Titano.App/About/UpdateCheck.cs new file mode 100644 index 00000000..8434cb88 --- /dev/null +++ b/src/Titano.App/About/UpdateCheck.cs @@ -0,0 +1,76 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.Json; + +namespace Titano.App.About; + +/// The newest public release (BRIEF §18). +public sealed record ReleaseInfo(Version Version, string Tag, string PageUrl); + +/// +/// Update check against the GitHub Releases API of the public releases repository (BRIEF §18, §19.4): reads the +/// latest release, ignores drafts and pre-releases, and compares its tag with the running version. +/// +public static class UpdateCheck +{ + /// "v1.2.3", "1.2.3", "v1.2.3-beta.1" → 1.2.3; null for anything else. + public static Version? ParseVersion(string? tag) + { + if (string.IsNullOrWhiteSpace(tag)) return null; + var text = tag.Trim(); + if (text.StartsWith('v') || text.StartsWith('V')) text = text[1..]; + var end = text.IndexOfAny(['-', '+', ' ']); + if (end >= 0) text = text[..end]; + if (!Version.TryParse(text, out var version)) return null; + // Normalise to three parts so 1.2 equals 1.2.0. + return new Version(version.Major, version.Minor, Math.Max(0, version.Build)); + } + + /// The release described by a releases/latest response; null for drafts, pre-releases or unparsable tags. + public static ReleaseInfo? Parse(string json) + { + using var document = JsonDocument.Parse(json); + var root = document.RootElement; + if (root.ValueKind != JsonValueKind.Object) return null; + if (Flag(root, "draft") || Flag(root, "prerelease")) return null; + var tag = root.TryGetProperty("tag_name", out var t) && t.ValueKind == JsonValueKind.String ? t.GetString() : null; + var url = root.TryGetProperty("html_url", out var u) && u.ValueKind == JsonValueKind.String ? u.GetString() : null; + var version = ParseVersion(tag); + if (version is null || tag is null || url is null || !url.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) return null; + return new ReleaseInfo(version, tag, url); + } + + /// True when is newer than (build/revision ignored). + public static bool IsNewer(ReleaseInfo release, Version running) => + release.Version > new Version(running.Major, running.Minor, Math.Max(0, running.Build)); + + /// The running version from an informational version such as "0.1.0" or "0.1.0+abc". + public static Version RunningVersion(string informationalVersion) => ParseVersion(informationalVersion) ?? new Version(0, 0, 0); + + /// Asks the releases API for the latest release; null when there is none (404) or it cannot be read. + /// The request failed. + public static async Task FetchAsync(HttpClient http, string apiUrl, string userAgentVersion, CancellationToken ct) + { + using var request = new HttpRequestMessage(HttpMethod.Get, apiUrl); + request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Titano", userAgentVersion)); + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.github+json")); + using var response = await http.SendAsync(request, ct).ConfigureAwait(false); + if (response.StatusCode == System.Net.HttpStatusCode.NotFound) return null; + response.EnsureSuccessStatusCode(); + var json = await response.Content.ReadAsStringAsync(ct).ConfigureAwait(false); + try + { + return Parse(json); + } + catch (JsonException) + { + return null; + } + } + + private static bool Flag(JsonElement root, string name) => + root.TryGetProperty(name, out var value) && value.ValueKind == JsonValueKind.True; + + /// "0.2.0" for display. + public static string Display(Version version) => version.ToString(Math.Clamp(version.Build < 0 ? 2 : 3, 2, 3)); +} diff --git a/src/Titano.App/App.xaml b/src/Titano.App/App.xaml new file mode 100644 index 00000000..c70dfc76 --- /dev/null +++ b/src/Titano.App/App.xaml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/src/Titano.App/App.xaml.cs b/src/Titano.App/App.xaml.cs new file mode 100644 index 00000000..e9900ac1 --- /dev/null +++ b/src/Titano.App/App.xaml.cs @@ -0,0 +1,126 @@ +using System.Windows; +using System.Windows.Threading; +using Titano.App.DesignTime; +using Titano.App.Infrastructure; +using Titano.App.Shell; +using Titano.Core.Diagnostics; +using Titano.Ui.Mvvm; +using Titano.Ui.Theming; + +namespace Titano.App; + +/// +/// Titano desktop client. Local mode starts here: settings and language before the first window, then the window, +/// then the index and the job engine () off the UI thread. --capture <dir> +/// renders every screen with synthetic data in a throw-away data folder and exits. +/// +public partial class App : Application +{ + private FileLogSink? _log; + + public AppEnvironment Environment { get; private set; } = null!; + public AppSettings Settings { get; private set; } = null!; + public AppServices Services { get; private set; } = null!; + + public static new App Current => (App)Application.Current; + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + var captureIndex = Array.IndexOf(e.Args, "--capture"); + var capture = captureIndex >= 0; + // Capture never reads or writes the user's data folder. + Environment = capture ? AppEnvironment.ForCapture() : AppEnvironment.Detect(); + _log = new FileLogSink(Environment.LogDirectory, "titano"); + // Capture runs in CI: mirror the log to stderr so failures are visible in the job output. + Log.SetSink(capture ? new TeeLogSink(_log, new StderrLogSink()) : _log); + Log.Info("app", $"Titano {AppServices.VersionText} starting; data at {Environment.DataDirectory}"); + + Settings = capture ? new AppSettings { Language = "en" } : AppSettings.Load(Environment.SettingsPath); + UiLanguage.Apply(Settings.Language); + ThemeManager.Initialize(this, capture ? AppTheme.Dark : Settings.Theme); + AppResources.Merge(this); + + DispatcherUnhandledException += OnUnhandledException; + AppDomain.CurrentDomain.UnhandledException += (_, args) => Log.Error("app", "Unhandled exception", args.ExceptionObject as Exception); + TaskScheduler.UnobservedTaskException += (_, args) => + { + Log.Error("app", "Unobserved task exception", args.Exception); + args.SetObserved(); + }; + + var dialogs = new AppDialogs(); + Services = new AppServices(Environment, Settings, SaveSettings, dialogs); + SampleData? sample = capture ? SampleData.Configure(Services) : null; + var shell = new ShellViewModel(Services); + AsyncRelayCommand.Failed += ex => shell.ReportError(ex); + var window = new MainWindow(shell); + dialogs.Owner = window; + MainWindow = window; + + if (capture) + { + var dir = captureIndex + 1 < e.Args.Length ? e.Args[captureIndex + 1] : "screenshots"; + _ = ScreenCapture.RunAsync(window, shell, sample!, dir); + return; + } + window.Show(); + _ = StartAsync(shell); + } + + /// Opens the index and the job engine after the window is visible, then fills the screens. + private async Task StartAsync(ShellViewModel shell) + { + try + { + await Services.OpenAsync(Environment.DatabasePath); + await shell.StartAsync(); + } + catch (Exception ex) + { + shell.ReportError(ex); + } + } + + public void SaveSettings() + { + try + { + Settings.Save(Environment.SettingsPath); + } + catch (Exception ex) when (ex is System.IO.IOException or UnauthorizedAccessException) + { + Log.Warning("app", "Settings not saved", ex); + } + } + + protected override void OnExit(ExitEventArgs e) + { + SaveSettings(); + if (MainWindow?.DataContext is ShellViewModel shell) shell.Dispose(); + try + { + // Data and engine code continue on the thread pool, so waiting here cannot deadlock the dispatcher. + if (Services is not null && !Services.DisposeAsync().AsTask().Wait(TimeSpan.FromSeconds(10))) + Log.Warning("app", "Services did not stop within 10 s"); + } + catch (AggregateException ex) + { + Log.Warning("app", "Services stopped with an error", ex); + } + Log.Info("app", "Titano exiting"); + _log?.Dispose(); + if (Environment.IsCapture) Environment.DeleteCaptureData(); + base.OnExit(e); + } + + private void OnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) + { + Log.Error("app", "Unhandled UI exception", e.Exception); + if (MainWindow?.DataContext is ShellViewModel shell) + { + shell.ReportError(e.Exception); + e.Handled = true; + } + } +} diff --git a/src/Titano.App/DesignTime/SampleData.cs b/src/Titano.App/DesignTime/SampleData.cs new file mode 100644 index 00000000..105b4f1a --- /dev/null +++ b/src/Titano.App/DesignTime/SampleData.cs @@ -0,0 +1,343 @@ +using System.IO; +using System.Net; +using Titano.App.About; +using Titano.App.Infrastructure; +using Titano.App.Server; +using Titano.App.Settings; +using Titano.Core.Codecs.Jpeg; +using Titano.Core.Imaging; +using Titano.Core.Model; +using Titano.Core.Video; +using Titano.Data; +using Titano.Protocol; +using Titano.Protocol.Client; + +namespace Titano.App.DesignTime; + +/// +/// Synthetic content for --capture screenshots and the screen smoke tests ONLY: a temporary SQLite index +/// with an archive of generated JPEGs (one sequence stores its thumbnail as an embedded preview inside a fake RAW +/// file), jobs in every state, a fake signed-in server and a fake encoder inventory. Everything lives in the +/// capture environment's temporary folder; nothing touches the network or the user's data. +/// +public sealed class SampleData +{ + public const string ServerFingerprint = "9A:3C:71:E0:5B:12:C4:88:0F:6D:2A:91:E7:44:B3:5C:19:D2:6F:80:A1:3E:57:C9:0B:64:F8:2D:93:A6:71:CE"; + + private readonly AppServices _services; + private TitanoDatabase? _db; + + private SampleData(AppServices services) => _services = services; + + /// Points the services at fakes (server, encoders, update check) for an empty first-run state. + public static SampleData Configure(AppServices services) + { + if (!services.Environment.IsCapture) throw new InvalidOperationException("Sample data only runs in a capture environment."); + var settings = services.Settings; + services.Server.Dispose(); + services.Server = new ServerSession(settings, services.SaveSettings, new SampleServerApiFactory(), new PlainTokenProtector()); + services.Encoders = new SampleEncoders(); + services.CheckForUpdateAsync = _ => Task.FromResult(null); + return new SampleData(services); + } + + /// Opens the empty temporary index (first run: no archive, nothing indexed). + public async Task OpenEmptyAsync() + { + _db = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(_services.Environment.DatabasePath)); + await _services.AttachAsync(_db, startEngine: false); + } + + /// Fills the index with sample sequences, frames and jobs, and saves a signed-in server session. + public async Task FillAsync() + { + var db = _db ?? throw new InvalidOperationException("OpenEmptyAsync first."); + var settings = _services.Settings; + var root = Path.Combine(_services.Environment.DataDirectory, "archive"); + Directory.CreateDirectory(root); + var archive = new Archive { Id = Guid.CreateVersion7(), Name = "TitanoArchive", RootPath = root, Created = DateTimeOffset.UtcNow.AddYears(-2) }; + await db.Archives.UpsertAsync(archive); + + var sequences = Sequences(archive.Id).ToList(); + foreach (var (sequence, colours, raw) in sequences) + { + await db.Sequences.UpsertAsync(sequence); + await db.Frames.BulkInsertAsync(WriteFrames(root, sequence, colours, raw)); + } + await db.Sequences.SetTagsAsync(sequences[0].Sequence.Id, ["sunset", "harbour"]); + await db.Sequences.SetTagsAsync(sequences[9].Sequence.Id, ["holy grail"]); + + foreach (var job in Jobs(sequences.Select(s => s.Sequence).ToList(), archive.Id)) await db.Jobs.EnqueueAsync(job); + + settings.LastArchivePath = @"D:\TitanoArchive"; + settings.ServerUrl = "https://nas.local:8443"; + settings.ServerUsername = "alberto"; + settings.ProtectedToken = "sample-token"; + settings.TrustedCertificates = [new TrustedCertificate { Fingerprint = ServerFingerprint, Server = "https://nas.local:8443", TrustedAt = new DateTimeOffset(2026, 9, 1, 9, 30, 0, TimeSpan.Zero) }]; + settings.RecentServers = ["https://nas.local:8443"]; + settings.RenderNodeOptIn = true; + settings.FirstRunCompleted = true; + } + + private IEnumerable<(Sequence Sequence, string[] Colours, bool Raw)> Sequences(Guid archiveId) + { + var now = new DateTime(2026, 9, 28, 18, 2, 11); + (Sequence, string[], bool) Make(string? title, string folder, string make, string model, int frames, TimeSpan span, double interval, int daysAgo, + SequenceStatus status, string[] colours, int renders = 0, int warnings = 0, SequenceOrigin origin = SequenceOrigin.Local, + SyncState sync = SyncState.LocalOnly, bool raw = false) + { + var start = now.AddDays(-daysAgo); + return (new Sequence + { + Id = Guid.CreateVersion7(), + ArchiveId = archiveId, + Title = title, + Folder = folder, + CameraMake = make, + CameraModel = model, + FirstCapture = start, + LastCapture = start + span, + FrameCount = frames, + MedianInterval = interval, + TotalBytes = frames * 24_000_000L, + Status = status, + RenderedCount = renders, + WarningCount = warnings, + Origin = origin, + SyncState = sync, + UpdatedAt = DateTimeOffset.UtcNow, + }, colours, raw); + } + + const SequenceStatus Analysed = SequenceStatus.AnalyzedLight | SequenceStatus.AnalyzedDeep; + const SequenceStatus Full = Analysed | SequenceStatus.ProxiesBuilt | SequenceStatus.ThumbsBuilt | SequenceStatus.Verified; + yield return Make("Harbour sunset", "2026/2026-09-28 Canon EOS R5", "Canon", "Canon EOS R5", 3_600, TimeSpan.FromHours(2), 2, 0, Full, + ["#2A2F6B", "#B8452F", "#F0A04B", "#2B2B33"], renders: 2, sync: SyncState.InSync, raw: true); + yield return Make("Comet over the ridge", "2026/2026-08-13 GoPro HERO8 Black", "GoPro", "HERO8 Black", 1_005, new TimeSpan(5, 34, 0), 20, 46, Full, + ["#050914", "#0F1D3A", "#1E3A2F"], warnings: 1); + yield return Make(null, "2026/2026-09-27 Sony ILCE-7M4", "SONY", "ILCE-7M4", 2_140, new TimeSpan(1, 11, 0), 2, 1, Analysed, + ["#4A7FB5", "#A9C9E6", "#6F7D6A"]); + yield return Make("Aurora, Tromsø", "2026/2026-02-20 Nikon Z 8", "NIKON CORPORATION", "NIKON Z 8", 1_860, new TimeSpan(4, 8, 0), 8, 220, Full, + ["#0C2A3A", "#1AA08C", "#0B1A26"], sync: SyncState.InSync); + yield return Make("Construction cam · week 38", "2026/2026-09-14 Brinno TLC2020", "Brinno", "TLC2020", 8_920, TimeSpan.FromDays(7), 60, 14, + SequenceStatus.None, ["#7C8AA0", "#C9CFD6", "#4C5058"], origin: SequenceOrigin.Server, sync: SyncState.RemoteOnly); + yield return Make("Milan skyline dusk", "2026/2026-06-03 Apple iPhone 16 Pro", "Apple", "iPhone 16 Pro", 2_400, new TimeSpan(1, 20, 0), 2, 117, Full, + ["#1B2B4A", "#D67A4E", "#3A2A2A"], renders: 1); + yield return Make("Clouds over the Langhe", "2026/2026-05-11 Canon EOS R5", "Canon", "Canon EOS R5", 1_320, TimeSpan.FromMinutes(44), 2, 140, + SequenceStatus.None, ["#3B6FA6", "#E6EEF5", "#5C7A52"]); + yield return Make("Star trails, Colle del Nivolet", "2025/2025-08-02 Sony ILCE-7M4", "SONY", "ILCE-7M4", 640, new TimeSpan(5, 20, 0), 30, 422, Full, + ["#08101C", "#142A4A", "#0D0F14"], renders: 3); + yield return Make("Fog lifting, Asti", "2025/2025-11-21 DJI Osmo Action 5 Pro", "DJI", "Osmo Action 5 Pro", 980, new TimeSpan(1, 38, 0), 6, 311, + Analysed, ["#6A8FB0", "#F2E6D0", "#7A6A55"]); + yield return Make("Holy grail · Monviso", "2025/2025-07-14 Nikon Z 8", "NIKON CORPORATION", "NIKON Z 8", 1_720, new TimeSpan(3, 2, 0), 6, 441, Full, + ["#2C1F4D", "#C2455A", "#F5A524", "#26262C"], renders: 1, sync: SyncState.InSync); + for (var i = 0; i < 26; i++) + { + var shade = 40 + i * 6; + yield return Make($"Rooftop · day {i + 1}", $"2025/2025-03-{i + 1:00} Canon EOS R6", "Canon", "Canon EOS R6", 1_200 + i * 37, TimeSpan.FromHours(9), 30, + 480 + i, i % 3 == 0 ? Analysed : Full, [$"#{shade:X2}5A8C", "#C9D6E2", "#3D4A3A"]); + } + } + + /// Three small JPEG frames per sequence; a "raw" sequence wraps its JPEGs in a fake CR2 with an embedded preview. + private static IEnumerable WriteFrames(string root, Sequence sequence, string[] colours, bool raw) + { + var folder = Path.Combine(root, sequence.Folder.Replace('/', Path.DirectorySeparatorChar)); + Directory.CreateDirectory(folder); + var count = sequence.Title?.StartsWith("Rooftop", StringComparison.Ordinal) == true ? 1 : 3; + var frames = new List(count); + for (var i = 0; i < count; i++) + { + var jpeg = Gradient(colours, 320, 180, i / 3.0); + var name = $"{sequence.FirstCapture:yyyy-MM-dd}_{i + 1:0000}.{(raw ? "CR2" : "JPG")}"; + long? previewOffset = null; + long? previewLength = null; + var bytes = jpeg; + if (raw) + { + // A fake RAW: a header the decoders cannot read, the JPEG preview, then trailing data. + var header = new byte[4096]; + "II*\0"u8.CopyTo(header); + bytes = [.. header, .. jpeg, .. new byte[2048]]; + previewOffset = header.Length; + previewLength = jpeg.Length; + } + File.WriteAllBytes(Path.Combine(folder, name), bytes); + frames.Add(new Frame + { + Id = Guid.CreateVersion7(), + SequenceId = sequence.Id, + Index = i, + RelativePath = sequence.Folder + "/" + name, + FileName = name, + Size = bytes.Length, + CapturedAt = sequence.FirstCapture!.Value.AddSeconds(i * (sequence.MedianInterval ?? 2)), + TimestampSource = TimestampSource.ExifOriginal, + Width = 320, + Height = 180, + Format = raw ? ImageFileFormat.Cr2 : ImageFileFormat.Jpeg, + PreviewOffset = previewOffset, + PreviewLength = previewLength, + ExposureTime = 1.0 / 250, + FNumber = 8, + Iso = 100, + }); + } + return frames; + } + + /// A vertical gradient through the given sRGB colours with a sun disc that moves with . + private static byte[] Gradient(string[] colours, int width, int height, double phase) + { + using var image = new ImageBuffer(width, height, 3, clear: false); + var stops = colours.Select(Parse).ToArray(); + var sunX = width * (0.3 + 0.4 * phase); + var sunY = height * (0.55 - 0.1 * phase); + for (var y = 0; y < height; y++) + { + var t = y / (double)(height - 1) * (stops.Length - 1); + var k = Math.Min((int)t, stops.Length - 2); + var f = t - k; + for (var x = 0; x < width; x++) + { + var d = Math.Sqrt((x - sunX) * (x - sunX) + (y - sunY) * (y - sunY)); + var sun = Math.Clamp(1 - d / 14, 0, 1); + for (var c = 0; c < 3; c++) + { + var value = stops[k][c] * (1 - f) + stops[k + 1][c] * f; + image.Plane(c)[y * width + x] = (float)(value + sun * (1.0 - value) * 0.9); + } + } + } + return JpegEncoder.Encode(image, new JpegEncodeOptions { Quality = 85 }); + + static double[] Parse(string hex) + { + var rgb = Convert.FromHexString(hex.TrimStart('#')); + return [Linear(rgb[0]), Linear(rgb[1]), Linear(rgb[2])]; + } + + static double Linear(byte v) + { + var s = v / 255.0; + return s <= 0.04045 ? s / 12.92 : Math.Pow((s + 0.055) / 1.055, 2.4); + } + } + + private IEnumerable Jobs(IReadOnlyList s, Guid archiveId) + { + var now = DateTimeOffset.UtcNow; + var here = _services.WorkerId; + Job Make(JobKind kind, Sequence? target, string label, JobState state, long done, long total, double? rate = null, TimeSpan? eta = null, + TimeSpan? startedAgo = null, TimeSpan? runFor = null, string? node = null, string? error = null, string? log = null, + JobPriority priority = JobPriority.Normal, TimeSpan? createdAgo = null) => new() + { + Id = Guid.CreateVersion7(), + Kind = kind, + TargetIds = target is null ? [archiveId] : [target.Id], + TargetLabel = label, + State = state, + Priority = priority, + ProgressDone = done, + ProgressTotal = total, + ItemsPerSecond = rate, + Eta = eta, + NodeId = state == JobState.Queued ? null : node ?? here, + Error = error, + LogTail = log, + Attempts = state == JobState.Queued ? 0 : 1, + Created = now - (createdAgo ?? startedAgo ?? TimeSpan.FromMinutes(1)), + Started = startedAgo is { } ago ? now - ago : null, + Finished = state is JobState.Done or JobState.Failed && startedAgo is { } a2 ? now - a2 + (runFor ?? TimeSpan.FromMinutes(1)) : null, + }; + + yield return Make(JobKind.Render, s[0], "Harbour sunset → 4K 10-bit HEVC · 24 fps", JobState.Running, 2_232, 3_600, 11.3, TimeSpan.FromMinutes(2), + startedAgo: TimeSpan.FromMinutes(3.4), log: + "10:14:02 window 41 · deflicker −67 % · 3 exposure steps redistributed over 18 frames\n" + + "10:14:03 stabilisation on · mean shake 0.42 px · crop 1.8 %\n" + + "10:14:03 encoder NVENC HEVC Main10 · 3840×2160 · 120 Mb/s · 24 fps · GOP 48\n" + + "10:15:41 frame 2232 / 3600 · 11.3 fps · spill 0 · memory 6.1 GB of 8 GB budget"); + yield return Make(JobKind.DeepAnalyse, s[4], s[4].DisplayTitle, JobState.Running, 2_498, 8_920, 41, TimeSpan.FromMinutes(6), startedAgo: TimeSpan.FromMinutes(1.1)); + yield return Make(JobKind.Proxies, s[1], s[1].DisplayTitle, JobState.Running, 915, 1_005, 118, TimeSpan.FromSeconds(8), startedAgo: TimeSpan.FromSeconds(8)); + yield return Make(JobKind.Render, s[3], "Aurora, Tromsø → 1080p share H.264", JobState.Queued, 0, 0, createdAgo: TimeSpan.FromMinutes(12)); + yield return Make(JobKind.Verify, null, "Archive · 2024", JobState.Queued, 0, 0, priority: JobPriority.Background, createdAgo: TimeSpan.FromMinutes(30)); + yield return Make(JobKind.Verify, s[7], s[7].DisplayTitle, JobState.Failed, 640, 640, 900, startedAgo: TimeSpan.FromMinutes(25), runFor: TimeSpan.FromSeconds(43), + error: "2 files whose hash no longer matches the sidecar", log: "09:58:01 verify 640 files\n09:58:43 2 hash mismatches: 2025-08-02_0213.ARW, 2025-08-02_0214.ARW"); + yield return Make(JobKind.Render, s[5], "Milan skyline dusk → 4K HEVC", JobState.Done, 2_400, 2_400, 14.8, startedAgo: TimeSpan.FromMinutes(70), + runFor: new TimeSpan(0, 2, 41), node: "studio-pc"); + yield return Make(JobKind.Import, s[0], "EOS R5 · card A → Archive · 4,812 photos", JobState.Done, 4_812, 4_812, 7.1, startedAgo: TimeSpan.FromMinutes(110), + runFor: new TimeSpan(0, 11, 52)); + yield return Make(JobKind.Thumbs, s[2], s[2].DisplayTitle, JobState.Done, 2_140, 2_140, 2_300, startedAgo: TimeSpan.FromMinutes(108), runFor: TimeSpan.FromSeconds(1)); + } + + /// A server that always answers as "Studio NAS" with a self-signed certificate the sample trusts. + private sealed class SampleServerApiFactory : IServerApiFactory + { + public IServerApi Create(Uri baseAddress, IReadOnlyCollection trustedFingerprints) => new SampleServerApi(baseAddress, trustedFingerprints); + } + + private sealed class SampleServerApi(Uri baseAddress, IReadOnlyCollection trusted) : IServerApi + { + private static readonly UserDto User = new(Guid.Empty, "alberto", "Alberto", "editor", 0, 5_000_000_000_000, 2_100_000_000_000, false, false, + new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), DateTimeOffset.UtcNow); + + public Uri BaseAddress { get; } = baseAddress; + + public string? Token { get; set; } + + public async Task GetInfoAsync(CancellationToken ct) + { + await Task.Delay(14, ct); + if (!trusted.Contains(ServerFingerprint, StringComparer.OrdinalIgnoreCase)) throw new UntrustedCertificateException(ServerFingerprint); + return new ServerInfo("Studio NAS", "1.3.0", 1, [], ServerFingerprint, [], new ServerLimits(0, 0)); + } + + public Task LoginAsync(string username, string password, CancellationToken ct) + { + Token = "sample-token"; + return Task.FromResult(new LoginResponse(Token, User, false, DateTimeOffset.UtcNow.AddDays(30))); + } + + public Task MeAsync(CancellationToken ct) => + Token == "sample-token" ? Task.FromResult(User) : throw new TitanoApiException(HttpStatusCode.Unauthorized, new ApiError("unauthorized", "Sign in")); + + public Task LogoutAsync(CancellationToken ct) => Task.CompletedTask; + + public void Dispose() + { + } + } + + /// No encryption: the capture environment is thrown away. + private sealed class PlainTokenProtector : ITokenProtector + { + public string Protect(string token) => token; + + public string? Unprotect(string protectedToken) => protectedToken; + } + + /// The encoders of the mockup's PC (NVIDIA RTX with NVENC) and canned self-test speeds. + private sealed class SampleEncoders : IEncoderInventory + { + public string? Adapter() => "NVIDIA GeForce RTX 4070"; + + public IReadOnlyList Detect() => + [ + new("HEVC", "NVIDIA HEVC Encoder MFT", "NVIDIA", EncoderSource.MediaFoundation, true, true, 8192, 8192, VideoCodec.Hevc), + new("H.264", "NVIDIA H.264 Encoder MFT", "NVIDIA", EncoderSource.MediaFoundation, true, false, 4096, 4096, VideoCodec.H264), + new("AV1", "NVIDIA AV1 Encoder MFT", "NVIDIA", EncoderSource.MediaFoundation, true, true, 8192, 8192, VideoCodec.Av1), + new("H.264", "H264 Encoder MFT", "Microsoft", EncoderSource.MediaFoundation, false, false, 4096, 2304, VideoCodec.H264), + new("MJPEG · AVI", "Titano", null, EncoderSource.BuiltInMjpeg, false, false, 0, 0, VideoCodec.Mjpeg), + new("GIF · APNG", "Titano", null, EncoderSource.BuiltInAnimation, false, false, 0, 0, null), + ]; + + public Task SelfTestAsync(EncoderRow row, CancellationToken ct) => Task.FromResult(row.Codec switch + { + "HEVC" => new SelfTestResult(true, 142, null), + "AV1" => new SelfTestResult(true, 96, null), + "H.264" when row.Hardware => new SelfTestResult(true, 188, null), + "H.264" => new SelfTestResult(true, 21, null), + _ => new SelfTestResult(true, 64, null), + }); + } +} diff --git a/src/Titano.App/Infrastructure/AppEnvironment.cs b/src/Titano.App/Infrastructure/AppEnvironment.cs new file mode 100644 index 00000000..349f91bd --- /dev/null +++ b/src/Titano.App/Infrastructure/AppEnvironment.cs @@ -0,0 +1,62 @@ +using System.IO; + +namespace Titano.App.Infrastructure; + +/// +/// Where the client keeps its data (BRIEF §6.2): %LOCALAPPDATA%\Titano, or .\data next to the +/// executable when portable.txt exists. Never inside Documents/OneDrive (SQLite corrupts in synced folders). +/// +public sealed class AppEnvironment +{ + private AppEnvironment(string dataDirectory, bool portable, bool isCapture) + { + DataDirectory = dataDirectory; + IsPortable = portable; + IsCapture = isCapture; + Directory.CreateDirectory(DataDirectory); + Directory.CreateDirectory(LogDirectory); + Directory.CreateDirectory(CacheDirectory); + } + + public string DataDirectory { get; } + public bool IsPortable { get; } + + /// A throw-away environment for --capture: nothing of the user's data is read or written. + public bool IsCapture { get; } + + public string LogDirectory => Path.Combine(DataDirectory, "logs"); + public string CacheDirectory => Path.Combine(DataDirectory, "cache"); + public string BackupDirectory => Path.Combine(DataDirectory, "backups"); + public string DatabasePath => Path.Combine(DataDirectory, "titano.db"); + public string SettingsPath => Path.Combine(DataDirectory, "settings.json"); + + public static AppEnvironment Detect() + { + var exeDir = AppContext.BaseDirectory; + if (File.Exists(Path.Combine(exeDir, "portable.txt"))) + return new AppEnvironment(Path.Combine(exeDir, "data"), portable: true, isCapture: false); + var local = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + return new AppEnvironment(Path.Combine(local, "Titano"), portable: false, isCapture: false); + } + + /// A fresh temporary data folder for screenshots and smoke tests; delete it with . + public static AppEnvironment ForCapture() => + new(Path.Combine(Path.GetTempPath(), "titano-capture-" + Guid.CreateVersion7().ToString("N")), portable: false, isCapture: true); + + /// Removes the temporary data folder of a capture environment (never a real one). + public void DeleteCaptureData() + { + if (!IsCapture) return; + try + { + Directory.Delete(DataDirectory, recursive: true); + } + catch (IOException) + { + // Files still open (log, database) are left to the OS temp cleanup. + } + catch (UnauthorizedAccessException) + { + } + } +} diff --git a/src/Titano.App/Infrastructure/AppServices.cs b/src/Titano.App/Infrastructure/AppServices.cs new file mode 100644 index 00000000..f366bf3e --- /dev/null +++ b/src/Titano.App/Infrastructure/AppServices.cs @@ -0,0 +1,184 @@ +using System.IO; +using System.Net.Http; +using System.Reflection; +using Titano.App.About; +using Titano.App.Jobs; +using Titano.App.Library; +using Titano.App.Server; +using Titano.App.Settings; +using Titano.Core.Archiving; +using Titano.Core.Diagnostics; +using Titano.Core.Imaging.Decoders; +using Titano.Core.Model; +using Titano.Core.Windows.Wic; +using Titano.Data; +using Titano.Data.Archiving; +using Titano.Data.Jobs; + +namespace Titano.App.Infrastructure; + +/// +/// Composition root of local mode (BRIEF §4.4): the SQLite index under the data folder (migrated on open), the +/// archive engine (WIC first, then managed decoders), the one of this PC with the handlers of +/// , thumbnails, the server session, the encoder inventory and the update check. +/// Started after the window shows, stopped when the app exits. The last archive is reopened at start and rescanned +/// every (BRIEF §7: polling, no file-system watchers). +/// +public sealed class AppServices : IAsyncDisposable +{ + public static readonly TimeSpan ScanInterval = TimeSpan.FromMinutes(10); + + private static readonly Lazy Http = new(() => new HttpClient { Timeout = TimeSpan.FromSeconds(20) }); + private readonly CancellationTokenSource _stopping = new(); + private readonly Dictionary _scans = []; + private Task _polling = Task.CompletedTask; + + public AppServices(AppEnvironment environment, AppSettings settings, Action saveSettings, IAppDialogs dialogs) + { + Environment = environment; + Settings = settings; + SaveSettingsAction = saveSettings; + Dialogs = dialogs; + ArchiveSetup = new EngineArchiveSetup(this); + Server = new ServerSession(settings, saveSettings, new TitanoServerApiFactory(), new DpapiTokenProtector()); + Encoders = new MediaFoundationInventory(); + CheckForUpdateAsync = ct => UpdateCheck.FetchAsync(Http.Value, ProductLinks.LatestReleaseApi, VersionText, ct); + } + + public AppEnvironment Environment { get; } + public AppSettings Settings { get; } + public IAppDialogs Dialogs { get; } + + private Action SaveSettingsAction { get; } + + /// First-run and Library archive actions. + public IArchiveSetup ArchiveSetup { get; set; } + + /// The archive engine; null until the index is open. + public ArchiveService? Archives { get; private set; } + + public ServerSession Server { get; set; } + + public IEncoderInventory Encoders { get; set; } + + /// Latest public release (GitHub Releases API of the releases repository, BRIEF §18). + public Func> CheckForUpdateAsync { get; set; } + + /// The index; null until succeeded. + public TitanoDatabase? Database { get; private set; } + + public JobEngine? Engine { get; private set; } + + public IJobQueue? Jobs { get; private set; } + + public ThumbnailService? Thumbnails { get; private set; } + + /// Why the index could not be opened; null when it is open. + public Exception? OpenError { get; private set; } + + /// Node id of this PC's workers. + public string WorkerId { get; init; } = System.Environment.MachineName; + + /// "0.1.0" (informational version). + public static string VersionText { get; } = + typeof(AppServices).Assembly.GetCustomAttribute()?.InformationalVersion ?? "0.0.0"; + + /// The job handlers of this PC's engine — the single registration list; a kind without a handler stays + /// queued (it is never claimed here). + public static IReadOnlyList CreateJobHandlers(AppServices services) => + services.Archives?.CreateJobHandlers() ?? []; + + /// Queues a scan of unless one is already waiting or running. + public async Task QueueScanAsync(Archive archive, bool full, CancellationToken ct = default) + { + if (Engine is null || Database is null) return; + Guid previous; + lock (_scans) + { + _scans.TryGetValue(archive.Id, out previous); + } + if (previous != Guid.Empty && await Database.Jobs.GetAsync(previous, ct) is { State: JobState.Queued or JobState.Running }) return; + var job = await Engine.EnqueueAsync(ArchiveJobs.Scan(archive, full), cancellationToken: ct); + lock (_scans) + { + _scans[archive.Id] = job.Id; + } + } + + public void SaveSettings() => SaveSettingsAction(); + + /// Opens (or creates) the index at , migrates it and starts the job engine. + public async Task OpenAsync(string databasePath, CancellationToken ct = default) + { + try + { + Database = await Task.Run(() => TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(databasePath), ct), ct); + Log.Info("app", $"Index open (schema {Database.SchemaVersion}) at {databasePath}"); + } + catch (Exception ex) when (ex is DatabaseException or System.IO.IOException or UnauthorizedAccessException or DllNotFoundException) + { + OpenError = ex; + Log.Error("app", "The index could not be opened", ex); + return; + } + await StartJobsAsync(Database, startEngine: true, ct); + Thumbnails = new ThumbnailService(Database, Settings.ThumbnailMemoryItems); + if (Settings.LastArchivePath is { Length: > 0 } root) _polling = PollAsync(root, _stopping.Token); + } + + /// Uses an already open index (capture, tests) instead of opening one; sample data keeps the engine stopped. + public async Task AttachAsync(TitanoDatabase database, bool startEngine = true, CancellationToken ct = default) + { + Database = database; + await StartJobsAsync(database, startEngine, ct); + Thumbnails = new ThumbnailService(database, Settings.ThumbnailMemoryItems); + } + + public async ValueTask DisposeAsync() + { + await _stopping.CancelAsync(); + await _polling; + _stopping.Dispose(); + (Jobs as IDisposable)?.Dispose(); + if (Engine is not null) await Engine.DisposeAsync(); + Thumbnails?.Dispose(); + Server.Dispose(); + if (Database is not null) await Database.DisposeAsync(); + } + + /// Reopens the last archive (relinking a moved one, finishing interrupted renames) and rescans it periodically. + private async Task PollAsync(string root, CancellationToken ct) + { + try + { + if (Archives is null) return; + var archive = await Task.Run(() => Archives.OpenAsync(root, ct), ct); + using var timer = new PeriodicTimer(ScanInterval); + do + { + if (ArchiveService.GetAvailability(archive) == ArchiveAvailability.Online) await QueueScanAsync(archive, full: false, ct); + } + while (await timer.WaitForNextTickAsync(ct)); + } + catch (OperationCanceledException) when (ct.IsCancellationRequested) + { + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or DatabaseException) + { + Log.Warning("archive", $"The archive at {root} could not be opened", ex); + } + } + + private async Task StartJobsAsync(TitanoDatabase database, bool startEngine, CancellationToken ct) + { + Archives = new ArchiveService(database, new ArchiveServiceOptions { Decoder = DecoderFactory.CreateClient(new WicDecoderProvider()) }); + var handlers = CreateJobHandlers(this); + var kinds = handlers.Select(h => h.Kind).Distinct().ToArray(); + Engine = new JobEngine(database, handlers, new JobEngineOptions { WorkerId = WorkerId, Kinds = kinds }); + // With no handler the engine must not run: an empty kind list would let workers claim (and fail) every job. + var started = startEngine && handlers.Count > 0; + if (started) await Engine.StartAsync(ct); + Jobs = new EngineJobQueue(database, Engine, started); + Log.Info("jobs", started ? $"Job engine started with {Engine.Options.Workers} worker(s) for {string.Join(", ", kinds)}" : "No job handlers registered; jobs stay queued"); + } +} diff --git a/src/Titano.App/Infrastructure/AppSettings.cs b/src/Titano.App/Infrastructure/AppSettings.cs new file mode 100644 index 00000000..59385ce1 --- /dev/null +++ b/src/Titano.App/Infrastructure/AppSettings.cs @@ -0,0 +1,157 @@ +using System.IO; +using System.Text.Json; +using System.Text.Json.Serialization; +using Titano.Core.IO; +using Titano.Core.Naming; +using Titano.Data.Repositories; +using Titano.Ui.Theming; + +namespace Titano.App.Infrastructure; + +/// Library presentation (BRIEF §12.2). +public enum LibraryLayout +{ + Grid, + List, +} + +/// Rendering quality profile (Settings › Rendering). +public enum QualityProfile +{ + Best, + Balanced, + Fast, +} + +/// Which encoders a render may use (Settings › Rendering). +public enum HardwarePreference +{ + PreferHardware, + SoftwareOnly, + HardwareForPreviews, +} + +/// A server certificate the user trusted on first use (BRIEF §12.7). +public sealed class TrustedCertificate +{ + public string Fingerprint { get; set; } = string.Empty; + public string? Server { get; set; } + public DateTimeOffset TrustedAt { get; set; } +} + +/// +/// Per-user preferences (language, theme, window layout, archive defaults, server session). Kept in +/// settings.json next to the database and written atomically, because language and theme apply before the +/// database opens. +/// +public sealed class AppSettings +{ + public const int DefaultThumbnailMemoryItems = 2_000; + public const int DefaultCacheLimitGb = 20; + + // ---- General ---- + public string? Language { get; set; } + public AppTheme Theme { get; set; } = AppTheme.Dark; + public bool RailCollapsed { get; set; } + public bool AnonymousUsageCounts { get; set; } + public WindowPlacement? Window { get; set; } + + /// The first-run choice (local archive, adopted folder or server) was made. + public bool FirstRunCompleted { get; set; } + + // ---- Updates ---- + public bool CheckForUpdates { get; set; } = true; + + // ---- Archive ---- + /// Root of the local archive; null until the first-run choice or Settings › Archive sets it. + public string? LastArchivePath { get; set; } + + public string FolderTemplate { get; set; } = TemplateDefaults.Folder; + public string FileTemplate { get; set; } = TemplateDefaults.File; + + /// Proxy long edge for new archives; 0 = full size. + public int ProxyLongEdge { get; set; } = 1920; + + // ---- Library ---- + public LibraryLayout LibraryLayout { get; set; } = LibraryLayout.Grid; + public SequenceSort LibrarySort { get; set; } = SequenceSort.Newest; + + // ---- Rendering ---- + public QualityProfile Quality { get; set; } = QualityProfile.Balanced; + + /// Frame memory budget in GB; null = Auto (a quarter of installed memory). + public int? MemoryBudgetGb { get; set; } + + /// Worker threads; null = Auto (cores minus four, at least one). + public int? Parallelism { get; set; } + + public bool BackgroundPriority { get; set; } = true; + public HardwarePreference HardwareEncoding { get; set; } = HardwarePreference.PreferHardware; + + // ---- Storage ---- + /// Cache (spill frames, thumbnails); null = cache under the data folder. + public string? CacheFolder { get; set; } + + /// Decoded thumbnails kept in memory. + public int ThumbnailMemoryItems { get; set; } = DefaultThumbnailMemoryItems; + + /// Upper bound of the disk cache in GB. + public int CacheLimitGb { get; set; } = DefaultCacheLimitGb; + + // ---- Server ---- + public string? ServerUrl { get; set; } + public string? ServerUsername { get; set; } + + /// The session token, encrypted for this Windows user with DPAPI (Base64). + public string? ProtectedToken { get; set; } + + public List TrustedCertificates { get; set; } = []; + public List RecentServers { get; set; } = []; + + /// Let the server send render jobs to this PC (BRIEF §14.7). + public bool RenderNodeOptIn { get; set; } + + // ---- Jobs ---- + /// "Clear done": finished jobs older than this are hidden from the Jobs list (they stay in the history). + public DateTimeOffset? JobsClearedAt { get; set; } + + public sealed class WindowPlacement + { + public double Left { get; set; } + public double Top { get; set; } + public double Width { get; set; } + public double Height { get; set; } + public bool Maximized { get; set; } + } + + public static AppSettings Load(string path) + { + try + { + if (File.Exists(path)) return Parse(File.ReadAllText(path)) ?? new AppSettings(); + } + catch (JsonException) + { + // A corrupt settings file must never block startup; defaults apply. + } + catch (IOException) + { + } + return new AppSettings(); + } + + /// Reads settings JSON (Settings › Import); null when the text is not a settings object. + /// The text is not valid JSON. + public static AppSettings? Parse(string json) => JsonSerializer.Deserialize(json, AppSettingsJson.Default.AppSettings); + + public string ToJson() => JsonSerializer.Serialize(this, AppSettingsJson.Default.AppSettings); + + public void Save(string path) => AtomicFile.WriteAllText(path, ToJson()); + + /// A deep copy (JSON round trip), used for import and reset. + public AppSettings Clone() => Parse(ToJson()) ?? new AppSettings(); +} + +[JsonSourceGenerationOptions(WriteIndented = true, UseStringEnumConverter = true)] +[JsonSerializable(typeof(AppSettings))] +internal sealed partial class AppSettingsJson : JsonSerializerContext; diff --git a/src/Titano.App/Infrastructure/ArchiveSetup.cs b/src/Titano.App/Infrastructure/ArchiveSetup.cs new file mode 100644 index 00000000..15b3672c --- /dev/null +++ b/src/Titano.App/Infrastructure/ArchiveSetup.cs @@ -0,0 +1,125 @@ +using System.IO; +using Titano.Core.Diagnostics; +using Titano.Data.Archiving; + +namespace Titano.App.Infrastructure; + +/// +/// First-run and Library archive choices (BRIEF §12.1): create a local archive or adopt an existing folder tree. +/// +public interface IArchiveSetup +{ + /// Creates (or opens) the local archive rooted at . + Task CreateAsync(string root, CancellationToken cancellationToken = default); + + /// Indexes the photos under in place, or opens a previous Titano archive there. + Task AdoptAsync(string folder, CancellationToken cancellationToken = default); +} + +/// +/// Creates or adopts the archive through the archive engine (originals stay where they are), remembers it as the +/// archive to open at start and queues a full scan that indexes its sequences. +/// +public sealed class EngineArchiveSetup(AppServices services) : IArchiveSetup +{ + public Task CreateAsync(string root, CancellationToken cancellationToken = default) => OpenAsync(root, cancellationToken); + + public Task AdoptAsync(string folder, CancellationToken cancellationToken = default) => OpenAsync(folder, cancellationToken); + + private async Task OpenAsync(string path, CancellationToken cancellationToken) + { + var archives = services.Archives ?? throw new InvalidOperationException("The index is not open.", services.OpenError); + var root = Path.GetFullPath(path); + var archive = await Task.Run(async () => + { + Directory.CreateDirectory(root); + return await archives.AdoptAsync(root, null, cancellationToken).ConfigureAwait(false); + }, cancellationToken); + services.Settings.LastArchivePath = root; + services.SaveSettings(); + await services.QueueScanAsync(archive, full: true, cancellationToken); + Log.Info("archive", $"Archive {archive.Name} ready at {root}"); + } +} + +/// Runs an archive action from the UI; a failure becomes a toast instead of an unhandled exception. +public static class ArchiveActions +{ + public static async Task TryAsync(Shell.ShellViewModel shell, Func action) + { + try + { + await action(shell.Services.ArchiveSetup); + return true; + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidOperationException or InvalidDataException + or Data.DatabaseException) + { + Log.Error("archive", "Archive action failed", ex); + shell.Notify(Core.Localization.Loc.L("Errors.Archive.Open"), ex.Message); + return false; + } + } +} + +/// Archive roots offered by default and their free space. +public static class ArchiveLocations +{ + public const string DefaultFolderName = "TitanoArchive"; + + /// "<fixed drive with the most free space>\TitanoArchive". + public static string SuggestRoot() + { + try + { + var best = DriveInfo.GetDrives() + .Where(d => d.DriveType == DriveType.Fixed && d.IsReady) + .OrderByDescending(d => d.AvailableFreeSpace) + .FirstOrDefault(); + if (best is not null) return Path.Combine(best.RootDirectory.FullName, DefaultFolderName); + } + catch (IOException) + { + } + catch (UnauthorizedAccessException) + { + } + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), DefaultFolderName); + } + + /// Free bytes on the volume of ; null when unknown. + public static long? FreeSpace(string? path) + { + if (string.IsNullOrWhiteSpace(path)) return null; + try + { + var root = Path.GetPathRoot(Path.GetFullPath(path)); + if (string.IsNullOrEmpty(root)) return null; + var drive = new DriveInfo(root); + return drive.IsReady ? drive.AvailableFreeSpace : null; + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or NotSupportedException) + { + return null; + } + } + + /// The problem of an archive root as a localized sentence; null when it can be used. + public static string? Validate(string? path) + { + if (string.IsNullOrWhiteSpace(path)) return Core.Localization.Loc.L("Errors.Path.Empty"); + try + { + if (!Path.IsPathFullyQualified(path)) return Core.Localization.Loc.L("Errors.Path.NotAbsolute"); + var full = Path.GetFullPath(path); + if (File.Exists(full)) return Core.Localization.Loc.L("Errors.Path.IsFile"); + var root = Path.GetPathRoot(full); + if (string.IsNullOrEmpty(root) || !Directory.Exists(root)) return Core.Localization.Loc.L("Errors.Path.NoDrive"); + return null; + } + catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException) + { + return Core.Localization.Loc.L("Errors.Path.Invalid"); + } + } +} diff --git a/src/Titano.App/Infrastructure/DiagnosticsBundle.cs b/src/Titano.App/Infrastructure/DiagnosticsBundle.cs new file mode 100644 index 00000000..1bdb5217 --- /dev/null +++ b/src/Titano.App/Infrastructure/DiagnosticsBundle.cs @@ -0,0 +1,147 @@ +using System.Globalization; +using System.IO; +using System.IO.Compression; +using System.Runtime.InteropServices; +using System.Text; + +namespace Titano.App.Infrastructure; + +/// +/// The diagnostics bundle of About and Settings › Advanced (BRIEF §12.9): the log files plus an environment report +/// (versions, OS, runtime, culture, folders), zipped into a folder the user chose. Settings and tokens are not included. +/// +public static class DiagnosticsBundle +{ + /// Writes "Titano diagnostics yyyy-MM-dd HHmm.zip" into and returns its path. + public static Task CreateAsync(AppEnvironment environment, string folder, IEnumerable? extraLines = null, CancellationToken ct = default) => + Task.Run(() => + { + var path = Path.Combine(folder, $"Titano diagnostics {DateTime.Now.ToString("yyyy-MM-dd HHmm", CultureInfo.InvariantCulture)}.zip"); + var temp = path + ".tmp"; + using (var zip = ZipFile.Open(temp, ZipArchiveMode.Create)) + { + var report = zip.CreateEntry("environment.txt", CompressionLevel.Optimal); + using (var writer = new StreamWriter(report.Open(), new UTF8Encoding(false))) + { + writer.Write(Report(environment, extraLines)); + } + if (Directory.Exists(environment.LogDirectory)) + { + foreach (var log in Directory.EnumerateFiles(environment.LogDirectory, "*.log").OrderBy(f => f, StringComparer.Ordinal)) + { + ct.ThrowIfCancellationRequested(); + var entry = zip.CreateEntry("logs/" + Path.GetFileName(log), CompressionLevel.Optimal); + // The current log is open for writing: share the handle instead of copying the file. + using var source = new FileStream(log, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete); + using var target = entry.Open(); + source.CopyTo(target); + } + } + } + File.Move(temp, path, overwrite: true); + return path; + }, ct); + + /// Plain-text environment report. + public static string Report(AppEnvironment environment, IEnumerable? extraLines = null) + { + var sb = new StringBuilder(); + sb.AppendLine(CultureInfo.InvariantCulture, $"Titano {AppServices.VersionText}"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Created {DateTimeOffset.Now:O}"); + sb.AppendLine(CultureInfo.InvariantCulture, $"OS {RuntimeInformation.OSDescription} ({RuntimeInformation.OSArchitecture})"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Runtime {RuntimeInformation.FrameworkDescription} ({RuntimeInformation.ProcessArchitecture})"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Culture {CultureInfo.CurrentCulture.Name} / UI {CultureInfo.CurrentUICulture.Name}"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Processors {Environment.ProcessorCount}"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Memory {GC.GetGCMemoryInfo().TotalAvailableMemoryBytes / (1024 * 1024)} MB"); + sb.AppendLine(CultureInfo.InvariantCulture, $"Data {environment.DataDirectory} (portable: {environment.IsPortable})"); + if (extraLines is not null) + { + foreach (var line in extraLines) sb.AppendLine(line); + } + return sb.ToString(); + } +} + +/// +/// The disk cache (spilled frames, thumbnails): its folder, its size and clearing it. Only a folder Titano created +/// (it carries a marker file) is ever emptied, so pointing the cache at a folder with user files cannot delete them. +/// +public static class CacheStore +{ + public const string MarkerFile = ".titano-cache"; + + /// The cache folder in effect. + public static string Folder(AppEnvironment environment, AppSettings settings) => + string.IsNullOrWhiteSpace(settings.CacheFolder) ? environment.CacheDirectory : settings.CacheFolder!; + + /// Creates the folder (if needed) and marks it as Titano's. + public static void Prepare(string folder) + { + Directory.CreateDirectory(folder); + var marker = Path.Combine(folder, MarkerFile); + if (!File.Exists(marker)) File.WriteAllText(marker, "Titano cache folder. Its contents can be deleted at any time."); + } + + /// True when is a Titano cache folder (safe to empty). + public static bool IsOwned(string folder) => File.Exists(Path.Combine(folder, MarkerFile)); + + /// Total bytes of the files in the cache (0 when missing). + public static long Size(string folder) + { + if (!Directory.Exists(folder)) return 0; + long total = 0; + var options = new EnumerationOptions { RecurseSubdirectories = true, IgnoreInaccessible = true, AttributesToSkip = FileAttributes.ReparsePoint }; + foreach (var file in new DirectoryInfo(folder).EnumerateFiles("*", options)) total += file.Length; + return total; + } + + /// Deletes everything inside an owned cache folder except the marker; returns the bytes freed. + /// The folder is not a Titano cache folder. + public static long Clear(string folder) + { + if (!Directory.Exists(folder)) return 0; + if (!IsOwned(folder)) throw new InvalidOperationException("Not a Titano cache folder: " + folder); + long freed = 0; + var root = new DirectoryInfo(folder); + foreach (var file in root.EnumerateFiles()) + { + if (file.Name == MarkerFile) continue; + freed += TryDelete(file); + } + foreach (var directory in root.EnumerateDirectories()) + { + if ((directory.Attributes & FileAttributes.ReparsePoint) != 0) continue; + var options = new EnumerationOptions { RecurseSubdirectories = true, IgnoreInaccessible = true, AttributesToSkip = FileAttributes.ReparsePoint }; + foreach (var file in directory.EnumerateFiles("*", options)) freed += TryDelete(file); + try + { + directory.Delete(recursive: true); + } + catch (IOException) + { + } + catch (UnauthorizedAccessException) + { + } + } + return freed; + } + + private static long TryDelete(FileInfo file) + { + try + { + var length = file.Length; + file.Delete(); + return length; + } + catch (IOException) + { + return 0; // in use (a render spilling right now) + } + catch (UnauthorizedAccessException) + { + return 0; + } + } +} diff --git a/src/Titano.App/Infrastructure/Formatting.cs b/src/Titano.App/Infrastructure/Formatting.cs new file mode 100644 index 00000000..18c48b23 --- /dev/null +++ b/src/Titano.App/Infrastructure/Formatting.cs @@ -0,0 +1,59 @@ +using Titano.Core.Localization; + +namespace Titano.App.Infrastructure; + +/// Culture-aware number, size and duration formatting for the UI. +public static class Formatting +{ + private static readonly string[] ByteUnits = ["B", "KB", "MB", "GB", "TB", "PB"]; + + /// 1,536 → "1.5 KB" (decimal units, as Explorer shows for drives). + public static string Bytes(long bytes) + { + double value = bytes; + var unit = 0; + while (value >= 1000 && unit < ByteUnits.Length - 1) + { + value /= 1000; + unit++; + } + var format = unit == 0 || value >= 100 ? "0" : "0.#"; + return value.ToString(format, Loc.Culture) + " " + ByteUnits[unit]; + } + + public static string Count(long n) => n.ToString("N0", Loc.Culture); + + /// Compact duration: "2 h 00 m", "5 min", "40 s". + public static string Duration(TimeSpan t) + { + if (t < TimeSpan.Zero) t = TimeSpan.Zero; + if (t.TotalHours >= 24) return Loc.L("Common.Duration.Days", (int)t.TotalDays, t.Hours); + if (t.TotalHours >= 1) return Loc.L("Common.Duration.Hours", (int)t.TotalHours, t.Minutes.ToString("00", Loc.Culture)); + if (t.TotalMinutes >= 1) return Loc.L("Common.Duration.Minutes", (int)Math.Round(t.TotalMinutes)); + return Loc.L("Common.Duration.Seconds", (int)Math.Round(t.TotalSeconds)); + } + + /// Clock-style elapsed time for finished jobs: "2:41", "1:02:41". + public static string Elapsed(TimeSpan t) + { + if (t < TimeSpan.Zero) t = TimeSpan.Zero; + return t.TotalHours >= 1 + ? ((int)t.TotalHours).ToString(Loc.Culture) + ":" + t.Minutes.ToString("00", Loc.Culture) + ":" + t.Seconds.ToString("00", Loc.Culture) + : ((int)t.TotalMinutes).ToString(Loc.Culture) + ":" + t.Seconds.ToString("00", Loc.Culture); + } + + /// 0.62 → "62 %". + public static string Percent(double fraction) => Loc.L("Common.Percent", Math.Round(Math.Clamp(fraction, 0, 1) * 100).ToString("0", Loc.Culture)); + + /// Items per second with one decimal below 100: "11.3", "118". + public static string Rate(double perSecond) => perSecond.ToString(perSecond < 100 ? "0.#" : "N0", Loc.Culture); + + /// Local time of day in the culture's short format ("09:12"). + public static string TimeOfDay(DateTimeOffset at) => at.ToLocalTime().ToString("t", Loc.Culture); + + /// Calendar date in the culture's short format. + public static string Date(DateTimeOffset at) => at.ToLocalTime().ToString("d", Loc.Culture); + + /// Camera wall-clock date in the culture's short format. + public static string Date(DateTime wallClock) => wallClock.ToString("d", Loc.Culture); +} diff --git a/src/Titano.App/Infrastructure/IAppDialogs.cs b/src/Titano.App/Infrastructure/IAppDialogs.cs new file mode 100644 index 00000000..892964e2 --- /dev/null +++ b/src/Titano.App/Infrastructure/IAppDialogs.cs @@ -0,0 +1,39 @@ +namespace Titano.App.Infrastructure; + +/// Texts of a confirmation dialog (DESIGN §4: two buttons, safe action left and default). +public sealed record ConfirmRequest +{ + public required string Heading { get; init; } + public required string Message { get; init; } + + /// Monospaced detail (certificate fingerprint); null hides it. + public string? Detail { get; init; } + + public string? DetailToolTip { get; init; } + public required string SafeText { get; init; } + public required string SafeToolTip { get; init; } + public required string ActionText { get; init; } + public required string ActionToolTip { get; init; } + + /// Warning-outlined action (never a primary) for data-destroying choices. + public bool IsDestructive { get; init; } +} + +/// Modal questions and OS pickers the view models ask for (BRIEF §12.1: modals only for confirmations and login). +public interface IAppDialogs +{ + /// A folder chosen in the shell's folder picker; null when cancelled. + string? PickFolder(string title, string? initialFolder = null); + + /// A JSON file chosen in the shell's Open dialog; null when cancelled. + string? PickJsonFile(string title); + + /// True when the user chose the action. + bool Confirm(ConfirmRequest request); + + /// + /// The login form. receives user and password and returns null on success or the + /// error sentence to show; the form stays open until it succeeds or the user cancels. True when signed in. + /// + bool SignIn(string server, string? username, Func> signIn); +} diff --git a/src/Titano.App/Infrastructure/ProductLinks.cs b/src/Titano.App/Infrastructure/ProductLinks.cs new file mode 100644 index 00000000..bcccb637 --- /dev/null +++ b/src/Titano.App/Infrastructure/ProductLinks.cs @@ -0,0 +1,22 @@ +namespace Titano.App.Infrastructure; + +/// Public links (BRIEF §19.4). Overridable at build time via the TitanoReleasesRepo property. +public static class ProductLinks +{ + public static string ReleasesRepository { get; } = + typeof(ProductLinks).Assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyMetadataAttribute), false) + .OfType() + .FirstOrDefault(a => a.Key == "TitanoReleasesRepo")?.Value ?? "alby96/titano-releases"; + + public static string Repository => $"https://github.com/{ReleasesRepository}"; + + public static string Releases => $"{Repository}/releases"; + + public static string LatestReleaseApi => $"https://api.github.com/repos/{ReleasesRepository}/releases/latest"; + + /// The licence (EULA) published with the releases (BRIEF §12.9). + public static string Licence => $"{Repository}/blob/HEAD/LICENSE.md"; + + /// Where translations are reviewed by the community (BRIEF §16). + public static string Issues => $"{Repository}/issues"; +} diff --git a/src/Titano.App/Infrastructure/ShellActions.cs b/src/Titano.App/Infrastructure/ShellActions.cs new file mode 100644 index 00000000..ef09d422 --- /dev/null +++ b/src/Titano.App/Infrastructure/ShellActions.cs @@ -0,0 +1,31 @@ +using System.IO; +using Titano.Core.Diagnostics; +using Titano.Core.Windows.Shell; + +namespace Titano.App.Infrastructure; + +/// The only shell launches the product performs (BRIEF §8.6): open a web or Store link, reveal a folder or file. +public static class ShellActions +{ + public static void OpenUrl(string url) + { + if (!ShellLauncher.IsAllowedUrl(url)) return; + try + { + if (!ShellLauncher.OpenUrl(url)) Log.Warning("shell", $"The shell could not open {url}"); + } + catch (Exception ex) when (ex is ArgumentException or System.ComponentModel.Win32Exception) + { + Log.Warning("shell", $"The shell could not open {url}", ex); + } + } + + /// Opens a folder in Explorer, or shows a file selected in its folder. + public static void Reveal(string path) + { + if (string.IsNullOrWhiteSpace(path) || !(Directory.Exists(path) || File.Exists(path))) return; + if (!ShellLauncher.RevealInExplorer(path)) Log.Warning("shell", $"Explorer could not show {path}"); + } + + public static void OpenFolder(string path) => Reveal(path); +} diff --git a/src/Titano.App/Infrastructure/UiLanguage.cs b/src/Titano.App/Infrastructure/UiLanguage.cs new file mode 100644 index 00000000..e2a5f783 --- /dev/null +++ b/src/Titano.App/Infrastructure/UiLanguage.cs @@ -0,0 +1,33 @@ +using System.Globalization; +using System.Windows; +using Titano.Core.Localization; + +namespace Titano.App.Infrastructure; + +/// Switches the UI language at run time without restart (BRIEF §16), mirroring right-to-left languages. +public static class UiLanguage +{ + /// Applies (or the OS language when null) and returns the culture in use. + public static CultureInfo Apply(string? code) + { + CultureInfo requested; + try + { + requested = code is null ? CultureInfo.CurrentUICulture : CultureInfo.GetCultureInfo(code); + } + catch (CultureNotFoundException) + { + requested = CultureInfo.CurrentUICulture; + } + var culture = Languages.BestMatch(requested); + CultureInfo.DefaultThreadCurrentUICulture = culture; + CultureInfo.CurrentUICulture = culture; + Loc.SetCulture(culture); + if (Application.Current is { } app) + { + foreach (Window window in app.Windows) + window.FlowDirection = Loc.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; + } + return culture; + } +} diff --git a/src/Titano.App/Interop/FileDialogs.cs b/src/Titano.App/Interop/FileDialogs.cs new file mode 100644 index 00000000..9f8e75de --- /dev/null +++ b/src/Titano.App/Interop/FileDialogs.cs @@ -0,0 +1,192 @@ +using System.Runtime.InteropServices; + +namespace Titano.App.Interop; + +/// A filter of the Open dialog: display name and patterns such as *.jpg;*.cr2. +public readonly record struct FileFilter(string Name, string Patterns); + +/// +/// The shell's Open dialog through IFileOpenDialog COM (no WinForms): one or several files, or one folder +/// (which also picks a card root such as E:\). Same wrapper as the uploader's (kept per program so neither +/// depends on the other). +/// +public static class FileDialogs +{ + private const uint FosPickFolders = 0x20; + private const uint FosForceFileSystem = 0x40; + private const uint FosAllowMultiSelect = 0x200; + private const uint FosPathMustExist = 0x800; + private const uint FosFileMustExist = 0x1000; + private const uint SigdnFileSysPath = 0x80058000; + private const int ErrorCancelled = unchecked((int)0x800704C7); + + /// Selected files; empty when cancelled. + public static IReadOnlyList PickFiles(IntPtr owner, string title, IReadOnlyList filters) => + Show(owner, title, FosAllowMultiSelect | FosFileMustExist, filters); + + /// One selected file; null when cancelled. + public static string? PickFile(IntPtr owner, string title, IReadOnlyList filters) => + Show(owner, title, FosFileMustExist, filters).FirstOrDefault(); + + /// Selected folder; null when cancelled. + public static string? PickFolder(IntPtr owner, string title) => Show(owner, title, FosPickFolders, []).FirstOrDefault(); + + private static List Show(IntPtr owner, string title, uint options, IReadOnlyList filters) + { + var dialog = (IFileOpenDialog)new FileOpenDialogClass(); + try + { + dialog.GetOptions(out var current); + dialog.SetOptions(current | options | FosForceFileSystem | FosPathMustExist); + dialog.SetTitle(title); + if (filters.Count > 0) + { + var specs = filters.Select(f => new FilterSpec { Name = f.Name, Spec = f.Patterns }).ToArray(); + dialog.SetFileTypes((uint)specs.Length, specs); + dialog.SetFileTypeIndex(1); + } + var hr = dialog.Show(owner); + if (hr == ErrorCancelled) return []; + Marshal.ThrowExceptionForHR(hr); + + dialog.GetResults(out var items); + try + { + items.GetCount(out var count); + var paths = new List((int)count); + for (uint i = 0; i < count; i++) + { + items.GetItemAt(i, out var item); + try + { + item.GetDisplayName(SigdnFileSysPath, out var path); + paths.Add(path); + } + finally + { + Marshal.ReleaseComObject(item); + } + } + return paths; + } + finally + { + Marshal.ReleaseComObject(items); + } + } + finally + { + Marshal.ReleaseComObject(dialog); + } + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + private struct FilterSpec + { + [MarshalAs(UnmanagedType.LPWStr)] + public string Name; + + [MarshalAs(UnmanagedType.LPWStr)] + public string Spec; + } + + [ComImport] + [Guid("DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7")] + private class FileOpenDialogClass; + + // Classic COM interop does not inherit vtables: IModalWindow and IFileDialog members are repeated in order. + [ComImport] + [Guid("d57c7288-d4ad-4768-be02-9d969532d960")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IFileOpenDialog + { + [PreserveSig] + int Show(IntPtr owner); + + void SetFileTypes(uint count, [In, MarshalAs(UnmanagedType.LPArray)] FilterSpec[] filters); + + void SetFileTypeIndex(uint index); + + void GetFileTypeIndex(out uint index); + + void Advise(IntPtr events, out uint cookie); + + void Unadvise(uint cookie); + + void SetOptions(uint options); + + void GetOptions(out uint options); + + void SetDefaultFolder(IShellItem item); + + void SetFolder(IShellItem item); + + void GetFolder(out IShellItem item); + + void GetCurrentSelection(out IShellItem item); + + void SetFileName([MarshalAs(UnmanagedType.LPWStr)] string name); + + void GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string name); + + void SetTitle([MarshalAs(UnmanagedType.LPWStr)] string title); + + void SetOkButtonLabel([MarshalAs(UnmanagedType.LPWStr)] string text); + + void SetFileNameLabel([MarshalAs(UnmanagedType.LPWStr)] string label); + + void GetResult(out IShellItem item); + + void AddPlace(IShellItem item, int placement); + + void SetDefaultExtension([MarshalAs(UnmanagedType.LPWStr)] string extension); + + void Close(int hr); + + void SetClientGuid(ref Guid guid); + + void ClearClientData(); + + void SetFilter(IntPtr filter); + + void GetResults(out IShellItemArray items); + + void GetSelectedItems(out IShellItemArray items); + } + + [ComImport] + [Guid("43826d1e-e718-42ee-bc55-a1e261c37bfe")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IShellItem + { + void BindToHandler(IntPtr bindContext, ref Guid handler, ref Guid iid, out IntPtr result); + + void GetParent(out IShellItem parent); + + void GetDisplayName(uint form, [MarshalAs(UnmanagedType.LPWStr)] out string name); + + void GetAttributes(uint mask, out uint attributes); + + void Compare(IShellItem other, uint hint, out int order); + } + + [ComImport] + [Guid("b63ea76d-1f85-456f-a19c-48159efa858b")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IShellItemArray + { + void BindToHandler(IntPtr bindContext, ref Guid handler, ref Guid iid, out IntPtr result); + + void GetPropertyStore(int flags, ref Guid iid, out IntPtr store); + + void GetPropertyDescriptionList(IntPtr keyType, ref Guid iid, out IntPtr list); + + void GetAttributes(int flags, uint mask, out uint attributes); + + void GetCount(out uint count); + + void GetItemAt(uint index, out IShellItem item); + + void EnumItems(out IntPtr items); + } +} diff --git a/src/Titano.App/Jobs/JobListModel.cs b/src/Titano.App/Jobs/JobListModel.cs new file mode 100644 index 00000000..cd72b0c8 --- /dev/null +++ b/src/Titano.App/Jobs/JobListModel.cs @@ -0,0 +1,164 @@ +using Titano.Core.Model; +using Titano.Data.Jobs; + +namespace Titano.App.Jobs; + +/// Filter chips of the Jobs screen (BRIEF §12.6). +public enum JobFilter +{ + All, + Running, + Queued, + Done, + Failed, +} + +/// One job as the Jobs screen knows it: the last stored snapshot plus live progress while it runs. +public sealed class JobEntry(Job job) +{ + public Job Job { get; internal set; } = job; + + /// Latest progress event of the running job; null once it stops. + public JobProgressInfo? Live { get; internal set; } + + /// of the last update. + internal long Stamp { get; set; } + + public Guid Id => Job.Id; + public JobState State => Job.State; + public long Done => Live?.Done ?? Job.ProgressDone; + public long Total => Live?.Total ?? Job.ProgressTotal; + public double? ItemsPerSecond => Live?.ItemsPerSecond ?? Job.ItemsPerSecond; + public TimeSpan? Eta => Live?.Eta ?? Job.Eta; + public string? Message => Live?.Message; + + /// 0…1, or null while the total is unknown. + public double? Fraction => Total > 0 ? Math.Clamp((double)Done / Total, 0, 1) : null; + + public bool IsFinished => State is JobState.Done or JobState.Failed or JobState.Cancelled; +} + +/// +/// The job list behind the Jobs screen and the job bar: merges stored snapshots (, +/// repository pages) with live progress (), keeps queue order and answers the +/// filters. WPF-free and not thread-safe; feed it on the UI thread (through ). +/// +public sealed class JobListModel +{ + private readonly Dictionary _entries = []; + + private long _stamp; + + public int Count => _entries.Count; + + public JobEntry? this[Guid id] => _entries.GetValueOrDefault(id); + + /// + /// Change counter. Read it before requesting a page from the database and pass it to , + /// so a page that was read before an event cannot overwrite the newer state the event brought. + /// + public long Stamp => _stamp; + + /// Inserts or replaces a snapshot that is known to be current (an engine event). True when something changed. + public bool Apply(Job job) => Store(job, ++_stamp); + + /// Inserts a snapshot read from the database; skipped when an event updated the job after . + public bool ApplyLoaded(Job job, long readAt) + { + if (_entries.TryGetValue(job.Id, out var entry) && entry.Stamp > readAt) return false; + return Store(job, readAt); + } + + private bool Store(Job job, long stamp) + { + if (!_entries.TryGetValue(job.Id, out var entry)) + { + _entries[job.Id] = new JobEntry(job) { Stamp = stamp }; + return true; + } + entry.Stamp = Math.Max(entry.Stamp, stamp); + if (entry.Job == job) return false; + entry.Job = job; + if (job.State != JobState.Running) entry.Live = null; + return true; + } + + /// Live progress of a running job; ignored for unknown or no longer running jobs. True when something changed. + public bool Apply(JobProgressInfo progress) + { + if (!_entries.TryGetValue(progress.JobId, out var entry) || entry.State != JobState.Running) return false; + if (entry.Live == progress) return false; + entry.Live = progress; + return true; + } + + /// Removes jobs no longer present (e.g. purged history). + public bool Remove(Guid id) => _entries.Remove(id); + + /// + /// Display order: running (oldest start first), paused, queued in the order workers claim them (priority, then + /// age), then the history, newest finish first. Finished jobs before are hidden. + /// + public IReadOnlyList Ordered(JobFilter filter = JobFilter.All, string? search = null, DateTimeOffset? clearedBefore = null) + { + var text = string.IsNullOrWhiteSpace(search) ? null : search.Trim(); + return _entries.Values + .Where(e => Matches(e, filter) && Visible(e, clearedBefore) && (text is null || MatchesText(e, text))) + .OrderBy(Group) + .ThenBy(e => e.State == JobState.Queued ? -(int)e.Job.Priority : 0) + .ThenBy(e => e.IsFinished ? -(e.Job.Finished ?? e.Job.Created).UtcTicks : (e.Job.Started ?? e.Job.Created).UtcTicks) + .ThenBy(e => e.Job.Created) + .ThenBy(e => e.Id) + .ToList(); + } + + /// Jobs per filter chip (after "Clear done"). + public int CountOf(JobFilter filter, DateTimeOffset? clearedBefore = null) => + _entries.Values.Count(e => Matches(e, filter) && Visible(e, clearedBefore)); + + /// 1-based place of a queued job in the order workers claim jobs; 0 when it is not queued. + public int QueuePosition(Guid id) + { + if (!_entries.TryGetValue(id, out var entry) || entry.State != JobState.Queued) return 0; + return _entries.Values.Count(e => e.State == JobState.Queued && ClaimsBefore(e.Job, entry.Job)) + 1; + } + + /// The job the job bar mirrors: the running job with the most recent progress, else the first running one. + public JobEntry? Current => + _entries.Values.Where(e => e.State == JobState.Running) + .OrderByDescending(e => e.Live is not null) + .ThenBy(e => (e.Job.Started ?? e.Job.Created).UtcTicks) + .FirstOrDefault(); + + public int RunningCount => _entries.Values.Count(e => e.State == JobState.Running); + + public int QueuedCount => _entries.Values.Count(e => e.State == JobState.Queued); + + /// Same order as JobRepository.ClaimNextAsync: priority descending, then creation time and id. + public static bool ClaimsBefore(Job a, Job b) => + a.Priority != b.Priority ? a.Priority > b.Priority : a.Created != b.Created ? a.Created < b.Created : a.Id.CompareTo(b.Id) < 0; + + private static int Group(JobEntry e) => e.State switch + { + JobState.Running => 0, + JobState.Paused => 1, + JobState.Queued => 2, + _ => 3, + }; + + private static bool Matches(JobEntry e, JobFilter filter) => filter switch + { + JobFilter.Running => e.State is JobState.Running or JobState.Paused, + JobFilter.Queued => e.State == JobState.Queued, + JobFilter.Done => e.State == JobState.Done, + JobFilter.Failed => e.State is JobState.Failed or JobState.Cancelled, + _ => true, + }; + + private static bool Visible(JobEntry e, DateTimeOffset? clearedBefore) => + clearedBefore is null || !e.IsFinished || (e.Job.Finished ?? e.Job.Created) > clearedBefore; + + private static bool MatchesText(JobEntry e, string text) => + (e.Job.TargetLabel?.Contains(text, StringComparison.CurrentCultureIgnoreCase) ?? false) + || JobText.Kind(e.Job.Kind).Contains(text, StringComparison.CurrentCultureIgnoreCase); +} diff --git a/src/Titano.App/Jobs/JobQueue.cs b/src/Titano.App/Jobs/JobQueue.cs new file mode 100644 index 00000000..dbc587d1 --- /dev/null +++ b/src/Titano.App/Jobs/JobQueue.cs @@ -0,0 +1,106 @@ +using Titano.Core.Model; +using Titano.Data; +using Titano.Data.Jobs; +using Titano.Data.Repositories; + +namespace Titano.App.Jobs; + +/// What the Jobs screen, the job bar and the Library need from the job system. +public interface IJobQueue +{ + /// A job changed state (any thread). + event Action? JobChanged; + + /// Progress of a running job (any thread, high frequency). + event Action? Progress; + + /// Node id stamped on jobs run by this PC. + string WorkerId { get; } + + /// Concurrent workers of the local engine; 0 when it runs no handler yet. + int Workers { get; } + + /// Kinds this PC can run. + IReadOnlyCollection Kinds { get; } + + Task> ListAsync(string? cursor, int limit, CancellationToken ct = default); + + Task GetAsync(Guid id, CancellationToken ct = default); + + Task EnqueueAsync(JobKind kind, IReadOnlyList targets, string? targetLabel, JobPriority priority = JobPriority.User, CancellationToken ct = default); + + Task PauseAsync(Guid id); + + /// Resumes a paused job, or retries a failed or cancelled one from its checkpoint. + Task ResumeAsync(Guid id); + + /// Cancels a running or queued job. + Task CancelAsync(Guid id); + + /// Moves a queued job ahead of lower-priority jobs (one priority level up). + Task RaisePriorityAsync(Guid id); +} + +/// over the local and the job table. +public sealed class EngineJobQueue : IJobQueue, IDisposable +{ + private readonly TitanoDatabase _db; + private readonly JobEngine _engine; + private readonly bool _started; + + public EngineJobQueue(TitanoDatabase db, JobEngine engine, bool started) + { + _db = db; + _engine = engine; + _started = started; + _engine.JobChanged += OnJobChanged; + _engine.Progress += OnProgress; + } + + public event Action? JobChanged; + + public event Action? Progress; + + public string WorkerId => _engine.Options.WorkerId; + + public int Workers => _started ? _engine.Options.Workers : 0; + + public IReadOnlyCollection Kinds => _engine.Options.Kinds ?? []; + + public Task> ListAsync(string? cursor, int limit, CancellationToken ct = default) => _db.Jobs.ListAsync(null, limit, cursor, ct); + + public Task GetAsync(Guid id, CancellationToken ct = default) => _db.Jobs.GetAsync(id, ct); + + public Task EnqueueAsync(JobKind kind, IReadOnlyList targets, string? targetLabel, JobPriority priority = JobPriority.User, CancellationToken ct = default) => + _engine.EnqueueAsync(kind, targets, targetLabel, priority: priority, cancellationToken: ct); + + public Task PauseAsync(Guid id) => _engine.PauseAsync(id); + + public Task ResumeAsync(Guid id) => _engine.ResumeAsync(id); + + public Task CancelAsync(Guid id) => _engine.CancelAsync(id); + + public async Task RaisePriorityAsync(Guid id) + { + // JobRepository has no priority update yet; one guarded statement keeps it atomic (queued jobs only). + var session = await _db.Database.OpenAsync(CancellationToken.None); + await using (session) + { + await session.ExecuteAsync( + $"UPDATE jobs SET priority = priority + 1 WHERE id = $1 AND state = {(int)JobState.Queued} AND priority < {(int)JobPriority.User}", + [id], CancellationToken.None); + } + if (await _db.Jobs.GetAsync(id) is { } job) JobChanged?.Invoke(job); + _engine.Wake(); + } + + public void Dispose() + { + _engine.JobChanged -= OnJobChanged; + _engine.Progress -= OnProgress; + } + + private void OnJobChanged(Job job) => JobChanged?.Invoke(job); + + private void OnProgress(JobProgressInfo progress) => Progress?.Invoke(progress); +} diff --git a/src/Titano.App/Jobs/JobRowViewModel.cs b/src/Titano.App/Jobs/JobRowViewModel.cs new file mode 100644 index 00000000..7aed3470 --- /dev/null +++ b/src/Titano.App/Jobs/JobRowViewModel.cs @@ -0,0 +1,133 @@ +using System.Windows.Input; +using Titano.App.Infrastructure; +using Titano.App.Sections; +using Titano.Core.Localization; +using Titano.Core.Model; +using Titano.Ui.Controls; +using Titano.Ui.Mvvm; + +namespace Titano.App.Jobs; + +/// A row action: label, tooltip and command (26-px row buttons, DESIGN §4 tables). +public sealed record JobAction(string Text, string ToolTip, ICommand Command, bool IsDestructive = false); + +/// One row of the Jobs table (Jobs.html): kind, target, progress, speed, left, where, state, actions, log. +public sealed class JobRowViewModel : ObservableObject +{ + private readonly JobActions _actions; + private JobEntry _entry; + private int _queuePosition; + private bool _isExpanded; + private string? _logTail; + + internal JobRowViewModel(JobEntry entry, int queuePosition, JobActions actions) + { + _entry = entry; + _queuePosition = queuePosition; + _actions = actions; + ToggleLogCommand = new RelayCommand(() => IsExpanded = !IsExpanded); + } + + public JobEntry Entry => _entry; + public Guid Id => _entry.Id; + public Job Job => _entry.Job; + + public string Kind => JobText.Kind(_entry.Job.Kind); + + public string Target => _entry.Job.TargetLabel ?? string.Empty; + + /// Progress 0…1 (0 while unknown). + public double Progress => _entry.State == JobState.Done ? 1 : _entry.Fraction ?? 0; + + /// "62 %", "—" while queued or unknown. + public string PercentText => _entry.State == JobState.Done ? Formatting.Percent(1) : _entry.Fraction is { } f && _entry.State != JobState.Queued ? Formatting.Percent(f) : "—"; + + public string SpeedText => _entry.State is JobState.Running or JobState.Done ? Blank(JobText.Speed(_entry.Job.Kind, _entry.ItemsPerSecond)) : "—"; + + public string LeftText => Blank(JobText.Left(_entry, _queuePosition)); + + public string WhereText => _entry.State == JobState.Queued ? Loc.L("Jobs.Where.ThisPc") : Blank(JobText.Where(_entry.Job.NodeId, _actions.WorkerId)); + + public string StateText => JobText.State(_entry); + + /// Glyph and colour of the state (paired with the word, never colour alone). + public StatusKind StateKind => _entry.State switch + { + JobState.Running => StatusKind.Running, + JobState.Queued => StatusKind.Queued, + JobState.Paused => StatusKind.Paused, + JobState.Done => StatusKind.Done, + JobState.Failed => StatusKind.Failed, + _ => StatusKind.Offline, + }; + + /// The error of a failed job, or the state explanation. + public string StateToolTip => _entry.Job.Error is { Length: > 0 } error ? error : Loc.L("Tooltips.Jobs.State." + _entry.State); + + /// Muted text for rows that are not doing anything (queued, history), as in the mockup. + public bool IsDimmed => _entry.State is JobState.Queued or JobState.Done or JobState.Cancelled; + + public bool IsFailed => _entry.State == JobState.Failed; + public bool IsDone => _entry.State == JobState.Done; + + public IReadOnlyList Actions => _actions.For(_entry); + + public ICommand ToggleLogCommand { get; } + + public bool IsExpanded + { + get => _isExpanded; + set + { + if (!Set(ref _isExpanded, value)) return; + OnPropertyChanged(nameof(ToggleToolTip)); + if (value) _ = _actions.LoadLogAsync(this); + } + } + + public string ToggleToolTip => Loc.L(_isExpanded ? "Tooltips.Jobs.HideLog" : "Tooltips.Jobs.ShowLog"); + + /// The last lines of the job log, plus the live message while it runs. + public string LogText + { + get + { + var tail = _logTail ?? _entry.Job.LogTail ?? string.Empty; + if (_entry.State == JobState.Running && _entry.Message is { Length: > 0 } message && !tail.EndsWith(message, StringComparison.Ordinal)) + tail = tail.Length == 0 ? message : tail + "\n" + message; + return tail.Length == 0 ? Loc.L("Jobs.Log.Empty") : tail; + } + } + + internal void SetLog(string? logTail) + { + _logTail = logTail; + OnPropertyChanged(nameof(LogText)); + } + + /// Refreshes the row from the model; returns true when it changed position-relevant data. + internal void Update(JobEntry entry, int queuePosition) + { + var stateChanged = entry.State != _entry.State; + _entry = entry; + _queuePosition = queuePosition; + if (stateChanged) + { + _logTail = null; + OnAllPropertiesChanged(); + if (_isExpanded) _ = _actions.LoadLogAsync(this); + return; + } + OnPropertyChanged(nameof(Progress)); + OnPropertyChanged(nameof(PercentText)); + OnPropertyChanged(nameof(SpeedText)); + OnPropertyChanged(nameof(LeftText)); + OnPropertyChanged(nameof(WhereText)); + OnPropertyChanged(nameof(StateText)); + if (_isExpanded) OnPropertyChanged(nameof(LogText)); + } + + internal void Refresh() => OnAllPropertiesChanged(); + + private static string Blank(string text) => text.Length == 0 ? "—" : text; +} diff --git a/src/Titano.App/Jobs/JobText.cs b/src/Titano.App/Jobs/JobText.cs new file mode 100644 index 00000000..4bec41c4 --- /dev/null +++ b/src/Titano.App/Jobs/JobText.cs @@ -0,0 +1,68 @@ +using Titano.App.Infrastructure; +using Titano.Core.Localization; +using Titano.Core.Model; + +namespace Titano.App.Jobs; + +/// Localized texts of jobs: kind, speed, time left, place in the queue, state (Jobs screen and job bar). +public static class JobText +{ + /// "Render", "Deep analysis", … + public static string Kind(JobKind kind) => Loc.L("Jobs.Kind." + kind); + + /// True for jobs whose items are frames, so their speed reads in fps. + public static bool CountsFrames(JobKind kind) => + kind is JobKind.Render or JobKind.Proxies or JobKind.Thumbs or JobKind.LightAnalyse or JobKind.DeepAnalyse or JobKind.Verify; + + /// "11.3 fps" for frame jobs, "41/s" otherwise; empty when unknown. + public static string Speed(JobKind kind, double? perSecond) => + perSecond is > 0 and var rate + ? Loc.L(CountsFrames(kind) ? "Jobs.Speed.Fps" : "Jobs.Speed.PerSecond", Formatting.Rate(rate)) + : string.Empty; + + /// "1,240 / 3,600"; empty while the total is unknown. + public static string Counter(long done, long total) => + total > 0 ? Loc.L("Jobs.Counter", Formatting.Count(done), Formatting.Count(total)) : string.Empty; + + /// + /// The "Left" column: time left while running, "after n" while queued, the finish time of the history. + /// + public static string Left(JobEntry entry, int queuePosition) => entry.State switch + { + JobState.Running => entry.Eta is { } eta ? Formatting.Duration(eta) : string.Empty, + JobState.Queued => queuePosition > 1 ? Loc.L("Jobs.Left.After", queuePosition - 1) : Loc.L("Jobs.Left.Next"), + _ when entry.Job.Finished is { } finished => Formatting.TimeOfDay(finished), + _ => string.Empty, + }; + + /// State word, with the run time for done jobs ("done · 2:41"). + public static string State(JobEntry entry) + { + var word = Loc.L("Jobs.State." + entry.State); + return entry.State == JobState.Done && entry.Job is { Started: { } started, Finished: { } finished } + ? Loc.L("Jobs.State.WithDetail", word, Formatting.Elapsed(finished - started)) + : word; + } + + /// Where the job runs: "this PC" for this machine's workers, the node name otherwise. + public static string Where(string? nodeId, string localWorkerId) + { + if (string.IsNullOrEmpty(nodeId)) return string.Empty; + var hash = nodeId.IndexOf('#', StringComparison.Ordinal); + var name = hash < 0 ? nodeId : nodeId[..hash]; + return name.Equals(localWorkerId, StringComparison.OrdinalIgnoreCase) ? Loc.L("Jobs.Where.ThisPc") : name; + } + + /// + /// Job bar line (DESIGN §4): "Render · Harbour sunset · 2,232 / 3,600 · 11.3 fps · 2 min left". + /// + public static string Bar(JobEntry entry) + { + var parts = new List(5) { Kind(entry.Job.Kind) }; + if (!string.IsNullOrWhiteSpace(entry.Job.TargetLabel)) parts.Add(entry.Job.TargetLabel!); + if (Counter(entry.Done, entry.Total) is { Length: > 0 } counter) parts.Add(counter); + if (Speed(entry.Job.Kind, entry.ItemsPerSecond) is { Length: > 0 } speed) parts.Add(speed); + if (entry.Eta is { } eta) parts.Add(Loc.L("Jobs.Bar.Left", Formatting.Duration(eta))); + return string.Join(" · ", parts); + } +} diff --git a/src/Titano.App/Jobs/JobUpdateBuffer.cs b/src/Titano.App/Jobs/JobUpdateBuffer.cs new file mode 100644 index 00000000..a5b471a5 --- /dev/null +++ b/src/Titano.App/Jobs/JobUpdateBuffer.cs @@ -0,0 +1,143 @@ +using Titano.Core.Model; +using Titano.Data.Jobs; + +namespace Titano.App.Jobs; + +/// +/// Collects job events from worker threads and hands them to the UI in batches: per job only the newest snapshot +/// and the newest progress survive, so a handler reporting thousands of times per second costs the UI one update per +/// flush. Thread-safe. +/// +public sealed class JobUpdateBuffer +{ + private readonly Lock _gate = new(); + private Dictionary _jobs = []; + private Dictionary _progress = []; + private long _posted; + + /// Events accepted since creation (diagnostics, tests). + public long Posted => Interlocked.Read(ref _posted); + + /// Records a state change; true when the buffer was empty (the caller schedules a flush). + public bool Post(Job job) + { + lock (_gate) + { + var wasEmpty = IsEmptyLocked; + _jobs[job.Id] = job; + // A newer snapshot supersedes progress reported before it. + _progress.Remove(job.Id); + _posted++; + return wasEmpty; + } + } + + /// Records progress; true when the buffer was empty (the caller schedules a flush). + public bool Post(JobProgressInfo progress) + { + lock (_gate) + { + var wasEmpty = IsEmptyLocked; + _progress[progress.JobId] = progress; + _posted++; + return wasEmpty; + } + } + + public bool IsEmpty + { + get + { + lock (_gate) return IsEmptyLocked; + } + } + + /// Takes everything collected since the last drain (snapshots first, then progress). + public (IReadOnlyCollection Jobs, IReadOnlyCollection Progress) Drain() + { + lock (_gate) + { + var jobs = _jobs; + var progress = _progress; + _jobs = []; + _progress = []; + return (jobs.Values, progress.Values); + } + } + + private bool IsEmptyLocked => _jobs.Count == 0 && _progress.Count == 0; +} + +/// +/// Runs an action on a synchronization context at most once per interval, however often it is signalled from any +/// thread: the first signal after a flush schedules the next flush for interval after the previous one +/// (the job list refreshes at about 10 Hz). +/// +public sealed class CoalescingThrottle : IDisposable +{ + private readonly TimeSpan _interval; + private readonly SynchronizationContext? _context; + private readonly Action _flush; + private readonly Func _now; + private readonly Timer _timer; + private readonly Lock _gate = new(); + private long _lastFlush = long.MinValue; + private bool _scheduled; + private bool _disposed; + + /// Minimum time between two flushes. + /// Where runs (the UI); null runs it on the timer thread. + /// The batched work. + /// Milliseconds clock for tests; defaults to the high-resolution . + public CoalescingThrottle(TimeSpan interval, SynchronizationContext? context, Action flush, Func? clock = null) + { + _interval = interval; + _context = context; + _flush = flush; + _now = clock ?? (() => System.Diagnostics.Stopwatch.GetTimestamp() * 1000 / System.Diagnostics.Stopwatch.Frequency); + _timer = new Timer(_ => Dispatch(), null, Timeout.Infinite, Timeout.Infinite); + } + + /// Flushes performed (tests). + public int Flushes { get; private set; } + + /// Asks for a flush; coalesced with every other signal until it runs. + public void Signal() + { + lock (_gate) + { + if (_scheduled || _disposed) return; + _scheduled = true; + var wait = _lastFlush == long.MinValue ? 0 : (long)_interval.TotalMilliseconds - (_now() - _lastFlush); + if (wait <= 0) wait = 0; + _timer.Change(wait, Timeout.Infinite); + } + } + + public void Dispose() + { + lock (_gate) + { + _disposed = true; + _timer.Dispose(); + } + } + + private void Dispatch() + { + if (_context is null) Run(); + else _context.Post(_ => Run(), null); + } + + private void Run() + { + lock (_gate) + { + if (_disposed) return; + _scheduled = false; + _lastFlush = _now(); + Flushes++; + } + _flush(); + } +} diff --git a/src/Titano.App/Library/FilterOption.cs b/src/Titano.App/Library/FilterOption.cs new file mode 100644 index 00000000..81c0425d --- /dev/null +++ b/src/Titano.App/Library/FilterOption.cs @@ -0,0 +1,10 @@ +namespace Titano.App.Library; + +/// +/// One entry of a toolbar dropdown: in the open list, in the closed box +/// (the filter's name while nothing is chosen, e.g. "Year", the chosen value otherwise). +/// +public sealed record FilterOption(T Value, string Label, string BoxText, bool IsAny = false) +{ + public override string ToString() => Label; +} diff --git a/src/Titano.App/Library/LibraryFilter.cs b/src/Titano.App/Library/LibraryFilter.cs new file mode 100644 index 00000000..c0d64493 --- /dev/null +++ b/src/Titano.App/Library/LibraryFilter.cs @@ -0,0 +1,65 @@ +using Titano.Core.Model; +using Titano.Data.Repositories; + +namespace Titano.App.Library; + +/// Status choices of the Library toolbar; each maps onto status flags the index can filter on. +public enum StatusFilter +{ + Any, + Analysed, + NotAnalysed, + Proxies, + NoProxies, + Verified, + NotVerified, + Warnings, +} + +/// Library filters (search, year, camera, status, tag) and sort; immutable so a page request can carry it. +public sealed record LibraryFilter +{ + public string? Text { get; init; } + public int? Year { get; init; } + public string? Camera { get; init; } + public StatusFilter Status { get; init; } + public string? Tag { get; init; } + public SequenceSort Sort { get; init; } = SequenceSort.Newest; + + /// No filter narrows the list (the sort may differ): an empty result means an empty library. + public bool IsUnfiltered => string.IsNullOrWhiteSpace(Text) && Year is null && Camera is null && Status == StatusFilter.Any && Tag is null; + + /// The same sort without filters ("Clear filters"). + public LibraryFilter Cleared() => new() { Sort = Sort }; + + /// The repository query for one page. + public SequenceQuery ToQuery(int limit, string? cursor) + { + var (with, without) = Flags(Status); + return new SequenceQuery + { + Text = string.IsNullOrWhiteSpace(Text) ? null : Text.Trim(), + Year = Year, + Camera = Camera, + Tag = Tag, + WithStatus = with, + WithoutStatus = without, + Sort = Sort, + Limit = limit, + Cursor = cursor, + }; + } + + /// Flags that must be set and clear for a status choice. + public static (SequenceStatus With, SequenceStatus Without) Flags(StatusFilter status) => status switch + { + StatusFilter.Analysed => (SequenceStatus.AnalyzedLight, SequenceStatus.None), + StatusFilter.NotAnalysed => (SequenceStatus.None, SequenceStatus.AnalyzedLight), + StatusFilter.Proxies => (SequenceStatus.ProxiesBuilt, SequenceStatus.None), + StatusFilter.NoProxies => (SequenceStatus.None, SequenceStatus.ProxiesBuilt), + StatusFilter.Verified => (SequenceStatus.Verified, SequenceStatus.None), + StatusFilter.NotVerified => (SequenceStatus.None, SequenceStatus.Verified), + StatusFilter.Warnings => (SequenceStatus.HasWarnings, SequenceStatus.None), + _ => (SequenceStatus.None, SequenceStatus.None), + }; +} diff --git a/src/Titano.App/Library/LibraryPager.cs b/src/Titano.App/Library/LibraryPager.cs new file mode 100644 index 00000000..7995f47c --- /dev/null +++ b/src/Titano.App/Library/LibraryPager.cs @@ -0,0 +1,102 @@ +using Titano.Core.Model; +using Titano.Data.Repositories; + +namespace Titano.App.Library; + +/// A page of the Library list. pages replace the list, the others append to it. +public sealed record LibraryPage(int Generation, IReadOnlyList Items, bool IsFirst, bool HasMore); + +/// +/// Keyset paging of the Library (BRIEF §5: pagination on (first_capture, id)): the first page after a filter +/// change, then the next page whenever the view scrolls near the end. A filter change cancels the page in flight +/// and every result of an older filter is dropped, so stale rows never reach the list. Not thread-safe: call from +/// one thread (the UI). +/// +public sealed class LibraryPager(Func>> fetch, int pageSize = LibraryPager.DefaultPageSize) +{ + public const int DefaultPageSize = 200; + + private CancellationTokenSource _cancellation = new(); + private Task>? _pending; + private string? _cursor; + + public int PageSize { get; } = Math.Clamp(pageSize, 1, 1000); + + public LibraryFilter Filter { get; private set; } = new(); + + /// Incremented by every ; pages carry the generation they belong to. + public int Generation { get; private set; } + + /// More rows exist after the loaded ones. + public bool HasMore { get; private set; } + + public bool IsLoading => _pending is not null; + + /// Rows delivered for the current filter. + public int Loaded { get; private set; } + + /// Starts over with ; null when a newer reset superseded this one. + public Task ResetAsync(LibraryFilter filter) + { + _cancellation.Cancel(); + _cancellation.Dispose(); + _cancellation = new CancellationTokenSource(); + _pending = null; + Generation++; + Filter = filter; + _cursor = null; + Loaded = 0; + HasMore = true; + return LoadAsync(first: true); + } + + /// The next page; null when everything is loaded, a page is already loading, or the filter changed meanwhile. + public Task LoadMoreAsync() + { + if (_pending is not null || !HasMore || Generation == 0) return Task.FromResult(null); + return LoadAsync(first: false); + } + + /// Stops the page in flight (screen closed). + public void Cancel() + { + _cancellation.Cancel(); + _pending = null; + } + + private async Task LoadAsync(bool first) + { + var generation = Generation; + var cancellation = _cancellation; + var pending = fetch(Filter.ToQuery(PageSize, _cursor), cancellation.Token); + _pending = pending; + Page page; + try + { + page = await pending; + } + catch (OperationCanceledException) when (cancellation.IsCancellationRequested) + { + return null; + } + catch (Exception) when (generation != Generation) + { + return null; + } + catch + { + // A failing page stops the scroll-driven loading until the next reset instead of retrying on every scroll. + HasMore = false; + throw; + } + finally + { + if (ReferenceEquals(_pending, pending)) _pending = null; + } + if (generation != Generation || cancellation.IsCancellationRequested) return null; + _cursor = page.NextCursor; + HasMore = page.NextCursor is not null; + Loaded += page.Items.Count; + return new LibraryPage(generation, page.Items, first, HasMore); + } +} diff --git a/src/Titano.App/Library/SequenceItem.cs b/src/Titano.App/Library/SequenceItem.cs new file mode 100644 index 00000000..f1ed8d64 --- /dev/null +++ b/src/Titano.App/Library/SequenceItem.cs @@ -0,0 +1,179 @@ +using System.Windows.Media; +using Titano.App.Infrastructure; +using Titano.Core.Diagnostics; +using Titano.Core.Localization; +using Titano.Core.Model; +using Titano.Core.Naming; +using Titano.Ui.Controls; +using Titano.Ui.Mvvm; +using Titano.Ui.Visuals; + +namespace Titano.App.Library; + +/// One sequence of the Library grid and list (BRIEF §12.2). +public sealed class SequenceItem : ObservableObject +{ + private readonly ThumbnailService? _thumbnails; + private Sequence _sequence; + private ImageSource? _thumbnail; + private IThumbnailSource? _scrub; + private CancellationTokenSource? _loading; + private int _requestedWidth; + private bool _isSelected; + private bool _isAnalysing; + + public SequenceItem(Sequence sequence, ThumbnailService? thumbnails) + { + _sequence = sequence; + _thumbnails = thumbnails; + } + + public Sequence Sequence => _sequence; + public Guid Id => _sequence.Id; + + /// User title or "{date} {camera}". + public string Title => _sequence.DisplayTitle; + + /// "Canon EOS R5" (brand not repeated). + public string Camera => PathTemplate.CameraName(_sequence.CameraMake, _sequence.CameraModel); + + /// Card line: count · camera · span. + public string Subtitle => string.Join(" · ", new[] { FramesText, Camera, SpanText }.Where(s => s.Length > 0)); + + public string FramesText => Formatting.Count(_sequence.FrameCount); + + /// First capture date (camera clock). + public string DateText => _sequence.FirstCapture is { } first ? Formatting.Date(first) : string.Empty; + + /// Time from first to last capture. + public string SpanText => _sequence is { FirstCapture: { } a, LastCapture: { } b } && b > a ? Formatting.Duration(b - a) : string.Empty; + + public string IntervalText => _sequence.MedianInterval is > 0 and var s ? Loc.L("Library.Interval", s.ToString(s < 10 ? "0.#" : "0", Loc.Culture)) : string.Empty; + + public string SizeText => Formatting.Bytes(_sequence.TotalBytes); + + public string TagsText => string.Join(", ", _sequence.Tags); + + /// Status glyphs of the card and the list (DESIGN §4: glyph + word, never colour alone). + public IReadOnlyList Statuses => BuildStatuses(_sequence, _isAnalysing); + + /// The single most relevant status for the list's State column. + public CardStatus PrimaryStatus => Statuses.FirstOrDefault(s => s.Kind is StatusKind.Error or StatusKind.Warning or StatusKind.Analysing) + ?? Statuses[0]; + + public ImageSource? Thumbnail + { + get => _thumbnail; + private set => Set(ref _thumbnail, value); + } + + /// Frames for hover scrubbing; created on first use. + public IThumbnailSource? ScrubSource => _thumbnails is null || _sequence.FrameCount == 0 ? null : _scrub ??= _thumbnails.ScrubSource(_sequence); + + public bool IsSelected + { + get => _isSelected; + set => Set(ref _isSelected, value); + } + + /// An analysis job runs on this sequence ("◐ Analysing"). + public bool IsAnalysing + { + get => _isAnalysing; + set + { + if (Set(ref _isAnalysing, value)) RaiseStatuses(); + } + } + + /// Replaces the row with a fresher copy of the same sequence. + public void Update(Sequence sequence) + { + var heroChanged = sequence.HeroFrameId != _sequence.HeroFrameId || sequence.FrameCount != _sequence.FrameCount; + _sequence = sequence; + if (heroChanged) + { + _scrub = null; + if (_requestedWidth > 0) RequestThumbnail(_requestedWidth, force: true); + } + OnAllPropertiesChanged(); + } + + /// The card or row became visible: load the hero thumbnail (once per width). + public void RequestThumbnail(int pixelWidth, bool force = false) + { + if (_thumbnails is null || pixelWidth <= 0) return; + if (!force && _thumbnail is not null && pixelWidth <= _requestedWidth) return; + if (!force && _loading is not null && pixelWidth <= _requestedWidth) return; + _requestedWidth = pixelWidth; + _loading?.Cancel(); + var cancellation = new CancellationTokenSource(); + _loading = cancellation; + _ = LoadAsync(pixelWidth, cancellation); + } + + /// The card left the screen (recycled): stop its load. + public void ReleaseThumbnail() + { + _loading?.Cancel(); + _loading = null; + if (_thumbnail is null) _requestedWidth = 0; + } + + private async Task LoadAsync(int pixelWidth, CancellationTokenSource cancellation) + { + try + { + var image = await _thumbnails!.HeroAsync(_sequence, pixelWidth, cancellation.Token); + if (!cancellation.IsCancellationRequested) Thumbnail = image; + } + catch (OperationCanceledException) + { + } + catch (Exception ex) + { + Log.Warning("library", $"Thumbnail of {_sequence.Id} failed", ex); + } + finally + { + if (ReferenceEquals(_loading, cancellation)) _loading = null; + cancellation.Dispose(); + } + } + + private void RaiseStatuses() + { + OnPropertyChanged(nameof(Statuses)); + OnPropertyChanged(nameof(PrimaryStatus)); + } + + /// Card status row: analysed, proxies, renders, sync, warnings (Main.html). + public static IReadOnlyList BuildStatuses(Sequence s, bool analysing) + { + var list = new List(5); + if (analysing) list.Add(new CardStatus(StatusKind.Analysing, Loc.L("Library.Status.Analysing"), Loc.L("Tooltips.Library.Status.Analysing"))); + else if ((s.Status & SequenceStatus.AnalyzedLight) != 0) list.Add(new CardStatus(StatusKind.Analysed, Loc.L("Library.Status.Analysed"), Loc.L("Tooltips.Library.Status.Analysed"))); + else list.Add(new CardStatus(StatusKind.NotAnalysed, Loc.L("Library.Status.Analysed"), Loc.L("Tooltips.Library.Status.NotAnalysed"))); + + if (s.Origin == SequenceOrigin.Server && s.SyncState == SyncState.RemoteOnly) + { + list.Add(new CardStatus(StatusKind.Remote, Loc.L("Library.Status.Remote"), Loc.L("Tooltips.Library.Status.Remote"))); + } + else + { + list.Add((s.Status & SequenceStatus.ProxiesBuilt) != 0 + ? new CardStatus(StatusKind.Proxies, Loc.L("Library.Status.Proxies"), Loc.L("Tooltips.Library.Status.Proxies")) + : new CardStatus(StatusKind.NoProxies, Loc.L("Library.Status.Proxies"), Loc.L("Tooltips.Library.Status.NoProxies"))); + } + + if (s.RenderedCount > 0) + list.Add(new CardStatus(StatusKind.Rendered, Formatting.Count(s.RenderedCount), Loc.Plural("Tooltips.Library.Status.Rendered", s.RenderedCount))); + if (s.SyncState == SyncState.InSync) + list.Add(new CardStatus(StatusKind.Synced, Loc.L("Library.Status.Synced"), Loc.L("Tooltips.Library.Status.Synced"))); + if ((s.Status & SequenceStatus.HasErrors) != 0) + list.Add(new CardStatus(StatusKind.Error, Formatting.Count(Math.Max(1, s.WarningCount)), Loc.L("Tooltips.Library.Status.Errors"))); + else if (s.WarningCount > 0 || (s.Status & SequenceStatus.HasWarnings) != 0) + list.Add(new CardStatus(StatusKind.Warning, Formatting.Count(Math.Max(1, s.WarningCount)), Loc.Plural("Tooltips.Library.Status.Warnings", Math.Max(1, s.WarningCount)))); + return list; + } +} diff --git a/src/Titano.App/Library/ThumbnailCache.cs b/src/Titano.App/Library/ThumbnailCache.cs new file mode 100644 index 00000000..e6030b9d --- /dev/null +++ b/src/Titano.App/Library/ThumbnailCache.cs @@ -0,0 +1,152 @@ +using Titano.Ui.Visuals; + +namespace Titano.App.Library; + +/// +/// Decoded thumbnails in a least-recently-used cache, with loads shared between requests for the same key. A load +/// runs off the calling thread, at most maxConcurrentLoads at once; it is cancelled as soon as every request +/// waiting for it is cancelled (the card scrolled away), so the decoder never works for rows nobody sees. Results, +/// including "no thumbnail" (null), are cached; failures are not. +/// +public sealed class ThumbnailCache : IDisposable + where TKey : notnull + where TImage : class +{ + private readonly LruCache _cache; + private readonly Dictionary _loading = []; + private readonly Func> _load; + private readonly SemaphoreSlim _slots; + private readonly Lock _gate = new(); + + public ThumbnailCache(int capacity, Func> load, int maxConcurrentLoads = 4) + { + ArgumentOutOfRangeException.ThrowIfLessThan(maxConcurrentLoads, 1); + _cache = new LruCache(capacity); + _load = load; + _slots = new SemaphoreSlim(maxConcurrentLoads, maxConcurrentLoads); + } + + /// Cached entries. + public int Count + { + get + { + lock (_gate) return _cache.Count; + } + } + + /// Maximum cached entries; lowering it evicts the least recently used at once. + public int Capacity + { + get + { + lock (_gate) return _cache.Capacity; + } + set + { + lock (_gate) _cache.Capacity = value; + } + } + + /// Loads started and not yet finished or cancelled. + public int PendingLoads + { + get + { + lock (_gate) return _loading.Count; + } + } + + /// The cached image without loading; true also for a cached "no thumbnail". + public bool TryGet(TKey key, out TImage? image) + { + lock (_gate) return _cache.TryGet(key, out image); + } + + /// The image for , from the cache or a (shared) load. + /// was cancelled. + public async Task GetAsync(TKey key, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + Load load; + lock (_gate) + { + if (_cache.TryGet(key, out var cached)) return cached; + if (!_loading.TryGetValue(key, out load!)) + { + load = new Load(); + _loading[key] = load; + load.Task = Task.Run(() => RunAsync(key, load), CancellationToken.None); + } + load.Waiters++; + } + try + { + return await load.Task.WaitAsync(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) + { + lock (_gate) + { + if (--load.Waiters == 0 && !load.Task.IsCompleted) + { + load.Cancellation.Cancel(); + if (_loading.TryGetValue(key, out var current) && ReferenceEquals(current, load)) _loading.Remove(key); + } + } + throw; + } + } + + /// Forgets every cached image (loads in flight complete normally). + public void Clear() + { + lock (_gate) _cache.Clear(); + } + + public void Dispose() + { + lock (_gate) + { + foreach (var load in _loading.Values) load.Cancellation.Cancel(); + _loading.Clear(); + _cache.Clear(); + } + } + + private async Task RunAsync(TKey key, Load load) + { + var token = load.Cancellation.Token; + try + { + await _slots.WaitAsync(token).ConfigureAwait(false); + try + { + var image = await _load(key, token).ConfigureAwait(false); + lock (_gate) + { + if (!token.IsCancellationRequested) _cache.Set(key, image); + } + return image; + } + finally + { + _slots.Release(); + } + } + finally + { + lock (_gate) + { + if (_loading.TryGetValue(key, out var current) && ReferenceEquals(current, load)) _loading.Remove(key); + } + } + } + + private sealed class Load + { + public CancellationTokenSource Cancellation { get; } = new(); + public Task Task { get; set; } = null!; + public int Waiters { get; set; } + } +} diff --git a/src/Titano.App/Library/ThumbnailLoading.cs b/src/Titano.App/Library/ThumbnailLoading.cs new file mode 100644 index 00000000..828849dd --- /dev/null +++ b/src/Titano.App/Library/ThumbnailLoading.cs @@ -0,0 +1,52 @@ +using System.Windows; +using System.Windows.Media; + +namespace Titano.App.Library; + +/// +/// Attached behaviour of the card template: requests the hero thumbnail when a card shows a sequence and cancels +/// it when the card is recycled for another sequence or leaves the tree (scrolled away). +/// +public static class ThumbnailLoading +{ + /// Width of the thumbnail in device-independent pixels; 0 disables loading. + public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached( + "Width", typeof(double), typeof(ThumbnailLoading), new PropertyMetadata(0.0, OnWidthChanged)); + + public static double GetWidth(DependencyObject d) => (double)d.GetValue(WidthProperty); + + public static void SetWidth(DependencyObject d, double value) => d.SetValue(WidthProperty, value); + + private static void OnWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is not FrameworkElement element) return; + element.DataContextChanged -= OnDataContextChanged; + element.Loaded -= OnLoaded; + element.Unloaded -= OnUnloaded; + if ((double)e.NewValue <= 0) return; + element.DataContextChanged += OnDataContextChanged; + element.Loaded += OnLoaded; + element.Unloaded += OnUnloaded; + Request(element); + } + + private static void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + if (e.OldValue is SequenceItem old) old.ReleaseThumbnail(); + Request((FrameworkElement)sender); + } + + private static void OnLoaded(object sender, RoutedEventArgs e) => Request((FrameworkElement)sender); + + private static void OnUnloaded(object sender, RoutedEventArgs e) + { + if (((FrameworkElement)sender).DataContext is SequenceItem item) item.ReleaseThumbnail(); + } + + private static void Request(FrameworkElement element) + { + if (element.DataContext is not SequenceItem item || !element.IsLoaded) return; + var scale = VisualTreeHelper.GetDpi(element).DpiScaleX; + item.RequestThumbnail((int)Math.Ceiling(GetWidth(element) * scale)); + } +} diff --git a/src/Titano.App/Library/ThumbnailService.cs b/src/Titano.App/Library/ThumbnailService.cs new file mode 100644 index 00000000..50630c90 --- /dev/null +++ b/src/Titano.App/Library/ThumbnailService.cs @@ -0,0 +1,209 @@ +using System.Collections.Concurrent; +using System.IO; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Titano.Core.Diagnostics; +using Titano.Core.Model; +using Titano.Data; +using Titano.Ui.Visuals; + +namespace Titano.App.Library; + +/// A thumbnail request: one frame at a width bucket (so nearby sizes share a decode). +public readonly record struct ThumbnailKey(Guid FrameId, int Width); + +/// +/// Library thumbnails (BRIEF §8.5): a frame's embedded preview, read straight from its offset/length in the +/// original and decoded by WIC at the requested width (falling back to decoding the original), turned upright, +/// frozen and kept in an LRU cache. Loads run off the UI thread and stop when the card scrolls away. +/// +public sealed class ThumbnailService : IDisposable +{ + /// Embedded previews larger than this are not read (a damaged index would make us read gigabytes). + private const long MaxPreviewBytes = 64L << 20; + + private const int WidthStep = 64; + + private readonly TitanoDatabase _db; + private readonly ThumbnailCache _cache; + private readonly ConcurrentDictionary _archiveRoots = new(); + private readonly ConcurrentDictionary _firstFrames = new(); + private int _requests; + + public ThumbnailService(TitanoDatabase db, int capacity) + { + _db = db; + _cache = new ThumbnailCache(Math.Max(16, capacity), LoadAsync, maxConcurrentLoads: Math.Clamp(Environment.ProcessorCount / 2, 2, 6)); + } + + public int Count => _cache.Count; + + /// Thumbnail requests in flight, index lookups included (capture and tests wait for them). + public int PendingLoads => Math.Max(Volatile.Read(ref _requests), _cache.PendingLoads); + + /// Maximum thumbnails kept in memory (Settings › Storage). + public int Capacity + { + get => _cache.Capacity; + set => _cache.Capacity = Math.Max(16, value); + } + + /// The hero thumbnail of a sequence: its hero frame, or the first frame. + public async Task HeroAsync(Sequence sequence, int pixelWidth, CancellationToken ct) + { + Interlocked.Increment(ref _requests); + try + { + var frameId = sequence.HeroFrameId ?? await FirstFrameAsync(sequence.Id, ct).ConfigureAwait(false); + return frameId is { } id ? await _cache.GetAsync(Key(id, pixelWidth), ct).ConfigureAwait(false) : null; + } + finally + { + Interlocked.Decrement(ref _requests); + } + } + + /// A frame of a sequence by index (hover scrubbing). + public async Task FrameAsync(Guid sequenceId, int index, int pixelWidth, CancellationToken ct) + { + Interlocked.Increment(ref _requests); + try + { + var frames = await _db.Frames.ListBySequenceAsync(sequenceId, index - 1, 1, ct).ConfigureAwait(false); + return frames.Count == 0 ? null : await _cache.GetAsync(Key(frames[0].Id, pixelWidth), ct).ConfigureAwait(false); + } + finally + { + Interlocked.Decrement(ref _requests); + } + } + + /// Hover-scrub frames of a sequence, sampled to at most positions. + public IThumbnailSource ScrubSource(Sequence sequence, int positions = 120) => new ScrubFrames(this, sequence, positions); + + /// Drops decoded thumbnails (Settings › Storage › Clear). + public void Clear() + { + _cache.Clear(); + _archiveRoots.Clear(); + _firstFrames.Clear(); + } + + public void Dispose() => _cache.Dispose(); + + private static ThumbnailKey Key(Guid frameId, int pixelWidth) => + new(frameId, Math.Clamp((pixelWidth + WidthStep - 1) / WidthStep * WidthStep, WidthStep, 2048)); + + private async Task FirstFrameAsync(Guid sequenceId, CancellationToken ct) + { + if (_firstFrames.TryGetValue(sequenceId, out var cached)) return cached; + var frames = await _db.Frames.ListBySequenceAsync(sequenceId, -1, 1, ct).ConfigureAwait(false); + var id = frames.Count > 0 ? frames[0].Id : (Guid?)null; + _firstFrames[sequenceId] = id; + return id; + } + + private async Task ArchiveRootAsync(Guid sequenceId, CancellationToken ct) + { + var sequence = await _db.Sequences.GetAsync(sequenceId, ct).ConfigureAwait(false); + if (sequence is null) return null; + if (_archiveRoots.TryGetValue(sequence.ArchiveId, out var root)) return root; + root = (await _db.Archives.GetAsync(sequence.ArchiveId, ct).ConfigureAwait(false))?.RootPath; + _archiveRoots[sequence.ArchiveId] = root; + return root; + } + + private async Task LoadAsync(ThumbnailKey key, CancellationToken ct) + { + var frame = await _db.Frames.GetAsync(key.FrameId, ct).ConfigureAwait(false); + if (frame is null) return null; + var root = await ArchiveRootAsync(frame.SequenceId, ct).ConfigureAwait(false); + if (root is null) return null; + var path = Path.Combine(root, frame.RelativePath.Replace('/', Path.DirectorySeparatorChar)); + ct.ThrowIfCancellationRequested(); + try + { + return Decode(path, frame, key.Width, ct); + } + catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or NotSupportedException or FileFormatException or ArgumentException or InvalidOperationException) + { + Log.Debug("thumbs", $"No thumbnail for {path}: {ex.Message}"); + return null; + } + } + + /// The embedded preview when the index knows it, otherwise the original, decoded at . + internal static BitmapSource? Decode(string path, Frame frame, int width, CancellationToken ct) + { + if (!File.Exists(path)) return null; + if (frame.PreviewOffset is > 0 and var offset && frame.PreviewLength is > 0 and <= MaxPreviewBytes and var length) + { + var bytes = new byte[length]; + using (var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 4096, FileOptions.RandomAccess)) + { + if (offset + length <= file.Length) + { + file.Seek(offset, SeekOrigin.Begin); + file.ReadExactly(bytes); + ct.ThrowIfCancellationRequested(); + try + { + using var memory = new MemoryStream(bytes, writable: false); + return DecodeStream(memory, frame.Orientation, width); + } + catch (Exception ex) when (ex is NotSupportedException or FileFormatException or ArgumentException) + { + // A broken preview falls through to the original. + } + } + } + } + ct.ThrowIfCancellationRequested(); + using var original = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1 << 16, FileOptions.SequentialScan); + return DecodeStream(original, frame.Orientation, width); + } + + /// WIC decode with scaling during decode (JPEG DCT scaling), then the Exif orientation; frozen for any thread. + internal static BitmapSource DecodeStream(Stream stream, int orientation, int width) + { + var turned = orientation is 5 or 6 or 7 or 8; + var image = new BitmapImage(); + image.BeginInit(); + image.CacheOption = BitmapCacheOption.OnLoad; + image.CreateOptions = BitmapCreateOptions.IgnoreColorProfile; + if (turned) image.DecodePixelHeight = width; + else image.DecodePixelWidth = width; + image.StreamSource = stream; + image.EndInit(); + BitmapSource result = image; + if (orientation is > 1 and <= 8) + { + var transform = new TransformGroup(); + if (orientation is 2 or 4 or 5 or 7) transform.Children.Add(new ScaleTransform(-1, 1)); + var angle = orientation switch + { + 3 or 4 => 180, + 5 or 6 => 90, + 7 or 8 => 270, + _ => 0, + }; + if (angle != 0) transform.Children.Add(new RotateTransform(angle)); + result = new TransformedBitmap(image, transform); + } + result.Freeze(); + return result; + } + + /// Evenly spaced frames of one sequence for hover scrubbing. + private sealed class ScrubFrames(ThumbnailService owner, Sequence sequence, int positions) : IThumbnailSource + { + public int Count { get; } = Math.Clamp(Math.Min(sequence.FrameCount, positions), 0, positions); + + public async ValueTask GetAsync(int index, int pixelWidth, CancellationToken cancellationToken) + { + if (Count <= 1) return await owner.HeroAsync(sequence, pixelWidth, cancellationToken).ConfigureAwait(false); + var frameIndex = (int)Math.Round(index * (sequence.FrameCount - 1) / (double)(Count - 1)); + return await owner.FrameAsync(sequence.Id, frameIndex, pixelWidth, cancellationToken).ConfigureAwait(false); + } + } +} diff --git a/src/Titano.App/Sections/AboutView.xaml b/src/Titano.App/Sections/AboutView.xaml new file mode 100644 index 00000000..30236370 --- /dev/null +++ b/src/Titano.App/Sections/AboutView.xaml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +