feat(immich): add Immich self-hosted import support
Adds an ImmichClient for Android to connect to a self-hosted Immich server, fetch albums and assets, and import selected images locally. API keys are encrypted with Android Keystore and stored securely. The plugin now exposes connect, disconnect and import actions and is documented for Immich import usage. - Encrypted Immich API keys with Android Keystore - Exposed connect, disconnect and import actions in the plugin - Updated docs and metadata to reflect Immich import flow
This commit is contained in:
@@ -69,3 +69,45 @@ pub(crate) async fn set_interval<R: Runtime>(app: AppHandle<R>, minutes: usize)
|
||||
pub(crate) async fn next_wallpaper<R: Runtime>(app: AppHandle<R>) -> Result<WallpaperState> {
|
||||
app.wallpaper().next_wallpaper()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn get_immich_connection<R: Runtime>(app: AppHandle<R>) -> Result<ImmichConnection> {
|
||||
app.wallpaper().get_immich_connection()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn connect_immich<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
server_url: String,
|
||||
api_key: String,
|
||||
) -> Result<ImmichConnection> {
|
||||
app.wallpaper().connect_immich(ImmichConnectRequest { server_url, api_key })
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn disconnect_immich<R: Runtime>(app: AppHandle<R>) -> Result<ImmichConnection> {
|
||||
app.wallpaper().disconnect_immich()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn get_immich_albums<R: Runtime>(app: AppHandle<R>) -> Result<ImmichAlbumsResponse> {
|
||||
app.wallpaper().get_immich_albums()
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn get_immich_assets<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
album_id: Option<String>,
|
||||
page: usize,
|
||||
size: usize,
|
||||
) -> Result<ImmichAssetsPage> {
|
||||
app.wallpaper().get_immich_assets(ImmichAssetsRequest { album_id, page, size })
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn import_immich_assets<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
ids: Vec<String>,
|
||||
) -> Result<WallpaperState> {
|
||||
app.wallpaper().import_immich_assets(ImmichImportRequest { ids })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user