rename sanitize function to singular
This commit is contained in:
parent
3dfe084850
commit
ad3faec8a6
|
@ -40,7 +40,7 @@ class ExportService {
|
||||||
for (let collection of collections) {
|
for (let collection of collections) {
|
||||||
let collectionFolderPath = `${dir}/${
|
let collectionFolderPath = `${dir}/${
|
||||||
collection.id
|
collection.id
|
||||||
}_${this.sanitizeNames(collection.name)}`;
|
}_${this.sanitizeName(collection.name)}`;
|
||||||
await this.ElectronAPIs.checkExistsAndCreateCollectionDir(
|
await this.ElectronAPIs.checkExistsAndCreateCollectionDir(
|
||||||
collectionFolderPath
|
collectionFolderPath
|
||||||
);
|
);
|
||||||
|
@ -80,14 +80,13 @@ class ExportService {
|
||||||
|
|
||||||
async downloadAndSave(file: file, path) {
|
async downloadAndSave(file: file, path) {
|
||||||
const fileStream = await downloadManager.downloadFile(file);
|
const fileStream = await downloadManager.downloadFile(file);
|
||||||
|
|
||||||
this.ElectronAPIs.saveStreamToDisk(path, fileStream);
|
this.ElectronAPIs.saveStreamToDisk(path, fileStream);
|
||||||
this.ElectronAPIs.saveFileToDisk(
|
this.ElectronAPIs.saveFileToDisk(
|
||||||
`${path}.json`,
|
`${path}.json`,
|
||||||
JSON.stringify(file.metadata, null, 2)
|
JSON.stringify(file.metadata, null, 2)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
private sanitizeNames(name) {
|
private sanitizeName(name) {
|
||||||
return name.replaceAll('/', '_').replaceAll(' ', '_');
|
return name.replaceAll('/', '_').replaceAll(' ', '_');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue