diff --git a/src/main/FileUploader.ts b/src/main/FileUploader.ts index 44c31b3..850078a 100644 --- a/src/main/FileUploader.ts +++ b/src/main/FileUploader.ts @@ -27,7 +27,7 @@ export class FileUploader { container: fileMetadata.container, description: this.completeJson(this.file.fileMetadata.description, this.file.fileMetadata.descriptionVersion), desc_version: fileMetadata.descriptionVersion, - page_count: !fileMetadata.descriptionVersion.startsWith("1") ? fileMetadata.pageCount : undefined, + page_count: !fileMetadata.descriptionVersion.startsWith("1") ? (fileMetadata.pageCount ?? "null") : undefined, date: fileMetadata.date ?? "", restriction: fileMetadata.restrictions, tags: fileMetadata.tags, diff --git a/src/main/api/FormData.ts b/src/main/api/FormData.ts index eb6910f..f4930f9 100644 --- a/src/main/api/FormData.ts +++ b/src/main/api/FormData.ts @@ -27,7 +27,7 @@ function convertFormData( if (value == undefined) return; if(value.hasOwnProperty("file_title") && value.hasOwnProperty("file_data")) { - formData.set(formKey, value.data, value.title); + formData.set(formKey, value.file_data, value.file_title); return; } diff --git a/src/main/api/RemoteServerApi.ts b/src/main/api/RemoteServerApi.ts index 9ed482d..42bdde4 100644 --- a/src/main/api/RemoteServerApi.ts +++ b/src/main/api/RemoteServerApi.ts @@ -17,7 +17,7 @@ export type UploadType = { container: number, description: string desc_version: string, - page_count?: number, + page_count?: number | "null", date: string, restriction: number, tags: string[], diff --git a/src/main/group/GroupManager.ts b/src/main/group/GroupManager.ts index 5015f34..d83fc5a 100644 --- a/src/main/group/GroupManager.ts +++ b/src/main/group/GroupManager.ts @@ -11,6 +11,7 @@ import {GroupUploader} from "@main/group/controller/GroupUploader"; import {IDownloader} from "@main/downloader/interfaces/IDownloader"; import RemoteServerApi from "@main/api/RemoteServerApi"; import {UploadResultStatusType} from "@main/database/LocalDatabase"; +import {sendSuccess} from "@main/NotificationBundle"; type GroupImportType = { @@ -54,6 +55,7 @@ export class GroupManager { } //Save to database getFileDatabase().addGroup(group); + sendSuccess("Group Import Completed", "Successfully imported group folder."); } } @@ -74,7 +76,7 @@ export class GroupManager { public static deleteGroup(group: GroupModel, removeFolder: boolean = false) { log.info(`Deleting Group: ${group.getName()} with id: ${group.id}. Folder removal: ${removeFolder}`); if(removeFolder) { - jetpack.remove(group.getRootFolder()) + jetpack.remove(group.getRootFolder()); } getFileDatabase().removeGroup(group); }