From 9f750c5ae4fe4643b0e80294aae0cd5184689fc6 Mon Sep 17 00:00:00 2001
From: lgallard <21Usogithub&>
Date: Mon, 1 Aug 2016 01:53:42 -0300
Subject: [PATCH] Release 4.4.0
* Fixed issue when changing between servers in the Pro version
* Fixed number exception issue for Free and Pro version
---
app/app.iml | 20 +++++++-------
app/build.gradle | 8 +++---
.../qbittorrentclient/MainActivity.java | 26 +++++++++----------
3 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/app/app.iml b/app/app.iml
index ec88675e..2965c2fb 100644
--- a/app/app.iml
+++ b/app/app.iml
@@ -18,7 +18,7 @@
-
+
@@ -64,14 +64,6 @@
-
-
-
-
-
-
-
-
@@ -80,6 +72,14 @@
+
+
+
+
+
+
+
+
@@ -163,6 +163,8 @@
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 7e409bcb..0ea8a1d4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -41,18 +41,18 @@ android {
productFlavors {
pro {
applicationId 'com.lgallardo.qbittorrentclientpro'
- versionName '4.3.9'
+ versionName '4.4.0'
minSdkVersion 14
targetSdkVersion 23
- versionCode 439
+ versionCode 440
archivesBaseName = "qBittorrentController_v" + versionName
}
free {
applicationId "com.lgallardo.qbittorrentclient"
- versionName '4.3.9'
+ versionName '4.4.0'
minSdkVersion 14
targetSdkVersion 23
- versionCode 439
+ versionCode 440
}
}
diff --git a/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java b/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java
index ead524cf..ff46aa52 100644
--- a/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java
+++ b/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java
@@ -3236,12 +3236,13 @@ protected String[] doInBackground(String... params) {
// Validate setLabel for API 10+
- if(Integer.parseInt(MainActivity.qb_api) >= 10 && "setLabel".equals(params[0])) {
-
- params[0] = "setCategory";
-
- Log.d("Debug", params[0]);
-
+ try {
+ if(Integer.parseInt(MainActivity.qb_api) >= 10 && "setLabel".equals(params[0])) {
+ params[0] = "setCategory";
+ Log.d("Debug", params[0]);
+ }
+ } catch (NumberFormatException e) {
+ Log.e("Debug", e.toString());
}
@@ -3882,19 +3883,18 @@ protected void onPostExecute(Torrent[] result) {
// Sort by Added on and Completed on
if (sortby.equals("AddedOn")) {
- if (Integer.parseInt(MainActivity.qb_api) < 10) {
- Collections.sort(torrentsFiltered, new TorrentAddedOnComparator(reverse_order));
- } else {
+ if (MainActivity.qb_api == null || Integer.parseInt(MainActivity.qb_api) >= 10) {
Collections.sort(torrentsFiltered, new TorrentAddedOnTimestampComparator(reverse_order));
+ } else {
+ Collections.sort(torrentsFiltered, new TorrentAddedOnComparator(reverse_order));
}
-
}
if (sortby.equals("CompletedOn")) {
- if (Integer.parseInt(MainActivity.qb_api) < 10) {
- Collections.sort(torrentsFiltered, new TorrentCompletedOnComparator(reverse_order));
- } else {
+ if (MainActivity.qb_api == null || Integer.parseInt(MainActivity.qb_api) >= 10) {
Collections.sort(torrentsFiltered, new TorrentCompletedOnTimestampComparator(reverse_order));
+ } else {
+ Collections.sort(torrentsFiltered, new TorrentCompletedOnComparator(reverse_order));
}
}