Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -10,7 +10,7 @@ authors = ["Luke Berndt <lukekb@gmail.com>"]
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"
Expand Down
4 changes: 2 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn answer(status: u16, text: &str) -> Result<String, Attempt> {
/// files keep their real times.
fn metadata(c: &ConcludedCall, concluded: Option<i64>) -> (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;
Expand Down Expand Up @@ -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);
Expand Down
Loading