feat: rename orbits; snapshots and downloads show the orbit's current name

PUT /api/v1/orbits/:id changes only the name (admin, validated, case-insensitively unique, audited).
Snapshot metadata is immutable, so the list and the download file name look the orbit up by id and
fall back to the written name only when the orbit is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 15:01:49 +07:00
parent c6dd52c700
commit f52fc1930f
7 changed files with 240 additions and 4 deletions

View File

@@ -116,8 +116,14 @@ async fn download(
.schedule
.map(|s| s.timezone)
});
let orbit_name = state
.db
.orbit_names()
.ok()
.and_then(|names| names.get(&snapshot.manifest.orbit_id).cloned())
.unwrap_or_else(|| snapshot.manifest.orbit_name.clone());
let file_name = exports::download_name(
&snapshot.manifest.orbit_name,
&orbit_name,
snapshot.taken_at,
zone.as_deref(),
snapshot