From 6bbfcf760331e741df502b7bc7c0f7aef4dcce1c Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Fri, 28 Jan 2022 00:58:53 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20mismatched=20keys=20in?= =?UTF-8?q?=20methods=20using=20IFolderData?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/import.service.ts | 39 ++++++++++++++++++++++++++++++-- services/libraryqueue.service.ts | 35 ++++++++++++++++++++++++++++ utils/uncompression.utils.ts | 4 ++-- 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/services/import.service.ts b/services/import.service.ts index 5e4ce44..4122262 100644 --- a/services/import.service.ts +++ b/services/import.service.ts @@ -1,3 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2022 Rishi Ghan + * + The MIT License (MIT) + +Copyright (c) 2022 Rishi Ghan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ + +/* + * Revision History: + * Initial: 2022/01/28 Rishi Ghan + */ + + + "use strict"; import { isNil, map } from "lodash"; import { @@ -98,7 +133,7 @@ export default class ImportService extends Service { await broker.call("libraryqueue.enqueue", { fileObject: { filePath: item.path, - size: item.stats.size, + fileSize: item.stats.size, }, }); } else { @@ -449,7 +484,7 @@ export default class ImportService extends Service { }; return https .get( - `${apiDetailURL}?api_key=${process.env.COMICVINE_API_KEY}&format=json&limit=1&offset=0&field_list=id,name,description,image,first_issue,last_issue,publisher,count_of_issues,character_credits,person_credits,aliases`, + `${apiDetailURL}?api_key=${process.env.COMICVINE_API_KEY}&format=json&limit=1&offset=0`, options, (resp) => { let data = ""; diff --git a/services/libraryqueue.service.ts b/services/libraryqueue.service.ts index 86b3a24..eee46f2 100644 --- a/services/libraryqueue.service.ts +++ b/services/libraryqueue.service.ts @@ -1,4 +1,39 @@ +/* + * MIT License + * + * Copyright (c) 2022 Rishi Ghan + * + The MIT License (MIT) + +Copyright (c) 2015 Rishi Ghan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ + +/* + * Revision History: + * Initial: 2022/01/28 Rishi Ghan + */ + + "use strict"; + import { Context, Service, diff --git a/utils/uncompression.utils.ts b/utils/uncompression.utils.ts index f5e1bf7..fd46320 100644 --- a/utils/uncompression.utils.ts +++ b/utils/uncompression.utils.ts @@ -5,7 +5,7 @@ * The MIT License (MIT) -Copyright (c) 2021 Rishi Ghan +Copyright (c) 2022 Rishi Ghan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -110,7 +110,7 @@ export const extractCoverFromFile2 = async ( ); return { name: fileNameWithoutExtension, - path: filePath, + filePath, fileSize, extension: path.extname(filePath), cover: {