mod app;
mod event;
mod handlers;
pub mod helpers;
pub mod hooks;
pub mod image_loader;
mod screens;
mod theme;
pub mod types;
mod ui;
mod widgets;
pub use app::App;
use crate::config::Config;
use anyhow::Result;
use ratatui_image::picker::Picker;
pub fn run(config: Config) -> Result<()> {
let picker = if config.album_art_mode.is_off() {
None
} else {
match Picker::from_query_stdio() {
Ok(p) => Some(p),
Err(e) => {
tracing::debug!("Terminal image protocol detection failed: {e}");
None
}
}
};
let theme = theme::Theme::from_name(&config.theme);
let app = App::new(config, theme, picker)?;
event::run_event_loop(app)
}