feat: the backup can include the music, sending each library file once to music/ and again only when it changes (#6774)
release / govulncheck (push) Successful in 15s
release / web (push) Failing after 1m17s
release / go (push) Successful in 1m33s
release / integration (push) Successful in 5m16s
release / android (push) Successful in 5m56s
release / Build signed APK (push) Successful in 6m13s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

With "Include the music" on, each night's run sends the library files the
destination doesn't hold yet, after the database file has landed, for up to
six hours; a large library spans several nights the first time. Files keep
their path under the library folders' common root, beside database/ in the
same folder or bucket.

backup_music_files records each file's size and mtime as sent, so a night
sends only new and changed files, and a rescan that touches a track but finds
the same file sends nothing. A changed file goes to its old name; Minstrel
never deletes there. An object the bucket refuses (a locked overwrite) is
kept with its answer and goes again once the file changes or the settings are
saved; three refusals in a row stop the night's music, since that is a key
that may not write under music/. A folder copy is written under a .part name
and renamed, keeping the file's time.

The panel shows how much of the library is in, the refused files, and each
run's music count and note. The verdict still turns on the database file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 15:26:20 -05:00
co-authored by Claude Opus 5.5
parent ff5ee755f2
commit 967763f6ce
18 changed files with 1100 additions and 24 deletions
+21
View File
@@ -1104,6 +1104,8 @@ export type BackupConfig = {
run_hour: number;
/** KiB a second an upload to the bucket may use; 0 is no limit. */
upload_limit_kib: number;
/** Also send the library's music files, each once, to music/. */
include_music: boolean;
};
export type BackupState = 'off' | 'incomplete' | 'failing' | 'waiting' | 'overdue' | 'ok';
@@ -1118,6 +1120,23 @@ export type BackupRun = {
location: string;
bytes: number;
error: string;
/** What the run sent of the music, and why it stopped early, if it did. */
music_files: number;
music_bytes: number;
music_note: string;
};
/** A library file the destination wouldn't take; tried again once it changes. */
export type BackupRefusedFile = { path: string; error: string; at: string };
/** How much of the library the backup holds as it is now. */
export type BackupMusicProgress = {
total_files: number;
total_bytes: number;
sent_files: number;
sent_bytes: number;
refused_files: number;
refused: BackupRefusedFile[];
};
export type BackupStatus = {
@@ -1132,6 +1151,8 @@ export type BackupStatus = {
/** The longest a run may take; the panel stops polling a little after. */
run_limit_seconds: number;
runs: BackupRun[];
/** Present when the backup includes the music. */
music: BackupMusicProgress | null;
};
/** A save or test. An empty secret_key keeps the stored one. */