1mod app;
6mod event;
7mod handlers;
8pub mod helpers;
9pub mod hooks;
10pub mod image_loader;
11mod screens;
12mod theme;
13pub mod types;
14mod ui;
15mod widgets;
16
17pub use app::App;
18
19use crate::config::Config;
20use anyhow::Result;
21use ratatui_image::picker::Picker;
22
23pub fn run(config: Config) -> Result<()> {
25 let picker = if config.album_art_mode.is_off() {
29 None
30 } else {
31 match Picker::from_query_stdio() {
32 Ok(p) => Some(p),
33 Err(e) => {
34 tracing::debug!("Terminal image protocol detection failed: {e}");
35 None
36 }
37 }
38 };
39
40 let theme = theme::Theme::from_name(&config.theme);
41 let app = App::new(config, theme, picker)?;
42 event::run_event_loop(app)
43}