Remove exportService indirection
This commit is contained in:
parent
ea34eebfc9
commit
3824ebe91a
2 changed files with 7 additions and 6 deletions
|
@ -1141,12 +1141,12 @@ class ExportService {
|
|||
file,
|
||||
);
|
||||
try {
|
||||
await ensureElectron().saveStreamToDisk(
|
||||
await electron.saveStreamToDisk(
|
||||
`${collectionExportPath}/${videoExportName}`,
|
||||
videoStream,
|
||||
);
|
||||
} catch (e) {
|
||||
await ensureElectron().deleteFile(
|
||||
await electron.deleteFile(
|
||||
`${collectionExportPath}/${imageExportName}`,
|
||||
);
|
||||
throw e;
|
||||
|
|
|
@ -246,10 +246,10 @@ async function migrateFiles(
|
|||
const newFilePath = `${collectionPath}/${newFileName}`;
|
||||
const newFileMetadataPath = `${metadataPath}/${newFileName}.json`;
|
||||
|
||||
if (!(await exportService.exists(oldFilePath))) continue;
|
||||
if (!(await fs.exists(oldFilePath))) continue;
|
||||
|
||||
await exportService.rename(oldFilePath, newFilePath);
|
||||
await exportService.rename(oldFileMetadataPath, newFileMetadataPath);
|
||||
await fs.rename(oldFilePath, newFilePath);
|
||||
await fs.rename(oldFileMetadataPath, newFileMetadataPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -409,6 +409,7 @@ async function removeCollectionExportMissingMetadataFolder(
|
|||
exportDir: string,
|
||||
exportRecord: ExportRecord,
|
||||
) {
|
||||
const fs = ensureElectron().fs;
|
||||
if (!exportRecord?.collectionExportNames) {
|
||||
return;
|
||||
}
|
||||
|
@ -422,7 +423,7 @@ async function removeCollectionExportMissingMetadataFolder(
|
|||
collectionExportName,
|
||||
] of properlyExportedCollectionsAll) {
|
||||
if (
|
||||
await exportService.exists(
|
||||
await fs.exists(
|
||||
getMetadataFolderExportPath(
|
||||
`${exportDir}/${collectionExportName}`,
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue