From 4f782f99c1d20c2f34216f254ed0f405c23439f4 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 2 Apr 2020 22:44:47 +0200 Subject: [PATCH] Removed yet another DB access on the main thread --- .../antennapod/fragment/ItemDescriptionFragment.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index 269c33962..8a8162d1a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -15,7 +15,6 @@ import de.danoeh.antennapod.core.util.playback.PlaybackController; import de.danoeh.antennapod.core.util.playback.Timeline; import de.danoeh.antennapod.view.ShownotesWebView; import io.reactivex.Maybe; -import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; @@ -87,12 +86,11 @@ public class ItemDescriptionFragment extends Fragment { @Nullable private String loadData() { - if (controller.getMedia() != null) { - Timeline timeline = new Timeline(getActivity(), controller.getMedia()); - return timeline.processShownotes(); - } else { + if (controller.getMedia() == null) { return null; } + Timeline timeline = new Timeline(getActivity(), controller.getMedia()); + return timeline.processShownotes(); } @Override @@ -143,9 +141,6 @@ public class ItemDescriptionFragment extends Fragment { controller = new PlaybackController(getActivity()) { @Override public boolean loadMediaInfo() { - if (getMedia() == null) { - return false; - } load(); return true; }