From 71151f5dca9fcf13adbef7a1aa089e5a20a627f1 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 4 Mar 2014 10:23:13 +0100 Subject: [PATCH] Transmission: only forcefully add trailing slash to download location if it is not yet there. Fixes #52. --- .../transdroid/daemon/Transmission/TransmissionAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java b/lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java index 706de516..50491a6b 100644 --- a/lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java +++ b/lib/src/org/transdroid/daemon/Transmission/TransmissionAdapter.java @@ -493,12 +493,15 @@ public class TransmissionAdapter implements IDaemonAdapter { if (!commentString.equals("")) { errorString = errorString.equals("")? commentString : errorString + "\n" + commentString; } + String locationDir = tor.getString(RPC_DOWNLOADDIR); + if (!locationDir.endsWith(settings.getOS().getPathSeperator())) + locationDir += settings.getOS().getPathSeperator(); torrents.add(new Torrent( tor.getInt(RPC_ID), null, tor.getString(RPC_NAME), hasError? TorrentStatus.Error: getStatus(tor.getInt(RPC_STATUS)), - tor.getString(RPC_DOWNLOADDIR) + settings.getOS().getPathSeperator(), + locationDir, tor.getInt(RPC_RATEDOWNLOAD), tor.getInt(RPC_RATEUPLOAD), tor.getInt(RPC_PEERSGETTING),