From 95e915300738635a0b942e6d767504c4385873c6 Mon Sep 17 00:00:00 2001 From: galushko Date: Wed, 21 Feb 2024 13:56:14 +0200 Subject: [PATCH] Add choose of the folder option --- .../halushko/kinocat/file/MoveToDestinationFolder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/file/src/main/java/com/halushko/kinocat/file/MoveToDestinationFolder.java b/file/src/main/java/com/halushko/kinocat/file/MoveToDestinationFolder.java index 1239484..9aaeb22 100644 --- a/file/src/main/java/com/halushko/kinocat/file/MoveToDestinationFolder.java +++ b/file/src/main/java/com/halushko/kinocat/file/MoveToDestinationFolder.java @@ -19,15 +19,15 @@ protected String getQueue() { @Override protected String[] getScript(SmartJson rabbitMessage) { List arguments = rabbitMessage.getSubMessage(SmartJsonKeys.COMMAND_ARGUMENTS).convertToList(); - String folder = (String) arguments.get(0); - String file = (String) arguments.get(1); + String folder = String.valueOf(arguments.get(0)); + String file = String.valueOf(arguments.get(1)).replaceAll("\\s+", "\\\\ "); return new String[]{ "/bin/bash", "-c", String.format("\"mv -f %s/%s.torrent %s/%s.torrent\"", - Constants.PATH_TO_UNAPPROVED_FOLDER.replaceAll("\\s+", "\\\\ "), - file.replaceAll("\\s+", "\\\\ "), - Constants.FOLDERS.get(folder).replaceAll("\\s+", "\\\\ "), + Constants.PATH_TO_UNAPPROVED_FOLDER, + file, + Constants.FOLDERS.get(folder), UUID.randomUUID() ) };