Commit Graph
6 Commits
Author SHA1 Message Date
Alby96 9ae773aa5a fix(server): keep Reorganize dry runs for the confirm, test the protocol's key paths
An all:true dry run reads every sidecar and photo folder of the archive inside
the request, and the confirm planned the whole archive again before answering
202. The server now keeps each dry run's plan for five minutes (eight plans at
most) by archive, selection, templates and a stamp of the archive's index rows:
the same dry run again and its confirmation take the kept plan, and any change
the index records (an upload, an edit, a move, a scan, a verify) gives another
stamp and a new plan. A change made on disk alone is not in the stamp; the move
job still plans again and refuses a plan that no longer matches.

Server tests now cover an all:true apply around a sequence already in place, a
real plan_changed after an upload, a move job paused between two sequences and
resumed, archive_offline, job_unavailable, more than 1,000 ids and the kept
plans themselves; a Data test covers the index stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 71bb53fbf8eb7d0327ea692d046634b12f8d37e9)
2026-10-27 16:30:00 +01:00
Alby96 eb2395d9b0 feat(archive): reorganize existing sequences with folder, file and title templates
Owner review 2, R7 asks for renaming and moving after import, on the web panel and the
desktop. This is the engine and the server API both UIs build on.

- FrameNaming (Core/Naming) is the one naming context and unique-name rule of a frame:
  imports, uploads and Reorganize now produce identical names (behaviour of the ingest and
  the import planner unchanged).
- RenamePlanner takes a file template: each step counts its renamed frames, shows the first
  three and the frames version they were planned at, and lists what keeps its name (photos
  in place outside originals/, never hashed, missing, unreadable sidecar). Names are given
  in index order with _2, _3 as filing does; XMP companions follow their photo.
- MassRenamer renames a step's files under the same leases after its folder moved, checks
  the frames version, journals .chronos/rename-files.json and moves files in two phases
  through temporary names so chains and swaps never meet; then sidecar, index
  (FrameRepository.RenameFilesAsync, both dialects) and journal. A failure puts every file
  back; a crash is completed by the next writer or the plan's resume, the index following.
  Plans a paused or cancelled job holds are left to that job.
- JobKind.Move gets MoveJobHandler: it plans again and applies only the confirmed plan
  (fingerprint and frames versions), with progress and checkpoints per sequence.
- POST /api/v1/archive/reorganize: dry run with the plan and its fingerprint, otherwise a
  202 move job; validated templates, audited, sequenceChanged reorganized events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit aae1c3eb18ea932b4a6251c5e2a282b9295a5785)
2026-10-27 14:03:36 +01:00
Alby96 aa1d4913a3 feat(admin): Library pages on the web panel (owner review 2, R6)
The web panel now manages the library without editing it: the owner can
browse and view sequences and photos, delete sequences and photos into the
archive's trash, restore or empty the trash and run mass operations, as
R6 asks, on top of the engine endpoints of the previous commit.

- Library page right after the Dashboard: search, Year/Camera/Status/Tag
  filters fed by a new GET /api/v1/sequences/facets, sort, cards or list
  (remembered per browser), lazy cover thumbnails, Load more by cursor,
  multi-select with Shift ranges and "Select all N" of the filter, and a
  sticky bar for the selection: Analyse, Proxies, Thumbnails, Verify,
  Tags (add/remove), Export CSV (client-side) and Delete (dry run, list
  of what moves to the trash, then the move). Filters live in the address,
  so Back from a sequence finds them again.
- Sequence view (#/library?id=): inline title, tags, rating and notes,
  facts, photos in pages of 500 with content-visibility, a photo viewer
  (proxy, arrows, Esc, Exif facts), Set cover, Download original, Delete
  photos (typing the count above 20 photos), Delete sequence, renders to
  download. No video editing controls.
- Trash view (#/library?view=trash, also linked from Archive): entries,
  Restore, and Empty (dry run, list, the localised word typed, the plan's
  fingerprint sent back, the job followed to its end).
- Live updates from sequenceChanged and jobState; keyboard grid (one tab
  stop, arrows, Space, Shift+Space, Enter, Ctrl+A, Esc); RTL, dark theme.
- GET /sequences takes rendered=true|false for the Status filter.
- ui.js: confirmDialog's typed confirmation by name, word or count, with a
  list of what the action concerns; formDialog. api.js: putBytes for the
  web upload, which the Library imports on demand (upload.js, optional).
- New web icons from icons.py (Image for the Library, trash, grid/list,
  arrows, stars, cover); directional glyphs mirror in right-to-left pages.
- Strings in en and it; tests for the facets (both dialects), the rendered
  filter, the menu, the modules and the on-demand upload import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 029cf334f66cb6fa1265b96a6f8faff2964c11ea)
2026-10-27 10:51:04 +01:00
Alby96 75daab7275 feat(server): scheduled jobs on the server and a Scheduled tab in the admin panel
Owner review 2, R10: nothing may run out of sight, so every timer the server
ran becomes a system schedule the admin panel shows and manages, and
administrators create their own.

- SchedulerHost runs the shared Scheduler on the job engine (started after
  JobEngineHost, stopped before it); ServerScheduleHost gives it the
  container's time zone (UTC with a warning when TZ is unknown), the archive
  refreshed from archive.json at every run (what ArchivePolling did), the
  clean-up steps and the system schedules: archive-scan every 10 minutes
  (no catch-up, also run once at start like the polling), upload-cleanup
  every 30 minutes, index-backup at 03:00 (SQLite only), housekeeping (job
  history) at 04:00 and audit-cleanup at 04:30.
- ArchivePolling and DatabaseBackupService are gone; UploadMaintenance only
  recovers commits at start, its sweep is the "uploads" clean-up step.
- /api/v1/schedules (ManageArchive, audited): list with actions and time
  zone, create, PUT/PATCH, delete (409 schedule_system), run now (409
  schedule_pending), reset (409 schedule_no_defaults), runs paged by cursor;
  invalid fields are 400 invalid_schedule naming the field.
- CHRONOS_AUDIT_RETENTION_DAYS (AuditRetentionDays, default 365) seeds the
  audit clean-up; set by the environment it is applied at every start and
  locked. Job history leaves Settings: it is the housekeeping schedule's age
  limit, and the setting is what a reset restores.
- Admin panel: Jobs has Queue and Scheduled tabs; schedules with when (in
  the panel's language and the server's zone), next run, last result, a
  switch, Run now, Edit, Delete or Reset, their runs linking to the jobs, and
  a side panel for the action, recurrence and parameters; job rows a
  schedule queued carry a Scheduled pill. Strings in en and it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 808ce94ae29e3bf4522cb4d40dfd76d4f8529c64)
2026-10-27 02:25:01 +01:00
Alby96 e5508e7e69 feat(data): scheduler engine, schedules table and housekeeping jobs
Owner review 2, R10: every timer that queues work becomes a visible schedule,
so the server and the desktop need one shared engine to run them.

- Migration 0007: schedules table (system rows keyed by system_key) and
  jobs.schedule_id; Job.ScheduleId, JobDto.ScheduleId, JobRepository
  HasPendingAsync / ListPendingTargetsAsync / ListByScheduleAsync.
- ScheduleRepository: seeding that keeps user edits, reset, compare-and-set
  claim of a run (one winner across processes), outcomes.
- Scheduling: in-house recurrence (every/daily/weekly/monthly, DST gap moves
  forward, ambiguous time runs once), ScheduleActions resolving scan, verify,
  thumbnails, proxies, analysis, maintenance, backup, cleanup, duplicates and
  orphans into archive jobs, IScheduleHost, and the Scheduler loop (catch-up,
  clock going back, run now, CRUD as API v1 DTOs).
- New job kinds Backup (16) and Cleanup (17) with handlers, shared clean-up
  steps (job history, audit log, trash report that never deletes) and host
  steps through ArchiveServiceOptions; read-only Duplicates and Orphans report
  handlers, so the server can run those kinds too.
- JobEngine no longer purges history at start: the housekeeping schedule's
  job-history step does; JobEngine.CanRun and an EnqueueAsync with scheduleId.
- Protocol DTOs for schedules; job kind names in en and it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit eb0edd2483a493db7c6945d5b494461cabb2a4ad)
2026-10-27 02:08:11 +01:00
Alby96andClaude Opus 5.5 f2b58522b9 refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted
Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control,
and asked for Actions and a first automatic release with the server package
and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md).

- Chronos everywhere: a byte-exact rename of contents and paths, then a
  per-language review of the forms the old name's ending had dictated.
- Gitea instead of GitHub: the update check, licence, issue and support
  links read ChronosReleasesUrl; the update check takes the highest stable
  version, offers a pre-release build its final release and reports a
  repository it cannot see as a failed check. EULA, security policy and
  Gitea issue forms live at the repository root.
- Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release,
  nightly image and performance gates in the .NET SDK container with git
  checkout and the system SQLite. The release cross-compiles the Windows
  programs, checks their icon, version and DPI manifest, packs installers
  and zips, publishes the Gitea release and pushes the server image
  (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows
  runner (WINDOWS_RUNNER).
- New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the
  docker-exec script, which Gitea's service containers do not allow; the
  throw-away server runs without durability) and pe-check.
- Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR,
  3 on the shared runner; the weekly performance gates keep theirs).

BREAKING CHANGE: programs, settings, data folders, file types, environment
variables and the Docker image use the new name; nothing is migrated from
Titano, which never had a release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-10-23 12:45:18 +02:00