From a101d3df9a8036d9435bf547a690ecb3368c204f Mon Sep 17 00:00:00 2001 From: Hadley Canine Date: Mon, 18 May 2015 04:07:51 -0500 Subject: [PATCH] Crash bug fixed. Annoying verbose debug output removed. Everything appears to work again in API version 2. --- .../daemon/Qbittorrent/QbittorrentAdapter.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java index 0c8d1343..9fa20836 100644 --- a/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Qbittorrent/QbittorrentAdapter.java @@ -101,11 +101,9 @@ public class QbittorrentAdapter implements IDaemonAdapter { } catch (DaemonException e) { apiVersion = 1; - log.d(LOG_NAME, e.toString()); } catch (NumberFormatException e) { apiVersion = 1; - log.d(LOG_NAME, e.toString()); } log.d(LOG_NAME, "qBittorrent API version is " + apiVersion); @@ -162,16 +160,12 @@ public class QbittorrentAdapter implements IDaemonAdapter { // Have we already authenticated? Check if we have the cookie that we need List cookies = httpclient.getCookieStore().getCookies(); for (Cookie c : cookies) { - log.d(LOG_NAME, "Looking at this cookie: " + c.getName()); if (c.getName().equals("SID")) { // And here it is! Okay, no need authenticate again. - log.d(LOG_NAME, "We're already authed, no need to do it again."); return; } } - log.d(LOG_NAME, "Authenticating..."); - makeRequest(log, "/login", new BasicNameValuePair("username", settings.getUsername()), new BasicNameValuePair("password", settings.getPassword())); @@ -180,10 +174,8 @@ public class QbittorrentAdapter implements IDaemonAdapter { // However, we would like to see if authentication was successful or not... cookies = httpclient.getCookieStore().getCookies(); for (Cookie c : cookies) { - log.d(LOG_NAME, "post auth looking at this cookie: " + c.getName()); if (c.getName().equals("SID")) { // Good. Let's get out of here. - log.d(LOG_NAME, "Authentication success!"); return; } } @@ -609,9 +601,9 @@ public class QbittorrentAdapter implements IDaemonAdapter { long size; if (apiVersion >= 2) { - size = parseSize(file.getString("size")); - } else { size = file.getLong("size"); + } else { + size = parseSize(file.getString("size")); } torrentfiles.add(new TorrentFile("" + i, file.getString("name"), null, null, size, (long) (size * file