Merge pull request #3996 from ByteHamster/removed-main-thread-db

Removed yet another DB access on the main thread
This commit is contained in:
H. Lehmann 2020-04-03 10:20:29 +02:00 committed by GitHub
commit 5cb984daa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -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;
}