Add basic album list

This commit is contained in:
2026-06-05 17:31:18 +02:00
parent e1a5a733c1
commit 493a689d75
8 changed files with 201 additions and 43 deletions

View File

@@ -10,7 +10,7 @@ use image::{
DynamicImage, EncodableLayout,
codecs::webp::{WebPDecoder, WebPEncoder},
};
use immich_sdk::{AssetId, AssetVisibility};
use immich_sdk::{AlbumResponse, AssetId, AssetVisibility};
use slint::{Rgba8Pixel, SharedPixelBuffer};
use crate::{
@@ -180,7 +180,7 @@ impl Api {
.buckets()
.execute()
.await
.context(anyhow!("Failed to fetch list of time buckets",))
.context(anyhow!("Failed to fetch list of time buckets"))
.inspect_err(|e| {
tracing::error!("{e:?}");
})?;
@@ -267,4 +267,19 @@ impl Api {
.await
.context(anyhow!("Failed to fetch asset {asset_id:?}"))
}
pub async fn get_album_list(&self) -> anyhow::Result<Vec<AlbumResponse>> {
let albums = self
.client
.albums()
.list()
.execute()
.await
.context(anyhow!("Failed to fetch album list"))
.inspect_err(|e| {
tracing::error!("{e:?}");
})?;
Ok(albums)
}
}