feat: Update typegen enums and the UI

This commit is contained in:
uttarayan21
2025-11-14 12:05:07 +05:30
parent 94105cdb83
commit df06190c14
9 changed files with 61481 additions and 60426 deletions

View File

@@ -1,12 +1,8 @@
mod errors;
mod ui;
use api::{JellyfinClient, JellyfinConfig};
use errors::*;
use gpui::{
App, Application, Bounds, Context, SharedString, Window, WindowBounds, WindowOptions, div,
prelude::*, px, rgb, size,
};
#[tokio::main]
pub async fn main() -> Result<()> {
dotenvy::dotenv()
@@ -22,17 +18,12 @@ pub async fn main() -> Result<()> {
"jello".to_string(),
);
let mut jellyfin = api::JellyfinClient::new(config);
authenticate(&mut jellyfin).await?;
jellyfin
.authenticate_with_cached_token(".session")
.await
.change_context(Error)?;
ui::ui(jellyfin);
Ok(())
}
pub async fn authenticate(client: &mut JellyfinClient) -> Result<()> {
if std::path::PathBuf::from(".session").exists() {
client.load_token(".session").change_context(Error)?;
} else {
client.authenticate().await.change_context(Error)?;
client.save_token(".session").change_context(Error)?;
}
Ok(())
}