Skip to content

Commit

Permalink
Add choose of the folder optionAdd choose of the folder option
Browse files Browse the repository at this point in the history
  • Loading branch information
galushko committed Mar 1, 2024
1 parent 6d2398f commit 79e4ad2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ protected String getQueue() {
protected String[] getScript(SmartJson rabbitMessage) {
List<Object> arguments = rabbitMessage.getSubMessage(SmartJsonKeys.COMMAND_ARGUMENTS).convertToList();
String folder = String.valueOf(arguments.get(0));
String folderPath = Constants.FOLDERS.get(folder);
if(folderPath == null || folderPath.isEmpty()) {
folderPath = Constants.FOLDERS.get("");
}

String file = String.valueOf(arguments.get(1)).replaceAll("\\s+", "\\\\ ");
return new String[]{
"mv",
"-f",
String.format("%s/%s.torrent", Constants.PATH_TO_UNAPPROVED_FOLDER, file),
String.format("%s/%s.torrent", Constants.FOLDERS.get(folder), UUID.randomUUID())
String.format("%s/%s.torrent", folderPath, UUID.randomUUID())
};
}
}

0 comments on commit 79e4ad2

Please sign in to comment.