Files
emby-tui-client/src/main.rs
T
janisslsmandClaude Opus 4.7 af43b21f5d Initial commit: Emby TUI client with libmpv playback
A ratatui-based terminal browser for an Emby server with mpv as the player
backend. Authenticates via /Users/AuthenticateByName, lists libraries and
items, streams via /Videos/{id}/stream, and reports playback progress so
"Continue Watching" stays in sync across clients.

Credentials are read in priority order: CLI flags, env vars
(EMBY_SERVER/EMBY_USER/EMBY_PASSWORD), ./config.toml or
$XDG_CONFIG_HOME/emby-client/config.toml, then an in-TUI login prompt with
an option to persist to config.toml.

Modules: config (CLI + TOML loader), login (TUI prompt), emby (HTTP client
+ progress Reporter), player (libmpv2 wrapper, blocks until file ends),
app (browse state, Continue Watching virtual entry), ui (ratatui frontend).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-16 21:38:22 +03:00

29 lines
573 B
Rust

mod app;
mod config;
mod emby;
mod login;
mod player;
mod ui;
use anyhow::Result;
use clap::Parser;
#[tokio::main]
async fn main() -> Result<()> {
let args = config::CliArgs::parse();
let (cfg, save_target) = config::load(&args)?;
let cfg = match cfg {
Some(c) => c,
None => {
// Interactive credential prompt in the TUI
login::prompt(save_target.as_deref())?
}
};
let client = emby::Client::new(&cfg).await?;
let mut app = app::App::new(client).await?;
ui::run(&mut app).await?;
Ok(())
}