Removes unnecessary duplicate file name cleaning

This commit is contained in:
2025-08-05 04:49:19 +02:00
parent 73157330d8
commit a3e3326786
2 changed files with 3 additions and 4 deletions

View File

@@ -15,7 +15,6 @@ import java.io.File;
import java.util.UUID; import java.util.UUID;
import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash;
import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString;
import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName;
/** /**
@@ -154,7 +153,7 @@ public final class BookHelper {
"book would lead to unexpected problems."); "book would lead to unexpected problems.");
} }
return fixName(cleanString(bookName + titleAuthorSeparator + authorName), false); return fixName(InputCleaningHelper.cleanString(bookName + titleAuthorSeparator + authorName), false);
} }
/** /**

View File

@@ -60,7 +60,7 @@ public final class BookToFromTextHelper {
bookYml.set("Lore", bookMetadata.getLore()); bookYml.set("Lore", bookMetadata.getLore());
} }
bookYml.save(path + InputCleaningHelper.cleanString(fileName) + ".yml"); bookYml.save(path + fileName + ".yml");
} }
/** /**
@@ -90,7 +90,7 @@ public final class BookToFromTextHelper {
* @throws IOException <p>If unable to save the book</p> * @throws IOException <p>If unable to save the book</p>
*/ */
public static void bookToTXT(@NotNull String folderPath, @NotNull String fileName, @NotNull BookMeta bookMetadata) throws IOException { public static void bookToTXT(@NotNull String folderPath, @NotNull String fileName, @NotNull BookMeta bookMetadata) throws IOException {
FileWriter fileWriter = new FileWriter(folderPath + InputCleaningHelper.cleanString(fileName) + ".txt", StandardCharsets.UTF_8); FileWriter fileWriter = new FileWriter(folderPath + fileName + ".txt", StandardCharsets.UTF_8);
PrintWriter printWriter = new PrintWriter(fileWriter); PrintWriter printWriter = new PrintWriter(fileWriter);
List<String> pages = bookMetadata.getPages(); List<String> pages = bookMetadata.getPages();