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

Commit 0da8d00

Browse files
Merge branch 'master' into sponsorblock
# Conflicts: # app/src/main/res/values-es/strings.xml # app/src/main/res/values-it/strings.xml # app/src/main/res/values-zh-rTW/strings.xml # app/src/main/res/values/strings.xml
2 parents 8a241cd + a95a5ed commit 0da8d00

File tree

184 files changed

+3610
-1107
lines changed

Some content is hidden

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

184 files changed

+3610
-1107
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You'll see *exactly* what is sent, be able to add **your comments**, and then se
2222

2323
* NewPipe is translated via [Weblate](https://hosted.weblate.org/projects/newpipe/strings/). Log in there with your GitHub account, or register.
2424
* Add the language you want to translate if it is not there already: see [How to add a new language](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-add-a-new-language-to-NewPipe) in the wiki.
25+
* NewPipe uses the [PrettyTime](https://github.com/ocpsoft/prettytime) library to display localized versions of dates and times. It needs to be translated, too. Read [these instructions to add a new language](https://www.ocpsoft.org/prettytime/#section-14) and [this issue](https://github.com/TeamNewPipe/NewPipe/issues/9134) for more info.
2526

2627
## Code contribution
2728

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature request
22
description: Suggest an idea for this project
3-
labels: [enhancement, needs triage]
3+
labels: [feature request, needs triage]
44
body:
55
- type: markdown
66
attributes:

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ plugins {
88
}
99

1010
android {
11-
compileSdk 31
12-
buildToolsVersion '31.0.0'
11+
compileSdk 32
12+
namespace 'org.schabi.newpipe'
1313

1414
defaultConfig {
1515
applicationId "org.polymorphicshade.newpipe"
1616
resValue "string", "app_name", "NewPipe SponsorBlock"
1717
minSdk 21
1818
targetSdk 29
19-
versionCode 990
20-
versionName "0.24.0"
19+
versionCode 991
20+
versionName "0.24.1"
2121

2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323

@@ -187,7 +187,7 @@ dependencies {
187187
// name and the commit hash with the commit hash of the (pushed) commit you want to test
188188
// This works thanks to JitPack: https://jitpack.io/
189189
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
190-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:5c710da160f488bb40ab2cf4469bec9bd4cefd38'
190+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:eb07d70a2ce03bee3cc74fc33b2e4173e1c21436'
191191
implementation 'com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'
192192

193193
/** Checkstyle **/
@@ -198,7 +198,7 @@ dependencies {
198198
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
199199

200200
/** AndroidX **/
201-
implementation 'androidx.appcompat:appcompat:1.4.2'
201+
implementation 'androidx.appcompat:appcompat:1.5.1'
202202
implementation 'androidx.cardview:cardview:1.0.0'
203203
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
204204
implementation 'androidx.core:core-ktx:1.8.0'
@@ -271,7 +271,7 @@ dependencies {
271271
implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0"
272272

273273
// Date and time formatting
274-
implementation "org.ocpsoft.prettytime:prettytime:5.0.3.Final"
274+
implementation "org.ocpsoft.prettytime:prettytime:5.0.6.Final"
275275

276276
/** Debugging **/
277277
// Memory leak detection

app/src/debug/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:tools="http://schemas.android.com/tools"
5-
package="org.schabi.newpipe">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
64

75
<application
86
android:name=".DebugApp"

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.schabi.newpipe"
54
android:installLocation="auto">
65

76
<uses-permission android:name="android.permission.INTERNET" />
@@ -14,6 +13,9 @@
1413
<uses-feature
1514
android:name="android.hardware.touchscreen"
1615
android:required="false" />
16+
<uses-feature
17+
android:name="android.software.leanback"
18+
android:required="false" />
1719

1820
<application
1921
android:name=".App"
@@ -148,6 +150,7 @@
148150
<data android:pathPrefix="/channel/" />
149151
<data android:pathPrefix="/user/" />
150152
<data android:pathPrefix="/c/" />
153+
<data android:pathPrefix="/@" />
151154
<!-- playlist prefix -->
152155
<data android:pathPrefix="/playlist" />
153156
</intent-filter>

app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class AboutActivity : AppCompatActivity() {
7878
aboutDonationLink.openLink(R.string.donation_url)
7979
aboutWebsiteLink.openLink(R.string.website_url)
8080
aboutPrivacyPolicyLink.openLink(R.string.privacy_policy_url)
81+
faqLink.openLink(R.string.faq_url)
8182
return root
8283
}
8384
}

app/src/main/java/org/schabi/newpipe/database/feed/dao/FeedDAO.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ abstract class FeedDAO {
4848
ON s.uid = f.stream_id
4949
5050
LEFT JOIN feed_group_subscription_join fgs
51-
ON fgs.subscription_id = f.subscription_id
51+
ON (
52+
:groupId <> ${FeedGroupEntity.GROUP_ALL_ID}
53+
AND fgs.subscription_id = f.subscription_id
54+
)
5255
5356
WHERE (
5457
:groupId = ${FeedGroupEntity.GROUP_ALL_ID}

app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ public class DownloadDialog extends DialogFragment
148148
// Instance creation
149149
//////////////////////////////////////////////////////////////////////////*/
150150

151+
public DownloadDialog() {
152+
// Just an empty default no-arg ctor to keep Fragment.instantiate() happy
153+
// otherwise InstantiationException will be thrown when fragment is recreated
154+
// TODO: Maybe use a custom FragmentFactory instead?
155+
}
156+
151157
/**
152158
* Create a new download dialog with the video, audio and subtitle streams from the provided
153159
* stream info. Video streams and video-only streams will be put into a single list menu,
@@ -156,7 +162,7 @@ public class DownloadDialog extends DialogFragment
156162
* @param context the context to use just to obtain preferences and strings (will not be stored)
157163
* @param info the info from which to obtain downloadable streams and other info (e.g. title)
158164
*/
159-
public DownloadDialog(final Context context, @NonNull final StreamInfo info) {
165+
public DownloadDialog(@NonNull final Context context, @NonNull final StreamInfo info) {
160166
this.currentInfo = info;
161167

162168
// TODO: Adapt this code when the downloader support other types of stream deliveries

app/src/main/java/org/schabi/newpipe/error/ErrorPanelHelper.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import org.schabi.newpipe.ktx.animate
3030
import org.schabi.newpipe.ktx.isInterruptedCaused
3131
import org.schabi.newpipe.ktx.isNetworkRelated
3232
import org.schabi.newpipe.util.ServiceHelper
33+
import org.schabi.newpipe.util.external_communication.ShareUtils
3334
import java.util.concurrent.TimeUnit
3435

3536
class ErrorPanelHelper(
@@ -52,6 +53,8 @@ class ErrorPanelHelper(
5253
errorPanelRoot.findViewById(R.id.error_action_button)
5354
private val errorRetryButton: Button =
5455
errorPanelRoot.findViewById(R.id.error_retry_button)
56+
private val errorOpenInBrowserButton: Button =
57+
errorPanelRoot.findViewById(R.id.error_open_in_browser)
5558

5659
private var errorDisposable: Disposable? = null
5760

@@ -69,6 +72,7 @@ class ErrorPanelHelper(
6972
errorServiceExplanationTextView.isVisible = false
7073
errorActionButton.isVisible = false
7174
errorRetryButton.isVisible = false
75+
errorOpenInBrowserButton.isVisible = false
7276
}
7377

7478
fun showError(errorInfo: ErrorInfo) {
@@ -99,6 +103,7 @@ class ErrorPanelHelper(
99103
}
100104

101105
errorRetryButton.isVisible = true
106+
showAndSetOpenInBrowserButtonAction(errorInfo)
102107
} else if (errorInfo.throwable is AccountTerminatedException) {
103108
errorTextView.setText(R.string.account_terminated)
104109

@@ -128,6 +133,7 @@ class ErrorPanelHelper(
128133
// show retry button only for content which is not unavailable or unsupported
129134
errorRetryButton.isVisible = true
130135
}
136+
showAndSetOpenInBrowserButtonAction(errorInfo)
131137
}
132138

133139
setRootVisible()
@@ -145,6 +151,15 @@ class ErrorPanelHelper(
145151
errorActionButton.setOnClickListener(listener)
146152
}
147153

154+
fun showAndSetOpenInBrowserButtonAction(
155+
errorInfo: ErrorInfo
156+
) {
157+
errorOpenInBrowserButton.isVisible = true
158+
errorOpenInBrowserButton.setOnClickListener {
159+
ShareUtils.openUrlInBrowser(context, errorInfo.request, true)
160+
}
161+
}
162+
148163
fun showTextError(errorString: String) {
149164
ensureDefaultVisibility()
150165

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ && isAutoplayEnabled()
254254
autoPlayEnabled = true; // forcefully start playing
255255
openVideoPlayerAutoFullscreen();
256256
}
257+
updateOverlayPlayQueueButtonVisibility();
257258
}
258259

259260
@Override
@@ -343,6 +344,8 @@ public void onResume() {
343344

344345
activity.sendBroadcast(new Intent(ACTION_VIDEO_FRAGMENT_RESUMED));
345346

347+
updateOverlayPlayQueueButtonVisibility();
348+
346349
setupBrightness();
347350

348351
if (tabSettingsChanged) {
@@ -535,6 +538,9 @@ public void onClick(final View v) {
535538
case R.id.overlay_buttons_layout:
536539
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
537540
break;
541+
case R.id.overlay_play_queue_button:
542+
NavigationHelper.openPlayQueue(getContext());
543+
break;
538544
case R.id.overlay_play_pause_button:
539545
if (playerIsNotStopped()) {
540546
player.playPause();
@@ -693,6 +699,7 @@ protected void initListeners() {
693699
binding.overlayMetadataLayout.setOnClickListener(this);
694700
binding.overlayMetadataLayout.setOnLongClickListener(this);
695701
binding.overlayButtonsLayout.setOnClickListener(this);
702+
binding.overlayPlayQueueButton.setOnClickListener(this);
696703
binding.overlayCloseButton.setOnClickListener(this);
697704
binding.overlayPlayPauseButton.setOnClickListener(this);
698705

@@ -1857,6 +1864,14 @@ public void onQueueUpdate(final PlayQueue queue) {
18571864
+ title + "], playQueue = [" + playQueue + "]");
18581865
}
18591866

1867+
// Register broadcast receiver to listen to playQueue changes
1868+
// and hide the overlayPlayQueueButton when the playQueue is empty / destroyed.
1869+
if (playQueue != null && playQueue.getBroadcastReceiver() != null) {
1870+
playQueue.getBroadcastReceiver().subscribe(
1871+
event -> updateOverlayPlayQueueButtonVisibility()
1872+
);
1873+
}
1874+
18601875
// This should be the only place where we push data to stack.
18611876
// It will allow to have live instance of PlayQueue with actual information about
18621877
// deleted/added items inside Channel/Playlist queue and makes possible to have
@@ -1963,6 +1978,7 @@ public void onServiceStopped() {
19631978
currentInfo.getUploaderName(),
19641979
currentInfo.getThumbnailUrl());
19651980
}
1981+
updateOverlayPlayQueueButtonVisibility();
19661982
}
19671983

19681984
@Override
@@ -2429,6 +2445,18 @@ public void onSlide(@NonNull final View bottomSheet, final float slideOffset) {
24292445
});
24302446
}
24312447

2448+
private void updateOverlayPlayQueueButtonVisibility() {
2449+
final boolean isPlayQueueEmpty =
2450+
player == null // no player => no play queue :)
2451+
|| player.getPlayQueue() == null
2452+
|| player.getPlayQueue().isEmpty();
2453+
if (binding != null) {
2454+
// binding is null when rotating the device...
2455+
binding.overlayPlayQueueButton.setVisibility(
2456+
isPlayQueueEmpty ? View.GONE : View.VISIBLE);
2457+
}
2458+
}
2459+
24322460
private void updateOverlayData(@Nullable final String overlayTitle,
24332461
@Nullable final String uploader,
24342462
@Nullable final String thumbnailUrl) {
@@ -2467,6 +2495,7 @@ private void setOverlayElementsClickable(final boolean enable) {
24672495
binding.overlayMetadataLayout.setClickable(enable);
24682496
binding.overlayMetadataLayout.setLongClickable(enable);
24692497
binding.overlayButtonsLayout.setClickable(enable);
2498+
binding.overlayPlayQueueButton.setClickable(enable);
24702499
binding.overlayPlayPauseButton.setClickable(enable);
24712500
binding.overlayCloseButton.setClickable(enable);
24722501
}

0 commit comments

Comments
 (0)