From c29ccf6f67c387d7b0957e97872c1804e12ea21e Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 13 Jul 2018 09:33:27 +0200 Subject: [PATCH] Changes due to Codacy Signed-off-by: tobiasKaminsky --- .../com/owncloud/android/files/StreamMediaFileOperation.java | 3 ++- .../com/owncloud/android/ui/activity/FileDisplayActivity.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/files/StreamMediaFileOperation.java b/src/main/java/com/owncloud/android/files/StreamMediaFileOperation.java index 0a09a4ed56..f46d5f5e86 100644 --- a/src/main/java/com/owncloud/android/files/StreamMediaFileOperation.java +++ b/src/main/java/com/owncloud/android/files/StreamMediaFileOperation.java @@ -82,8 +82,9 @@ public class StreamMediaFileOperation extends RemoteOperation { Log_OC.e(TAG, "Get stream url for file with id " + fileID + " failed: " + result.getLogMessage(), result.getException()); } finally { - if (postMethod != null) + if (postMethod != null) { postMethod.releaseConnection(); + } } return result; } diff --git a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index ead0d8545a..b148e7e556 100644 --- a/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -2329,7 +2329,7 @@ public class FileDisplayActivity extends HookActivity */ public void startMediaPreview(OCFile file, int startPlaybackPosition, boolean autoplay, boolean showPreview, boolean streamMedia) { - if ((showPreview && file.isDown() && !file.isDownloading()) || streamMedia) { + if (showPreview && file.isDown() && !file.isDownloading() || streamMedia) { Fragment mediaFragment = PreviewMediaFragment.newInstance(file, getAccount(), startPlaybackPosition, autoplay); setSecondFragment(mediaFragment); updateFragmentsVisibility(true);