From 3e7acb4475c778cd66119d1a4b273d6119bd5206 Mon Sep 17 00:00:00 2001 From: Retaliate7731 Date: Tue, 24 Dec 2024 22:59:10 +0100 Subject: [PATCH] Allow empty profile and description field in Actors and Weapons --- modules/rpgmakermvmz.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/rpgmakermvmz.py b/modules/rpgmakermvmz.py index f6ee29f..513f782 100644 --- a/modules/rpgmakermvmz.py +++ b/modules/rpgmakermvmz.py @@ -656,10 +656,11 @@ def searchNames(data, pbar, context): totalTokens[1] += response[1][1] # Profile - response = translateGPT(profileList, "", True) - translatedProfileBatch = response[0] - totalTokens[0] += response[1][0] - totalTokens[1] += response[1][1] + if profileList: + response = translateGPT(profileList, "", True) + translatedProfileBatch = response[0] + totalTokens[0] += response[1][0] + totalTokens[1] += response[1][1] # Set Data if len(nameList) == len(translatedNameBatch): @@ -699,14 +700,15 @@ def searchNames(data, pbar, context): totalTokens[1] += response[1][1] # Description - response = translateGPT( - descriptionList, - f"Reply with only the {LANGUAGE} translation of the text.", - True, - ) - translatedDescriptionBatch = response[0] - totalTokens[0] += response[1][0] - totalTokens[1] += response[1][1] + if descriptionList: + response = translateGPT( + descriptionList, + f"Reply with only the {LANGUAGE} translation of the text.", + True, + ) + translatedDescriptionBatch = response[0] + totalTokens[0] += response[1][0] + totalTokens[1] += response[1][1] # Set Data if len(nameList) == len(translatedNameBatch):