diff --git a/src/audio.rs b/src/audio.rs index ae2327f..97d8858 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -4,8 +4,8 @@ use cpal::{Device, Stream, StreamConfig, SampleFormat, SampleRate}; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; use symphonia::core::audio::Signal; -use symphonia::core::codecs::{Decoder, DecoderOptions}; -use symphonia::core::formats::{FormatOptions, FormatReader}; +use symphonia::core::codecs::{DecoderOptions}; +use symphonia::core::formats::{FormatOptions}; use symphonia::core::io::MediaSourceStream; use symphonia::core::meta::MetadataOptions; use symphonia::core::probe::Hint; @@ -22,7 +22,6 @@ pub struct AsioPlayer { volume: f32, } -// Shared audio buffer for streaming struct StreamBuffer { samples: Vec, position: usize, @@ -75,7 +74,6 @@ impl AsioPlayer { } self.forced_sample_rate = Some(sample_rate); - //info!("Forced sample rate set to {} Hz", sample_rate); Ok(()) } @@ -93,10 +91,8 @@ impl AsioPlayer { // Download and decode the audio let (samples, original_sample_rate, channels, duration_ms) = self.download_and_decode(url).await?; - // Set up ASIO stream with proper sample rate self.setup_stream(samples, original_sample_rate, channels)?; - // Store duration self.duration_ms = Some(duration_ms); // Start playing @@ -201,7 +197,7 @@ impl AsioPlayer { self.start_time = Some(Instant::now() - Duration::from_secs_f32(elapsed_secs)); } - if let Some(stream) = &self.stream { + if let Some(_stream) = &self.stream { if buffer.paused { self.paused_position = Some(position); } @@ -353,7 +349,7 @@ impl AsioPlayer { } } } - Err(e) => { + Err(_e) => { //debug!("Decode error: {}", e); break; } diff --git a/src/jellyfin.rs b/src/jellyfin.rs index 8738cd8..63692fd 100644 --- a/src/jellyfin.rs +++ b/src/jellyfin.rs @@ -144,9 +144,7 @@ impl JellyfinClient { self.config.is_authenticated() } - pub fn logout(&mut self) -> Result<()> { - self.config.clear_auth() - } + } impl LibraryItem { diff --git a/src/main.rs b/src/main.rs index 6a49526..8b77629 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ use anyhow::Result; use tracing::info; -use cpal::traits::{HostTrait, DeviceTrait}; use std::io::Write; mod jellyfin; @@ -15,17 +14,14 @@ async fn main() -> Result<()> { info!("Starting Jellyfin ASIO Client"); - // Load config let mut config = config::Config::load()?; // Create Jellyfin client let mut jellyfin = jellyfin::JellyfinClient::new(config.clone()); - // Check if we need to authenticate if !jellyfin.is_authenticated() { println!("No saved session found. Please log in."); - // Get server URL if not set if config.server_url.is_empty() { print!("Enter Jellyfin server URL (e.g., https://jellyfin.example.com): "); std::io::stdout().flush()?; diff --git a/src/tui.rs b/src/tui.rs index d49a045..0ac8a62 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -2,7 +2,7 @@ use anyhow::Result; use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyModifiers}; use crossterm::terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}; use crossterm::ExecutableCommand; -use ratatui::backend::{Backend, CrosstermBackend}; +use ratatui::backend::{CrosstermBackend}; use ratatui::layout::{Constraint, Direction, Layout, Rect}; use ratatui::style::{Color, Modifier, Style}; use ratatui::text::{Line, Span, Text}; @@ -12,7 +12,7 @@ use std::io::{self, Stdout}; use std::sync::mpsc::{channel, Receiver, Sender}; use std::time::{Duration, Instant}; use std::thread; -use::tracing::{debug, info}; +use::tracing::{debug}; use crate::jellyfin::{JellyfinClient, LibraryItem}; use crate::player::{Player, PlayerCommand, PlaybackState};