From fdb6603b5e2072ad178c7c0c3aff4356b4b64635 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Thu, 11 Feb 2021 20:10:38 -0800 Subject: [PATCH] also cleanup "Recording .. missing playback row" --- server/db/check.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/db/check.rs b/server/db/check.rs index db9292b..e6b96f5 100644 --- a/server/db/check.rs +++ b/server/db/check.rs @@ -425,6 +425,12 @@ fn compare_stream(conn: &rusqlite::Connection, dir_id: i32, stream_id: i32, opts None => { error!("Recording {} missing playback row: {:#?}", id, recording); printed_error = true; + if opts.trash_orphan_sample_files { + ctx.files_to_trash.insert((dir_id, id)); + } + if opts.delete_orphan_rows { // also delete recording/integrity rows, if any. + ctx.rows_to_delete.insert(id); + } }, } match recording.file {