feat(wallpapers): add Immich integration with caching and rotation

This patch adds Immich integration for remote images with local
caching and pruning.
It adds image rotation to the crop flow and stores rotation
with the crop state.
It adds progress tracking and size checks during image
download to avoid oversized assets.

- Add Immich caching with size limits and automatic pruning
- Extend crop handling to support rotation and persist it
- Improve download progress and error messaging
This commit is contained in:
2026-08-21 22:01:42 +02:00
parent 789b58398a
commit e494b17117
11 changed files with 343 additions and 137 deletions
+2
View File
@@ -44,6 +44,7 @@ pub(crate) async fn set_image_crop<R: Runtime>(
zoom: f64,
position_x: f64,
position_y: f64,
rotation: i32,
) -> Result<GalleryImage> {
app.wallpaper().set_image_crop(ImageCropRequest {
id,
@@ -51,6 +52,7 @@ pub(crate) async fn set_image_crop<R: Runtime>(
zoom,
position_x,
position_y,
rotation,
})
}
#[command]
+2
View File
@@ -47,6 +47,7 @@ impl<R: Runtime> Wallpaper<R> {
crop_zoom: 1.0,
crop_position_x: 0.5,
crop_position_y: 0.5,
crop_rotation: 0,
})
.collect();
Ok(GalleryPage { total: 3, items })
@@ -77,6 +78,7 @@ impl<R: Runtime> Wallpaper<R> {
crop_zoom: payload.zoom,
crop_position_x: payload.position_x,
crop_position_y: payload.position_y,
crop_rotation: payload.rotation,
})
}
pub fn set_setting(&self, payload: SettingRequest) -> crate::Result<WallpaperState> {
+2
View File
@@ -58,6 +58,7 @@ pub struct ImageCropRequest {
pub zoom: f64,
pub position_x: f64,
pub position_y: f64,
pub rotation: i32,
}
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
@@ -70,6 +71,7 @@ pub struct GalleryImage {
pub crop_zoom: f64,
pub crop_position_x: f64,
pub crop_position_y: f64,
pub crop_rotation: i32,
}
#[derive(Debug, Clone, Default, Deserialize, Serialize)]