Fix StreamType check, missing import, and styling errors

This commit is contained in:
Douile 2021-12-03 21:53:36 +00:00
parent 3d1a3606c9
commit ec7de2a6dc
No known key found for this signature in database
GPG Key ID: DAB413485BA6CFFD
1 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import androidx.fragment.app.Fragment;
import org.schabi.newpipe.NewPipeDatabase; import org.schabi.newpipe.NewPipeDatabase;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.stream.StreamType;
import org.schabi.newpipe.local.dialog.PlaylistAppendDialog; import org.schabi.newpipe.local.dialog.PlaylistAppendDialog;
import org.schabi.newpipe.local.dialog.PlaylistCreationDialog; import org.schabi.newpipe.local.dialog.PlaylistCreationDialog;
import org.schabi.newpipe.local.history.HistoryRecordManager; import org.schabi.newpipe.local.history.HistoryRecordManager;
@ -21,7 +22,6 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers; import io.reactivex.rxjava3.schedulers.Schedulers;
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
@ -221,7 +221,9 @@ public enum StreamDialogEntry {
private static void fetchItemInfoIfSparse(final Fragment fragment, private static void fetchItemInfoIfSparse(final Fragment fragment,
final StreamInfoItem item, final StreamInfoItem item,
final InfoCallback callback) { final InfoCallback callback) {
if ((item.getStreamType() == StreamType.LIVE_STREAM || item.getStreamType() == StreamType.AUDIO_LIVE_STREAM) && item.getDuration() < 0) { if (!(item.getStreamType() == StreamType.LIVE_STREAM
|| item.getStreamType() == StreamType.AUDIO_LIVE_STREAM)
&& item.getDuration() < 0) {
// Sparse item: fetched by fast fetch // Sparse item: fetched by fast fetch
ExtractorHelper.getStreamInfo( ExtractorHelper.getStreamInfo(
item.getServiceId(), item.getServiceId(),