From c3513589473a1ad80bdd5f770a77a93748ea5996 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 28 May 2026 02:45:16 -0400 Subject: [PATCH] chore: log more stuff around rendering to debug --- src/command/render.rs | 10 +++++----- src/recording_data/between.rs | 3 ++- src/render_data.rs | 17 +++++++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/command/render.rs b/src/command/render.rs index 11a49e4..773ddd4 100644 --- a/src/command/render.rs +++ b/src/command/render.rs @@ -377,11 +377,11 @@ pub async fn handle(state: State, interaction: Interaction) { samples: composite, }; - state - .render_manager - .write(&render, render_data) - .await - .expect("TODO"); + let render_result = state.render_manager.write(&render, render_data).await; + + tracing::info!(?render_result); + + render_result.expect("TODO"); tracing::info!(%render, "written"); diff --git a/src/recording_data/between.rs b/src/recording_data/between.rs index e8d1452..539f2df 100644 --- a/src/recording_data/between.rs +++ b/src/recording_data/between.rs @@ -144,7 +144,8 @@ impl RecordingManager { microsecond_end = 999_999; } - let microseconds = microsecond_start..=microsecond_end; + let microseconds = + microsecond_start..=microsecond_end; let microsecond = clip.microsecond; if !microseconds.contains(µsecond) { diff --git a/src/render_data.rs b/src/render_data.rs index 2516776..c0ac44f 100644 --- a/src/render_data.rs +++ b/src/render_data.rs @@ -2,19 +2,12 @@ use std::{convert::Infallible, fmt::Display}; use opendal::Operator; use opus2::Application; -use songbird::driver::SampleRate; -use time::{ - UtcDateTime, - format_description::{self, StaticFormatDescription}, - macros::format_description, -}; +use time::{UtcDateTime, format_description::StaticFormatDescription, macros::format_description}; use twilight_model::id::{ Id, marker::{ChannelMarker, GuildMarker}, }; -use crate::{AudioChannels, AudioSampleRate}; - #[derive(Debug, Clone)] pub struct RenderManager { operator: Operator, @@ -78,11 +71,15 @@ impl RenderManager { let mut encoder = opus2::Encoder::new(sample_rate, channels, Application::Audio).expect("TODO"); - encoder.encode(&samples, &mut bytes).expect("TODO"); + let encode_result = encoder.encode(&samples, &mut bytes); + tracing::info!(?encode_result); + encode_result.expect("TODO"); let path = render.to_string(); - self.operator.write(&path, bytes).await.expect("TODO"); + let write_result = self.operator.write(&path, bytes).await; + tracing::info!(?write_result); + write_result.expect("TODO"); Ok(()) }