Adds Immich image prefetch and a mobile data option to the UI. Android now ships ImmichPrefetchWorker to fetch originals in the background. Frontend and desktop code are updated to expose and persist new settings. Translations cover the new labels and hints in multiple languages. - Introduce ImmichPrefetchWorker for background prefetch - Add allowMobileData and prefetchImmich UI controls - Wire changes to desktop state and translations
164 lines
4.0 KiB
Rust
164 lines
4.0 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct WallpaperState {
|
|
pub image_count: usize,
|
|
pub enabled: bool,
|
|
pub interval_minutes: i32,
|
|
pub shuffle: bool,
|
|
pub lock_screen_only: bool,
|
|
pub allow_mobile_data: bool,
|
|
pub prefetch_immich: bool,
|
|
pub current_index: usize,
|
|
pub current_id: Option<String>,
|
|
pub image_ids: Vec<String>,
|
|
pub image_urls: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct SettingRequest {
|
|
pub name: String,
|
|
pub value: bool,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct IntervalRequest {
|
|
pub minutes: i32,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct GalleryRequest {
|
|
pub offset: usize,
|
|
pub limit: usize,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct DeleteImageRequest {
|
|
pub id: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ApplyWallpaperRequest {
|
|
pub id: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct DeleteImagesRequest {
|
|
pub ids: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImageIdsResponse {
|
|
pub ids: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImageCropRequest {
|
|
pub id: String,
|
|
pub mode: String,
|
|
pub zoom: f64,
|
|
pub position_x: f64,
|
|
pub position_y: f64,
|
|
pub rotation: i32,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct GalleryImage {
|
|
pub id: String,
|
|
pub url: String,
|
|
pub selected: bool,
|
|
pub crop_mode: String,
|
|
pub crop_zoom: f64,
|
|
pub crop_position_x: f64,
|
|
pub crop_position_y: f64,
|
|
pub crop_rotation: i32,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct GalleryPage {
|
|
pub total: usize,
|
|
pub items: Vec<GalleryImage>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichConnectRequest {
|
|
pub server_url: String,
|
|
pub api_key: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichConnection {
|
|
pub configured: bool,
|
|
pub server_url: String,
|
|
pub user_name: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichAlbum {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub asset_count: usize,
|
|
pub thumbnail_url: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichAlbumsResponse {
|
|
pub albums: Vec<ImmichAlbum>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichAssetsRequest {
|
|
pub album_id: Option<String>,
|
|
pub page: usize,
|
|
pub size: usize,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichAsset {
|
|
pub id: String,
|
|
pub file_name: String,
|
|
pub thumbnail_url: String,
|
|
pub taken_at: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichAssetsPage {
|
|
pub items: Vec<ImmichAsset>,
|
|
pub page: usize,
|
|
pub has_more: bool,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichImportRequest {
|
|
pub ids: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct ImmichImportProgress {
|
|
pub active: bool,
|
|
pub completed: usize,
|
|
pub total: usize,
|
|
pub bytes_downloaded: u64,
|
|
pub bytes_total: u64,
|
|
}
|