diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java index ca77c82298..e973b44167 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java @@ -28,7 +28,7 @@ public abstract class Extractor { @Nullable private ContentCountry forcedContentCountry = null; - private boolean isPageFetched = false; + private boolean pageFetched = false; // called like this to prevent checkstyle errors about "hiding a field" private final Downloader downloader; @@ -54,21 +54,21 @@ public LinkHandler getLinkHandler() { * @throws ExtractionException if the pages content is not understood */ public void fetchPage() throws IOException, ExtractionException { - if (isPageFetched) { + if (pageFetched) { return; } onFetchPage(downloader); - isPageFetched = true; + pageFetched = true; } protected void assertPageFetched() { - if (!isPageFetched) { + if (!pageFetched) { throw new IllegalStateException("Page is not fetched. Make sure you call fetchPage()"); } } protected boolean isPageFetched() { - return isPageFetched; + return pageFetched; } /** diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java index d7c0bb5d44..e31e1aff35 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java @@ -35,7 +35,7 @@ public final class AudioStream extends Stream { // Fields for DASH private int itag = ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE; - private int bitRate; + private int bitrate; private int initStart; private int initEnd; private int indexStart; @@ -351,7 +351,7 @@ private AudioStream(@Nonnull final String id, this.itagItem = itagItem; this.itag = itagItem.id; this.quality = itagItem.getQuality(); - this.bitRate = itagItem.getBitrate(); + this.bitrate = itagItem.getBitrate(); this.initStart = itagItem.getInitStart(); this.initEnd = itagItem.getInitEnd(); this.indexStart = itagItem.getIndexStart(); @@ -369,8 +369,8 @@ private AudioStream(@Nonnull final String id, * {@inheritDoc} */ @Override - public boolean areStatsEqual(final Stream cmp) { - return super.areStatsEqual(cmp) && cmp instanceof AudioStream + public boolean equalStats(final Stream cmp) { + return super.equalStats(cmp) && cmp instanceof AudioStream && averageBitrate == ((AudioStream) cmp).averageBitrate && Objects.equals(audioTrackId, ((AudioStream) cmp).audioTrackId) && audioTrackType == ((AudioStream) cmp).audioTrackType @@ -405,8 +405,8 @@ public int getItag() { * * @return the bitrate set from the {@link ItagItem} passed in the constructor of the stream. */ - public int getBitRate() { - return bitRate; + public int getBitrate() { + return bitrate; } /** diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java index 67595e6a1c..04d2b3facb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java @@ -74,7 +74,7 @@ public static boolean containSimilarStream(final Stream stream, return false; } for (final Stream cmpStream : streamList) { - if (stream.areStatsEqual(cmpStream)) { + if (stream.equalStats(cmpStream)) { return true; } } @@ -97,7 +97,7 @@ public static boolean containSimilarStream(final Stream stream, * @param other the stream object to be compared to this stream object * @return whether the stream have the same stats or not, based on the criteria above */ - public boolean areStatsEqual(@Nullable final Stream other) { + public boolean equalStats(@Nullable final Stream other) { if (other == null || mediaFormat == null || other.mediaFormat == null) { return false; } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java index ce78ec4530..08886dcac6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java @@ -265,8 +265,8 @@ public boolean isAutoGenerated() { * {@inheritDoc} */ @Override - public boolean areStatsEqual(final Stream cmp) { - return super.areStatsEqual(cmp) + public boolean equalStats(final Stream cmp) { + return super.equalStats(cmp) && cmp instanceof SubtitlesStream && code.equals(((SubtitlesStream) cmp).code) && autoGenerated == ((SubtitlesStream) cmp).autoGenerated; diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java index 1aa8e4ad76..170cd7df1e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java @@ -326,8 +326,8 @@ private VideoStream(@Nonnull final String id, * {@inheritDoc} */ @Override - public boolean areStatsEqual(final Stream cmp) { - return super.areStatsEqual(cmp) + public boolean equalStats(final Stream cmp) { + return super.equalStats(cmp) && cmp instanceof VideoStream && resolution.equals(((VideoStream) cmp).resolution) && isVideoOnly == ((VideoStream) cmp).isVideoOnly;