From 0d2d58b2f59fc101b8d2ac3a831f78577975d26f Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Sun, 18 Oct 2026 11:45:58 -0400 Subject: [PATCH] 0.1.6: trunk-recorder-plugin 0.5.0, for Trunk Recorder Pro v0.2.0 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 6 ++++++ Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- src/upload.rs | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7506dd..9e7b9f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.1.6] + +- Built with trunk-recorder-plugin 0.5.0, for Trunk Recorder Pro v0.2.0: systems are numbered + from 0 there, conventional ones too, and the call record names every field the recorder writes + (the call's length in ms is read from it directly). + ## [0.1.5] - A system's sites: Trunk Recorder Pro now has systems with several sites, and a diff --git a/Cargo.lock b/Cargo.lock index 3e377d3..aa32da2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" [[package]] name = "broadcastify" -version = "0.1.5" +version = "0.1.6" dependencies = [ "schemars", "serde", @@ -372,9 +372,9 @@ dependencies = [ [[package]] name = "trunk-recorder-plugin" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "587edb957af1d5bd2cd1a8a0e362419d731d95b78e3ca4181a1494d0f8831753" +checksum = "3a7504b42cca72ec6457beb7ac279f3a4fbe16054f86be57eb1e28a70dd6394d" dependencies = [ "schemars", "serde", diff --git a/Cargo.toml b/Cargo.toml index 78ce176..26079c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "broadcastify" -version = "0.1.5" +version = "0.1.6" edition = "2024" description = "Uploads recorded calls to Broadcastify Calls." license = "GPL-3.0-or-later" @@ -10,7 +10,7 @@ authors = ["Luke Berndt "] publish = false [dependencies] -trunk-recorder-plugin = "0.4.0" +trunk-recorder-plugin = "0.5.0" schemars = "1" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/src/upload.rs b/src/upload.rs index 2628803..7cee098 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -164,7 +164,7 @@ fn answer(status: u16, text: &str) -> Result { /// files keep their real times. fn metadata(c: &ConcludedCall, concluded: Option) -> (Value, i64) { let mut v = serde_json::to_value(&c.call).unwrap_or_default(); - let length_ms = v["call_length_ms"].as_i64().filter(|&l| l > 0).unwrap_or((c.call.call_length * 1000.0).round() as i64); + let length_ms = Some(c.call.call_length_ms).filter(|&l| l > 0).unwrap_or((c.call.call_length * 1000.0).round() as i64); if let Some(end) = concluded.filter(|&t| t > 0 && length_ms > 0) { let stop_ms = end * 1000; let start_ms = stop_ms - length_ms; @@ -220,7 +220,7 @@ mod tests { let mut c = ConcludedCall::default(); c.call.call_length = 4.0; assert_eq!(metadata(&c, None).1, 4000); - c.call.extra.insert("call_length_ms".into(), json!(4320)); + c.call.call_length_ms = 4320; let (v, ms) = metadata(&c, Some(1_700_000_010)); assert_eq!(ms, 4320); assert_eq!(v["start_time_ms"], 1_700_000_005_680i64);