Skip to content

Commit ea1a1d1

Browse files
authored
Merge pull request #1242 from TeamNewPipe/revert-1205-feature-branch
Revert "Refactored Identifiers"
2 parents d3d5f2b + c00d0a7 commit ea1a1d1

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/Extractor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public abstract class Extractor {
2828
@Nullable
2929
private ContentCountry forcedContentCountry = null;
3030

31-
private boolean isPageFetched = false;
31+
private boolean pageFetched = false;
3232
// called like this to prevent checkstyle errors about "hiding a field"
3333
private final Downloader downloader;
3434

@@ -54,21 +54,21 @@ public LinkHandler getLinkHandler() {
5454
* @throws ExtractionException if the pages content is not understood
5555
*/
5656
public void fetchPage() throws IOException, ExtractionException {
57-
if (isPageFetched) {
57+
if (pageFetched) {
5858
return;
5959
}
6060
onFetchPage(downloader);
61-
isPageFetched = true;
61+
pageFetched = true;
6262
}
6363

6464
protected void assertPageFetched() {
65-
if (!isPageFetched) {
65+
if (!pageFetched) {
6666
throw new IllegalStateException("Page is not fetched. Make sure you call fetchPage()");
6767
}
6868
}
6969

7070
protected boolean isPageFetched() {
71-
return isPageFetched;
71+
return pageFetched;
7272
}
7373

7474
/**

extractor/src/main/java/org/schabi/newpipe/extractor/stream/AudioStream.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class AudioStream extends Stream {
3535

3636
// Fields for DASH
3737
private int itag = ITAG_NOT_AVAILABLE_OR_NOT_APPLICABLE;
38-
private int bitRate;
38+
private int bitrate;
3939
private int initStart;
4040
private int initEnd;
4141
private int indexStart;
@@ -351,7 +351,7 @@ private AudioStream(@Nonnull final String id,
351351
this.itagItem = itagItem;
352352
this.itag = itagItem.id;
353353
this.quality = itagItem.getQuality();
354-
this.bitRate = itagItem.getBitrate();
354+
this.bitrate = itagItem.getBitrate();
355355
this.initStart = itagItem.getInitStart();
356356
this.initEnd = itagItem.getInitEnd();
357357
this.indexStart = itagItem.getIndexStart();
@@ -369,8 +369,8 @@ private AudioStream(@Nonnull final String id,
369369
* {@inheritDoc}
370370
*/
371371
@Override
372-
public boolean areStatsEqual(final Stream cmp) {
373-
return super.areStatsEqual(cmp) && cmp instanceof AudioStream
372+
public boolean equalStats(final Stream cmp) {
373+
return super.equalStats(cmp) && cmp instanceof AudioStream
374374
&& averageBitrate == ((AudioStream) cmp).averageBitrate
375375
&& Objects.equals(audioTrackId, ((AudioStream) cmp).audioTrackId)
376376
&& audioTrackType == ((AudioStream) cmp).audioTrackType
@@ -405,8 +405,8 @@ public int getItag() {
405405
*
406406
* @return the bitrate set from the {@link ItagItem} passed in the constructor of the stream.
407407
*/
408-
public int getBitRate() {
409-
return bitRate;
408+
public int getBitrate() {
409+
return bitrate;
410410
}
411411

412412
/**

extractor/src/main/java/org/schabi/newpipe/extractor/stream/Stream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static boolean containSimilarStream(final Stream stream,
7474
return false;
7575
}
7676
for (final Stream cmpStream : streamList) {
77-
if (stream.areStatsEqual(cmpStream)) {
77+
if (stream.equalStats(cmpStream)) {
7878
return true;
7979
}
8080
}
@@ -97,7 +97,7 @@ public static boolean containSimilarStream(final Stream stream,
9797
* @param other the stream object to be compared to this stream object
9898
* @return whether the stream have the same stats or not, based on the criteria above
9999
*/
100-
public boolean areStatsEqual(@Nullable final Stream other) {
100+
public boolean equalStats(@Nullable final Stream other) {
101101
if (other == null || mediaFormat == null || other.mediaFormat == null) {
102102
return false;
103103
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ public boolean isAutoGenerated() {
265265
* {@inheritDoc}
266266
*/
267267
@Override
268-
public boolean areStatsEqual(final Stream cmp) {
269-
return super.areStatsEqual(cmp)
268+
public boolean equalStats(final Stream cmp) {
269+
return super.equalStats(cmp)
270270
&& cmp instanceof SubtitlesStream
271271
&& code.equals(((SubtitlesStream) cmp).code)
272272
&& autoGenerated == ((SubtitlesStream) cmp).autoGenerated;

extractor/src/main/java/org/schabi/newpipe/extractor/stream/VideoStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ private VideoStream(@Nonnull final String id,
326326
* {@inheritDoc}
327327
*/
328328
@Override
329-
public boolean areStatsEqual(final Stream cmp) {
330-
return super.areStatsEqual(cmp)
329+
public boolean equalStats(final Stream cmp) {
330+
return super.equalStats(cmp)
331331
&& cmp instanceof VideoStream
332332
&& resolution.equals(((VideoStream) cmp).resolution)
333333
&& isVideoOnly == ((VideoStream) cmp).isVideoOnly;

0 commit comments

Comments
 (0)