Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 8e7238c

Browse files
SponsorBlock: Merge branch 'dev' into sponsorblock
# Conflicts: # app/src/main/res/values/strings.xml
2 parents cbcb0f7 + 3c306a0 commit 8e7238c

File tree

64 files changed

+1809
-1283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1809
-1283
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
resValue "string", "app_name", "NewPipe"
1414
minSdkVersion 19
1515
targetSdkVersion 29
16-
versionCode 959
17-
versionName "0.20.5"
16+
versionCode 960
17+
versionName "0.20.6"
1818

1919
multiDexEnabled true
2020

@@ -175,7 +175,7 @@ dependencies {
175175

176176
// NewPipe dependencies
177177
// You can use a local version by uncommenting a few lines in settings.gradle
178-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:175df679e05b24b6094570d719cc11f8dfc17c68'
178+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:b3835bd616ab28b861c83dcefd56e1754c6d20be'
179179
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
180180

181181
implementation "org.jsoup:jsoup:1.13.1"

app/src/main/java/org/schabi/newpipe/CheckForNewAppVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ private CheckForNewAppVersion() { }
5151
private static final String NEWPIPE_API_URL = "https://newpipe.schabi.org/api/data.json";
5252

5353
/**
54-
* Method to get the apk's SHA1 key. See https://stackoverflow.com/questions/9293019/#22506133.
54+
* Method to get the APK's SHA1 key. See https://stackoverflow.com/questions/9293019/#22506133.
5555
*
5656
* @param application The application
57-
* @return String with the apk's SHA1 fingeprint in hexadecimal
57+
* @return String with the APK's SHA1 fingerprint in hexadecimal
5858
*/
5959
@NonNull
6060
private static String getCertificateSHA1Fingerprint(@NonNull final Application application) {
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
package org.schabi.newpipe.ktx
22

33
import java.time.OffsetDateTime
4-
import java.time.ZoneId
4+
import java.time.ZoneOffset
5+
import java.time.temporal.ChronoField
56
import java.util.Calendar
7+
import java.util.Date
68
import java.util.GregorianCalendar
9+
import java.util.TimeZone
710

8-
fun OffsetDateTime.toCalendar(zoneId: ZoneId = ZoneId.systemDefault()): Calendar {
9-
return GregorianCalendar.from(if (zoneId != offset) atZoneSameInstant(zoneId) else toZonedDateTime())
11+
// This method is a modified version of GregorianCalendar.from(ZonedDateTime).
12+
// Math.addExact() and Math.multiplyExact() are desugared even though lint displays a warning.
13+
@SuppressWarnings("NewApi")
14+
fun OffsetDateTime.toCalendar(): Calendar {
15+
val cal = GregorianCalendar(TimeZone.getTimeZone("UTC"))
16+
val offsetDateTimeUTC = withOffsetSameInstant(ZoneOffset.UTC)
17+
cal.gregorianChange = Date(Long.MIN_VALUE)
18+
cal.firstDayOfWeek = Calendar.MONDAY
19+
cal.minimalDaysInFirstWeek = 4
20+
try {
21+
cal.timeInMillis = Math.addExact(
22+
Math.multiplyExact(offsetDateTimeUTC.toEpochSecond(), 1000),
23+
offsetDateTimeUTC[ChronoField.MILLI_OF_SECOND].toLong()
24+
)
25+
} catch (ex: ArithmeticException) {
26+
throw IllegalArgumentException(ex)
27+
}
28+
return cal
1029
}

app/src/main/java/org/schabi/newpipe/local/subscription/services/ImportExportEventListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public interface ImportExportEventListener {
99
void onSizeReceived(int size);
1010

1111
/**
12-
* Called everytime an item has been parsed/resolved.
12+
* Called every time an item has been parsed/resolved.
1313
*
1414
* @param itemName the name of the subscription item
1515
*/

app/src/main/java/org/schabi/newpipe/player/BasePlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ public void onShuffleClicked() {
698698

699699
public void onMuteUnmuteButtonClicked() {
700700
if (DEBUG) {
701-
Log.d(TAG, "onMuteUnmuteButtonClicled() called");
701+
Log.d(TAG, "onMuteUnmuteButtonClicked() called");
702702
}
703703
simpleExoPlayer.setVolume(isMuted() ? 1 : 0);
704704
}

app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public void onProgressUpdate(final int currentProgress, final int duration,
618618
progressLiveSync.setClickable(!player.isLiveEdge());
619619
}
620620

621-
// this will make shure progressCurrentTime has the same width as progressEndTime
621+
// this will make sure progressCurrentTime has the same width as progressEndTime
622622
final ViewGroup.LayoutParams endTimeParams = progressEndTime.getLayoutParams();
623623
final ViewGroup.LayoutParams currentTimeParams = progressCurrentTime.getLayoutParams();
624624
currentTimeParams.width = progressEndTime.getWidth();

app/src/main/java/org/schabi/newpipe/player/helper/LoadController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public LoadController() {
2626
}
2727

2828
private LoadController(final int initialPlaybackBufferMs,
29-
final int minimumPlaybackbufferMs,
29+
final int minimumPlaybackBufferMs,
3030
final int optimalPlaybackBufferMs) {
3131
this.initialPlaybackBufferUs = initialPlaybackBufferMs * 1000;
3232

3333
final DefaultLoadControl.Builder builder = new DefaultLoadControl.Builder();
34-
builder.setBufferDurationsMs(minimumPlaybackbufferMs, optimalPlaybackBufferMs,
34+
builder.setBufferDurationsMs(minimumPlaybackBufferMs, optimalPlaybackBufferMs,
3535
initialPlaybackBufferMs, initialPlaybackBufferMs);
3636
internalLoadControl = builder.createDefaultLoadControl();
3737
}

app/src/main/java/org/schabi/newpipe/player/playqueue/AbstractInfoPlayQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ public void dispose() {
128128
fetchReactor = null;
129129
}
130130

131-
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infos) {
131+
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
132132
final List<PlayQueueItem> result = new ArrayList<>();
133-
for (final InfoItem stream : infos) {
133+
for (final InfoItem stream : infoItems) {
134134
if (stream instanceof StreamInfoItem) {
135135
result.add(new PlayQueueItem((StreamInfoItem) stream));
136136
}

0 commit comments

Comments
 (0)