diff --git a/app/app.iml b/app/app.iml index 268ffb39..98f5b3af 100644 --- a/app/app.iml +++ b/app/app.iml @@ -43,13 +43,6 @@ - - - - - - - @@ -58,6 +51,13 @@ + + + + + + + @@ -106,14 +106,6 @@ - - - - - - - - @@ -122,6 +114,14 @@ + + + + + + + + diff --git a/app/build.gradle b/app/build.gradle index 30605037..60b60979 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,18 +41,18 @@ android { productFlavors { pro { applicationId 'com.lgallardo.qbittorrentclientpro' - versionName '4.4.4' + versionName '4.4.5' minSdkVersion 14 targetSdkVersion 23 - versionCode 444 + versionCode 445 archivesBaseName = "qBittorrentController_v" + versionName } free { applicationId "com.lgallardo.qbittorrentclient" - versionName '4.4.4' + versionName '4.4.5' minSdkVersion 14 targetSdkVersion 23 - versionCode 444 + versionCode 445 } } diff --git a/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java b/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java index a4bd7d81..b92c4304 100644 --- a/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java +++ b/app/src/main/java/com/lgallardo/qbittorrentclient/MainActivity.java @@ -328,6 +328,8 @@ protected void onCreate(Bundle savedInstanceState) { // Get preferences getSettings(); + MainActivity.cookie = null; + // Set alarm for checking completed torrents, if not set if (PendingIntent.getBroadcast(getApplication(), 0, new Intent(getApplication(), NotifierService.class), PendingIntent.FLAG_NO_CREATE) == null) { @@ -2817,7 +2819,7 @@ protected void getSettings() { qb_version = sharedPrefs.getString("qb_version", "3.2.x"); - MainActivity.cookie = sharedPrefs.getString("qbCookie", null); +// MainActivity.cookie = sharedPrefs.getString("qbCookie", null); // Get last state lastState = sharedPrefs.getString("lastState", "all"); @@ -3302,6 +3304,7 @@ protected void onPostExecute(String[] result) { } else if (apiVersion.contains("3.1")) { qb_version = "3.1.x"; + cookie = null; } else { @@ -3369,7 +3372,7 @@ protected String[] doInBackground(String... params) { // Log.d("Debug", params[0]); } } catch (NumberFormatException e) { - Log.e("Debug", e.toString()); +// Log.e("Debug", e.toString()); } @@ -3629,6 +3632,11 @@ protected Torrent[] doInBackground(String... params) { JSONObject json = jArray.getJSONObject(i); + Log.d("Debug", "name: " + json.getString(TAG_NAME)); + Log.d("Debug", "size: " + json.getString(TAG_SIZE)); + Log.d("Debug", "progress: " + json.getString(TAG_PROGRESS)); + Log.d("Debug", "qb_version: " + qb_version); + name = json.getString(TAG_NAME); size = json.getString(TAG_SIZE).replace(",", "."); progress = String.format("%.2f", json.getDouble(TAG_PROGRESS) * 100) + "%"; @@ -3664,7 +3672,7 @@ protected Torrent[] doInBackground(String... params) { label = json.getString(TAG_CATEGORY); } - } catch (JSONException je) { + } catch (Exception e) { label = null; } @@ -3751,7 +3759,8 @@ protected Torrent[] doInBackground(String... params) { } catch (Exception e) { torrents = null; - Log.e("MAIN:", e.toString()); + Log.e("MAIN:=", e.toString()); + e.printStackTrace(); if (CustomLogger.isMainActivityReporting()) { CustomLogger.saveReportMessage("Main", "[qBittorrentTask - Exception]: " + e.toString()); @@ -3954,7 +3963,7 @@ protected void onPostExecute(Torrent[] result) { // Log.d("Debug", "currentLabel: " + currentLabel); - if (labels != null) { + if (labels != null && !(labels.contains(null))) { // Sort labels Collections.sort(labels);