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

Commit

Permalink
SponsorBlock: Merge branch 'dev' into sponsorblock
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/res/values/strings.xml
  • Loading branch information
polymorphicshade committed Dec 10, 2020
2 parents cbcb0f7 + 3c306a0 commit 8e7238c
Show file tree
Hide file tree
Showing 64 changed files with 1,809 additions and 1,283 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
resValue "string", "app_name", "NewPipe"
minSdkVersion 19
targetSdkVersion 29
versionCode 959
versionName "0.20.5"
versionCode 960
versionName "0.20.6"

multiDexEnabled true

Expand Down Expand Up @@ -175,7 +175,7 @@ dependencies {

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

implementation "org.jsoup:jsoup:1.13.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ private CheckForNewAppVersion() { }
private static final String NEWPIPE_API_URL = "https://newpipe.schabi.org/api/data.json";

/**
* Method to get the apk's SHA1 key. See https://stackoverflow.com/questions/9293019/#22506133.
* Method to get the APK's SHA1 key. See https://stackoverflow.com/questions/9293019/#22506133.
*
* @param application The application
* @return String with the apk's SHA1 fingeprint in hexadecimal
* @return String with the APK's SHA1 fingerprint in hexadecimal
*/
@NonNull
private static String getCertificateSHA1Fingerprint(@NonNull final Application application) {
Expand Down
25 changes: 22 additions & 3 deletions app/src/main/java/org/schabi/newpipe/ktx/OffsetDateTime.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
package org.schabi.newpipe.ktx

import java.time.OffsetDateTime
import java.time.ZoneId
import java.time.ZoneOffset
import java.time.temporal.ChronoField
import java.util.Calendar
import java.util.Date
import java.util.GregorianCalendar
import java.util.TimeZone

fun OffsetDateTime.toCalendar(zoneId: ZoneId = ZoneId.systemDefault()): Calendar {
return GregorianCalendar.from(if (zoneId != offset) atZoneSameInstant(zoneId) else toZonedDateTime())
// This method is a modified version of GregorianCalendar.from(ZonedDateTime).
// Math.addExact() and Math.multiplyExact() are desugared even though lint displays a warning.
@SuppressWarnings("NewApi")
fun OffsetDateTime.toCalendar(): Calendar {
val cal = GregorianCalendar(TimeZone.getTimeZone("UTC"))
val offsetDateTimeUTC = withOffsetSameInstant(ZoneOffset.UTC)
cal.gregorianChange = Date(Long.MIN_VALUE)
cal.firstDayOfWeek = Calendar.MONDAY
cal.minimalDaysInFirstWeek = 4
try {
cal.timeInMillis = Math.addExact(
Math.multiplyExact(offsetDateTimeUTC.toEpochSecond(), 1000),
offsetDateTimeUTC[ChronoField.MILLI_OF_SECOND].toLong()
)
} catch (ex: ArithmeticException) {
throw IllegalArgumentException(ex)
}
return cal
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface ImportExportEventListener {
void onSizeReceived(int size);

/**
* Called everytime an item has been parsed/resolved.
* Called every time an item has been parsed/resolved.
*
* @param itemName the name of the subscription item
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ public void onShuffleClicked() {

public void onMuteUnmuteButtonClicked() {
if (DEBUG) {
Log.d(TAG, "onMuteUnmuteButtonClicled() called");
Log.d(TAG, "onMuteUnmuteButtonClicked() called");
}
simpleExoPlayer.setVolume(isMuted() ? 1 : 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ public void onProgressUpdate(final int currentProgress, final int duration,
progressLiveSync.setClickable(!player.isLiveEdge());
}

// this will make shure progressCurrentTime has the same width as progressEndTime
// this will make sure progressCurrentTime has the same width as progressEndTime
final ViewGroup.LayoutParams endTimeParams = progressEndTime.getLayoutParams();
final ViewGroup.LayoutParams currentTimeParams = progressCurrentTime.getLayoutParams();
currentTimeParams.width = progressEndTime.getWidth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public LoadController() {
}

private LoadController(final int initialPlaybackBufferMs,
final int minimumPlaybackbufferMs,
final int minimumPlaybackBufferMs,
final int optimalPlaybackBufferMs) {
this.initialPlaybackBufferUs = initialPlaybackBufferMs * 1000;

final DefaultLoadControl.Builder builder = new DefaultLoadControl.Builder();
builder.setBufferDurationsMs(minimumPlaybackbufferMs, optimalPlaybackBufferMs,
builder.setBufferDurationsMs(minimumPlaybackBufferMs, optimalPlaybackBufferMs,
initialPlaybackBufferMs, initialPlaybackBufferMs);
internalLoadControl = builder.createDefaultLoadControl();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ public void dispose() {
fetchReactor = null;
}

private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infos) {
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
final List<PlayQueueItem> result = new ArrayList<>();
for (final InfoItem stream : infos) {
for (final InfoItem stream : infoItems) {
if (stream instanceof StreamInfoItem) {
result.add(new PlayQueueItem((StreamInfoItem) stream));
}
Expand Down
Loading

0 comments on commit 8e7238c

Please sign in to comment.