mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:06:56 -04:00
add todos
This commit is contained in:
parent
5c9ef5c6fd
commit
8e130a6e3e
@ -190,6 +190,8 @@ describe('checkForDuplicates', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: this shouldn't return empty arrays, this should return an error
|
||||||
|
// Failed duplicate checks should be a reason for panic instead of ignoring
|
||||||
it('returns results when check duplicates retry is failed', async () => {
|
it('returns results when check duplicates retry is failed', async () => {
|
||||||
vi.mocked(checkBulkUpload).mockRejectedValue(new Error('Network error'));
|
vi.mocked(checkBulkUpload).mockRejectedValue(new Error('Network error'));
|
||||||
|
|
||||||
|
@ -122,7 +122,10 @@ export const checkForDuplicates = async (files: string[], { concurrency, skipHas
|
|||||||
const newFiles: string[] = [];
|
const newFiles: string[] = [];
|
||||||
const duplicates: Asset[] = [];
|
const duplicates: Asset[] = [];
|
||||||
|
|
||||||
|
// TODO: Retry 3 times if there is an error
|
||||||
|
try {
|
||||||
const response = await checkBulkUpload({ assetBulkUploadCheckDto: { assets: results } });
|
const response = await checkBulkUpload({ assetBulkUploadCheckDto: { assets: results } });
|
||||||
|
|
||||||
for (const { id: filepath, assetId, action } of response.results) {
|
for (const { id: filepath, assetId, action } of response.results) {
|
||||||
if (action === Action.Accept) {
|
if (action === Action.Accept) {
|
||||||
newFiles.push(filepath);
|
newFiles.push(filepath);
|
||||||
@ -131,6 +134,9 @@ export const checkForDuplicates = async (files: string[], { concurrency, skipHas
|
|||||||
duplicates.push({ id: assetId as string, filepath });
|
duplicates.push({ id: assetId as string, filepath });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
throw new Error(`An error occurred while checking for duplicates: ${error.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
progressBar.stop();
|
progressBar.stop();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user