feat(import-progress): track and expose Immich import progress
This change introduces a cross-language import progress API for Immich imports and exposes a new query command to report live progress. A new ImportProgress model captures active state, totals, and bytes downloaded, allowing consuming code to display import status to users. - Adds ImportProgress data type and progress tracking during import - Exposes get_immich_import_progress command in Android and Rust - Updates permissions and schemas to include allow-get-immich-import-progress
This commit is contained in:
@@ -51,6 +51,14 @@ export type ImmichAssetsPage = {
|
||||
hasMore: boolean;
|
||||
};
|
||||
|
||||
export type ImmichImportProgress = {
|
||||
active: boolean;
|
||||
completed: number;
|
||||
total: number;
|
||||
bytesDownloaded: number;
|
||||
bytesTotal: number;
|
||||
};
|
||||
|
||||
const demoState: WallpaperState = {
|
||||
imageCount: 3,
|
||||
enabled: true,
|
||||
@@ -191,3 +199,8 @@ export async function importImmichAssets(ids: string[]): Promise<WallpaperState>
|
||||
if (inTauri()) return invoke<WallpaperState>("plugin:wallpaper|import_immich_assets", { ids });
|
||||
return { ...demoState, imageUrls: [...demoState.imageUrls] };
|
||||
}
|
||||
|
||||
export async function getImmichImportProgress(): Promise<ImmichImportProgress> {
|
||||
if (inTauri()) return invoke<ImmichImportProgress>("plugin:wallpaper|get_immich_import_progress");
|
||||
return { active: false, completed: 0, total: 0, bytesDownloaded: 0, bytesTotal: 0 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user