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]>
29 lines
573 B
Rust
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(())
|
|
}
|