From 08fb9c2c372fe49523dd19791984e187d645a260 Mon Sep 17 00:00:00 2001 From: galushko Date: Thu, 19 Oct 2023 01:24:19 +0300 Subject: [PATCH] Move torrent client to the separate service --- .../kinocat/torrent/externalCalls/TorrentCommands.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torrent/src/main/java/com/halushko/kinocat/torrent/externalCalls/TorrentCommands.java b/torrent/src/main/java/com/halushko/kinocat/torrent/externalCalls/TorrentCommands.java index f77a0dc2..bb4e1e56 100644 --- a/torrent/src/main/java/com/halushko/kinocat/torrent/externalCalls/TorrentCommands.java +++ b/torrent/src/main/java/com/halushko/kinocat/torrent/externalCalls/TorrentCommands.java @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; import lombok.val; +import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -25,7 +26,7 @@ public TorrentCommands() { @Override protected void executeRequest(SmartJson message) { long chatId = message.getUserId(); - String requestBodyFormat = ResourceReader.readResourceContent(String.format("transmission_requests/%s", message.getText())); + String requestBodyFormat = ResourceReader.readResourceContent(String.format("transmission_requests/%s", message.getText().split(" ")[0])); String torrentId = message.getValue("ARG"); String requestBody = String.format(requestBodyFormat, torrentId); log.debug("[executeRequest] Request body:\n{}", requestBody);