Inline 1
This commit is contained in:
parent
f7e961e86b
commit
ca114a467d
4 changed files with 9 additions and 19 deletions
|
@ -27,7 +27,6 @@ import {
|
|||
import {
|
||||
convertCollectionIDExportNameObjectToMap,
|
||||
convertFileIDExportNameObjectToMap,
|
||||
getCollectionExportPath,
|
||||
getCollectionExportedFiles,
|
||||
getCollectionIDFromFileUID,
|
||||
getDeletedExportedCollections,
|
||||
|
@ -1219,3 +1218,8 @@ class ExportService {
|
|||
};
|
||||
}
|
||||
export default new ExportService();
|
||||
|
||||
const getCollectionExportPath = (
|
||||
exportFolder: string,
|
||||
collectionExportName: string,
|
||||
) => `${exportFolder}/${collectionExportName}`;
|
||||
|
|
|
@ -22,7 +22,6 @@ import {
|
|||
import { EnteFile } from "types/file";
|
||||
import { getNonEmptyPersonalCollections } from "utils/collection";
|
||||
import {
|
||||
getCollectionExportPath,
|
||||
getCollectionIDFromFileUID,
|
||||
getExportRecordFileUID,
|
||||
getLivePhotoExportName,
|
||||
|
@ -433,7 +432,7 @@ async function removeCollectionExportMissingMetadataFolder(
|
|||
if (
|
||||
await exportService.exists(
|
||||
getMetadataFolderExportPath(
|
||||
getCollectionExportPath(exportDir, collectionExportName),
|
||||
`${exportDir}/${collectionExportName}`,
|
||||
),
|
||||
)
|
||||
) {
|
||||
|
|
|
@ -42,10 +42,7 @@ import {
|
|||
import { EnteFile } from "types/file";
|
||||
import { SetFilesDownloadProgressAttributes } from "types/gallery";
|
||||
import { SUB_TYPE, VISIBILITY_STATE } from "types/magicMetadata";
|
||||
import {
|
||||
getCollectionExportPath,
|
||||
getUniqueCollectionExportName,
|
||||
} from "utils/export";
|
||||
import { getUniqueCollectionExportName } from "utils/export";
|
||||
import { downloadFilesWithProgress } from "utils/file";
|
||||
import { isArchivedCollection, updateMagicMetadata } from "utils/magicMetadata";
|
||||
|
||||
|
@ -176,10 +173,7 @@ async function createCollectionDownloadFolder(
|
|||
downloadDirPath,
|
||||
collectionName,
|
||||
);
|
||||
const collectionDownloadPath = getCollectionExportPath(
|
||||
downloadDirPath,
|
||||
collectionDownloadName,
|
||||
);
|
||||
const collectionDownloadPath = `${downloadDirPath}/${collectionDownloadName}`;
|
||||
await exportService.checkExistsAndCreateDir(collectionDownloadPath);
|
||||
return collectionDownloadPath;
|
||||
}
|
||||
|
|
|
@ -200,9 +200,7 @@ export const getUniqueCollectionExportName = async (
|
|||
let collectionExportName = sanitizeName(collectionName);
|
||||
let count = 1;
|
||||
while (
|
||||
(await exportService.exists(
|
||||
getCollectionExportPath(dir, collectionExportName),
|
||||
)) ||
|
||||
(await exportService.exists(`${dir}/${collectionExportName}`)) ||
|
||||
collectionExportName === ENTE_TRASH_FOLDER
|
||||
) {
|
||||
collectionExportName = `${sanitizeName(collectionName)}(${count})`;
|
||||
|
@ -241,11 +239,6 @@ export const getFileMetadataExportPath = (
|
|||
fileExportName: string,
|
||||
) => `${collectionExportPath}/${ENTE_METADATA_FOLDER}/${fileExportName}.json`;
|
||||
|
||||
export const getCollectionExportPath = (
|
||||
exportFolder: string,
|
||||
collectionExportName: string,
|
||||
) => `${exportFolder}/${collectionExportName}`;
|
||||
|
||||
export const getFileExportPath = (
|
||||
collectionExportPath: string,
|
||||
fileExportName: string,
|
||||
|
|
Loading…
Add table
Reference in a new issue