diff --git a/Cargo.lock b/Cargo.lock index af8d713..ed93549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1384,9 +1384,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.165" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb4d3d38eab6c5239a362fa8bae48c03baf980a6e7079f063942d563ef3533e" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libm" @@ -3536,9 +3536,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", diff --git a/Dockerfile b/Dockerfile index 540e3b6..afd4c19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN cargo build --release --locked # Release image FROM debian:bullseye-slim -RUN apt-get update && apt-get install -y python3-pip ffmpeg +RUN apt-get update && apt-get install -y python3-pip RUN pip install -U yt-dlp COPY --from=build /app/target/release/ohrwurm . diff --git a/docker-compose.yml b/docker-compose.yml index 4bd6807..d4052d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ services: ohrwurm: container_name: ohrwurm image: jheuel/ohrwurm:latest + # build: . restart: unless-stopped volumes: - ./data:/data diff --git a/src/commands/play.rs b/src/commands/play.rs index 1860222..1faf871 100644 --- a/src/commands/play.rs +++ b/src/commands/play.rs @@ -58,12 +58,18 @@ async fn get_tracks( .output() .await?; + tracing::info!( + "yt-dlp output: {:?}", + String::from_utf8_lossy(&output.stdout) + ); + let reader = BufReader::new(output.stdout.as_slice()); let tracks: Vec = reader .lines() .map_while(Result::ok) .flat_map(|line| serde_json::from_str(&line)) .collect(); + tracing::info!("yt-dlp tracks: {:?}", tracks); if tracks.is_empty() { if let Ok(stderr) = String::from_utf8(output.stderr) { @@ -76,7 +82,7 @@ async fn get_tracks( } return Err("No tracks found".into()); } - tracing::debug!("tracks: {:?}", tracks); + tracing::info!("tracks: {:?}", tracks); Ok(tracks) } @@ -241,6 +247,11 @@ pub(crate) async fn play( state: State, query: String, ) -> Result<(), Box> { + tracing::info!( + "play command in channel {:?} by {:?}", + interaction.channel, + interaction.author(), + ); match play_inner(&interaction, Arc::clone(&state), query).await { Ok(_) => Ok(()), Err(e) => { @@ -267,13 +278,14 @@ pub(crate) async fn play_inner( state: State, query: String, ) -> Result<(), Box> { - debug!( - "play command in channel {:?} by {:?}", + tracing::info!( + "play_inner in channel {:?} by {:?}", interaction.channel, interaction.author(), ); let content = format!("Adding track(s) to the queue: {}", query); + tracing::info!("content: {:?}", content); let embeds = vec![EmbedBuilder::new() .description(content) .color(colors::YELLOW) @@ -308,9 +320,10 @@ pub(crate) async fn play_inner( query }; - debug!("query: {:?}", query); + tracing::info!("query: {:?}", query); let tracks = get_tracks(query).await?; + tracing::info!("got tracks: {:?}", tracks); if tracks.len() > 1 { let first_track = tracks.first().unwrap();