mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 13:44:12 +00:00
refactor(report): finish via playback, one file per run
Uses the Finish the app already has, and stops rewriting the whole history every time a show ends. - The Go button already reads "Finish" on the last event and calls stop (playbackControl.utils). Closing the run hangs off that instead of a second Finish button of its own, so POST /report/runs/finish and the button in the overview are both gone. The run indicator stays as the way the feature is found, now a passive status that opens the reports panel. - Reports move from one file per project to a directory per project with one file per run. Finishing a show wrote the entire history back to disk, which grew with every show ever recorded; it now writes only the run that just ended. Deleting a run unlinks one file and deleting a project removes one directory. - A report that cannot be read is skipped instead of taking the rest of the history with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019nr3FbLbM8gB8Jm771YgTV
This commit is contained in:
@@ -60,14 +60,6 @@ export async function fetchOpenRun(options?: RequestOptions): Promise<OpenRun |
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP request to finish the run in progress, which is what writes it to history
|
||||
*/
|
||||
export async function finishRun(): Promise<void> {
|
||||
await axios.post(`${reportUrl}/runs/finish`);
|
||||
await ontimeQueryClient.invalidateQueries({ queryKey: REPORT });
|
||||
}
|
||||
|
||||
export async function renameRun(id: string, label: string): Promise<ShowRun> {
|
||||
const res = await axios.patch(`${reportUrl}/runs/${id}`, { label });
|
||||
await ontimeQueryClient.invalidateQueries({ queryKey: REPORT });
|
||||
|
||||
Reference in New Issue
Block a user