mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Ignore ContentNotSupportedException caused by Bandcamp fan pages
This commit is contained in:
parent
39a3f03e79
commit
292e103073
@ -62,6 +62,7 @@ import org.schabi.newpipe.error.ReCaptchaActivity;
|
|||||||
import org.schabi.newpipe.error.UserAction;
|
import org.schabi.newpipe.error.UserAction;
|
||||||
import org.schabi.newpipe.extractor.InfoItem;
|
import org.schabi.newpipe.extractor.InfoItem;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
|
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.stream.AudioStream;
|
import org.schabi.newpipe.extractor.stream.AudioStream;
|
||||||
import org.schabi.newpipe.extractor.stream.Stream;
|
import org.schabi.newpipe.extractor.stream.Stream;
|
||||||
@ -1546,10 +1547,21 @@ public final class VideoDetailFragment
|
|||||||
updateOverlayData(info.getName(), info.getUploaderName(), info.getThumbnailUrl());
|
updateOverlayData(info.getName(), info.getUploaderName(), info.getThumbnailUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!info.getErrors().isEmpty()) {
|
||||||
|
// Bandcamp fan pages are not yet supported and thus a ContentNotAvailableException is
|
||||||
|
// thrown. This is not an error and thus should not be shown to the user.
|
||||||
|
for (final Throwable throwable : info.getErrors()) {
|
||||||
|
if (throwable instanceof ContentNotSupportedException
|
||||||
|
&& "Fan pages are not supported".equals(throwable.getMessage())) {
|
||||||
|
info.getErrors().remove(throwable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!info.getErrors().isEmpty()) {
|
if (!info.getErrors().isEmpty()) {
|
||||||
showSnackBarError(new ErrorInfo(info.getErrors(),
|
showSnackBarError(new ErrorInfo(info.getErrors(),
|
||||||
UserAction.REQUESTED_STREAM, info.getUrl(), info));
|
UserAction.REQUESTED_STREAM, info.getUrl(), info));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding.detailControlsDownload.setVisibility(info.getStreamType() == StreamType.LIVE_STREAM
|
binding.detailControlsDownload.setVisibility(info.getStreamType() == StreamType.LIVE_STREAM
|
||||||
|| info.getStreamType() == StreamType.AUDIO_LIVE_STREAM ? View.GONE : View.VISIBLE);
|
|| info.getStreamType() == StreamType.AUDIO_LIVE_STREAM ? View.GONE : View.VISIBLE);
|
||||||
|
Loading…
Reference in New Issue
Block a user