Skip to content

Commit 1e8efa7

Browse files
authored
Merge pull request #10283 from TeamNewPipe/release/0.25.2
Release v0.25.2 (994)
2 parents 4a33ee6 + d4019f4 commit 1e8efa7

346 files changed

Lines changed: 8246 additions & 2261 deletions

File tree

Some content is hidden

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

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
### Please do **not** open pull requests for *new features* now, as we are planning to rewrite large chunks of the code. Only bugfix PRs will be accepted. More details will be announced soon!
2+
13
NewPipe contribution guidelines
24
===============================
35

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Question
22
description: Ask about anything NewPipe-related
3-
labels: [question, needs triage]
3+
labels: [question]
44
body:
55
- type: markdown
66
attributes:
77
value: |
8-
Thanks for taking the time to fill out this issue! :hugs:
8+
Thanks for taking the time to fill out this form! :hugs:
99
1010
Note that you can also ask questions on our [IRC channel](https://web.libera.chat/#newpipe).
1111
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: "Checklist"
1616
options:
17-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/TeamNewPipe/NewPipe/issues) or [closed](https://github.com/TeamNewPipe/NewPipe/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
17+
- label: "I made sure that there are *no existing issues or discussions* - [open](https://github.com/TeamNewPipe/NewPipe/issues) or [closed](https://github.com/TeamNewPipe/NewPipe/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1818
required: true
1919
- label: "I have read the [FAQ](https://newpipe.net/FAQ/) and my question isn't listed."
2020
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: ❓ Question
4+
url: https://github.com/TeamNewPipe/NewPipe/discussions/new?category=questions
5+
about: Ask about anything NewPipe-related
36
- name: 💬 IRC
47
url: https://web.libera.chat/#newpipe
58
about: Chat with us via IRC for quick Q/A

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#### APK testing
2929
<!-- Use a new, meaningfully named branch. The name is used as a suffix for the app ID to allow installing and testing multiple versions of NewPipe, e.g. "commentfix", if your PR implements a bugfix for comments. (No names like "patch-0" and "feature-1".) -->
3030
<!-- Remove the following line if you directly link the APK created by the CI pipeline. Directly linking is preferred if you need to let users test.-->
31-
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
31+
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration [on this wiki page](https://github.com/TeamNewPipe/NewPipe/wiki/Download-APK-for-PR).
3232

3333
#### Due diligence
3434
- [ ] I read the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md).

.github/workflows/ci.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ jobs:
4242
- name: create and checkout branch
4343
# push events already checked out the branch
4444
if: github.event_name == 'pull_request'
45-
run: git checkout -B ${{ github.head_ref }}
45+
env:
46+
BRANCH: ${{ github.head_ref }}
47+
run: git checkout -B "$BRANCH"
4648

47-
- name: set up JDK 11
49+
- name: set up JDK 17
4850
uses: actions/setup-java@v3
4951
with:
50-
java-version: 11
52+
java-version: 17
5153
distribution: "temurin"
5254
cache: 'gradle'
5355

@@ -66,28 +68,33 @@ jobs:
6668
timeout-minutes: 20
6769
strategy:
6870
matrix:
69-
# api-level 19 is min sdk, but throws errors related to desugaring
70-
api-level: [ 21, 29 ]
71+
include:
72+
- api-level: 21
73+
target: default
74+
arch: x86
75+
- api-level: 33
76+
target: google_apis # emulator API 33 only exists with Google APIs
77+
arch: x86_64
7178

7279
permissions:
7380
contents: read
7481

7582
steps:
7683
- uses: actions/checkout@v3
7784

78-
- name: set up JDK 11
85+
- name: set up JDK 17
7986
uses: actions/setup-java@v3
8087
with:
81-
java-version: 11
88+
java-version: 17
8289
distribution: "temurin"
8390
cache: 'gradle'
8491

8592
- name: Run android tests
8693
uses: reactivecircus/android-emulator-runner@v2
8794
with:
8895
api-level: ${{ matrix.api-level }}
89-
# workaround to emulator bug: https://github.com/ReactiveCircus/android-emulator-runner/issues/160
90-
emulator-build: 7425822
96+
target: ${{ matrix.target }}
97+
arch: ${{ matrix.arch }}
9198
script: ./gradlew connectedCheck --stacktrace
9299

93100
- name: Upload test report when tests fail # because the printed out stacktrace (console) is too short, see also #7553
@@ -108,10 +115,10 @@ jobs:
108115
with:
109116
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
110117

111-
- name: Set up JDK 11
118+
- name: Set up JDK 17
112119
uses: actions/setup-java@v3
113120
with:
114-
java-version: 11 # Sonar requires JDK 11
121+
java-version: 17
115122
distribution: "temurin"
116123
cache: 'gradle'
117124

.github/workflows/image-minimizer.js

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ module.exports = async ({github, context}) => {
1717
initialBody = context.payload.comment.body;
1818
} else if (context.eventName == 'issues') {
1919
initialBody = context.payload.issue.body;
20+
} else if (context.eventName == 'pull_request') {
21+
initialBody = context.payload.pull_request.body;
2022
} else {
2123
console.log('Aborting: No body found');
2224
return;
@@ -30,10 +32,12 @@ module.exports = async ({github, context}) => {
3032
}
3133

3234
// Regex for finding images (simple variant) ![ALT_TEXT](https://*.githubusercontent.com/<number>/<variousHexStringsAnd->.<fileExtension>)
33-
const REGEX_IMAGE_LOOKUP = /\!\[(.*)\]\((https:\/\/[-a-z0-9]+\.githubusercontent\.com\/\d+\/[-0-9a-f]{32,512}\.(jpg|gif|png))\)/gm;
35+
const REGEX_USER_CONTENT_IMAGE_LOOKUP = /\!\[(.*)\]\((https:\/\/[-a-z0-9]+\.githubusercontent\.com\/\d+\/[-0-9a-f]{32,512}\.(jpg|gif|png))\)/gm;
36+
const REGEX_ASSETS_IMAGE_LOCKUP = /\!\[(.*)\]\((https:\/\/github\.com\/[-\w\d]+\/[-\w\d]+\/assets\/\d+\/[\-0-9a-f]{32,512})\)/gm;
3437

3538
// Check if we found something
36-
let foundSimpleImages = REGEX_IMAGE_LOOKUP.test(initialBody);
39+
let foundSimpleImages = REGEX_USER_CONTENT_IMAGE_LOOKUP.test(initialBody)
40+
|| REGEX_ASSETS_IMAGE_LOCKUP.test(initialBody);
3741
if (!foundSimpleImages) {
3842
console.log('Found no simple images to process');
3943
return;
@@ -47,53 +51,8 @@ module.exports = async ({github, context}) => {
4751
var wasMatchModified = false;
4852

4953
// Try to find and replace the images with minimized ones
50-
let newBody = await replaceAsync(initialBody, REGEX_IMAGE_LOOKUP, async (match, g1, g2) => {
51-
console.log(`Found match '${match}'`);
52-
53-
if (g1.endsWith(IGNORE_ALT_NAME_END)) {
54-
console.log(`Ignoring match '${match}': IGNORE_ALT_NAME_END`);
55-
return match;
56-
}
57-
58-
let probeAspectRatio = 0;
59-
let shouldModify = false;
60-
try {
61-
console.log(`Probing ${g2}`);
62-
let probeResult = await probe(g2);
63-
if (probeResult == null) {
64-
throw 'No probeResult';
65-
}
66-
if (probeResult.hUnits != 'px') {
67-
throw `Unexpected probeResult.hUnits (expected px but got ${probeResult.hUnits})`;
68-
}
69-
if (probeResult.height <= 0) {
70-
throw `Unexpected probeResult.height (height is invalid: ${probeResult.height})`;
71-
}
72-
if (probeResult.wUnits != 'px') {
73-
throw `Unexpected probeResult.wUnits (expected px but got ${probeResult.wUnits})`;
74-
}
75-
if (probeResult.width <= 0) {
76-
throw `Unexpected probeResult.width (width is invalid: ${probeResult.width})`;
77-
}
78-
console.log(`Probing resulted in ${probeResult.width}x${probeResult.height}px`);
79-
80-
probeAspectRatio = probeResult.width / probeResult.height;
81-
shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && probeAspectRatio < MIN_ASPECT_RATIO;
82-
} catch(e) {
83-
console.log('Probing failed:', e);
84-
// Immediately abort
85-
return match;
86-
}
87-
88-
if (shouldModify) {
89-
wasMatchModified = true;
90-
console.log(`Modifying match '${match}'`);
91-
return `<img alt="${g1}" src="${g2}" width=${Math.min(600, (IMG_MAX_HEIGHT_PX * probeAspectRatio).toFixed(0))} />`;
92-
}
93-
94-
console.log(`Match '${match}' is ok/will not be modified`);
95-
return match;
96-
});
54+
let newBody = await replaceAsync(initialBody, REGEX_USER_CONTENT_IMAGE_LOOKUP, minimizeAsync);
55+
newBody = await replaceAsync(newBody, REGEX_ASSETS_IMAGE_LOCKUP, minimizeAsync);
9756

9857
if (!wasMatchModified) {
9958
console.log('Nothing was modified. Skipping update');
@@ -117,6 +76,14 @@ module.exports = async ({github, context}) => {
11776
repo: context.repo.repo,
11877
body: newBody
11978
});
79+
} else if (context.eventName == 'pull_request') {
80+
console.log('Updating pull request', context.payload.pull_request.number);
81+
await github.rest.pulls.update({
82+
pull_number: context.payload.pull_request.number,
83+
owner: context.repo.owner,
84+
repo: context.repo.repo,
85+
body: newBody
86+
});
12087
}
12188

12289
// Asnyc replace function from https://stackoverflow.com/a/48032528
@@ -129,4 +96,52 @@ module.exports = async ({github, context}) => {
12996
const data = await Promise.all(promises);
13097
return str.replace(regex, () => data.shift());
13198
}
99+
100+
async function minimizeAsync(match, g1, g2) {
101+
console.log(`Found match '${match}'`);
102+
103+
if (g1.endsWith(IGNORE_ALT_NAME_END)) {
104+
console.log(`Ignoring match '${match}': IGNORE_ALT_NAME_END`);
105+
return match;
106+
}
107+
108+
let probeAspectRatio = 0;
109+
let shouldModify = false;
110+
try {
111+
console.log(`Probing ${g2}`);
112+
let probeResult = await probe(g2);
113+
if (probeResult == null) {
114+
throw 'No probeResult';
115+
}
116+
if (probeResult.hUnits != 'px') {
117+
throw `Unexpected probeResult.hUnits (expected px but got ${probeResult.hUnits})`;
118+
}
119+
if (probeResult.height <= 0) {
120+
throw `Unexpected probeResult.height (height is invalid: ${probeResult.height})`;
121+
}
122+
if (probeResult.wUnits != 'px') {
123+
throw `Unexpected probeResult.wUnits (expected px but got ${probeResult.wUnits})`;
124+
}
125+
if (probeResult.width <= 0) {
126+
throw `Unexpected probeResult.width (width is invalid: ${probeResult.width})`;
127+
}
128+
console.log(`Probing resulted in ${probeResult.width}x${probeResult.height}px`);
129+
130+
probeAspectRatio = probeResult.width / probeResult.height;
131+
shouldModify = probeResult.height > IMG_MAX_HEIGHT_PX && probeAspectRatio < MIN_ASPECT_RATIO;
132+
} catch(e) {
133+
console.log('Probing failed:', e);
134+
// Immediately abort
135+
return match;
136+
}
137+
138+
if (shouldModify) {
139+
wasMatchModified = true;
140+
console.log(`Modifying match '${match}'`);
141+
return `<img alt="${g1}" src="${g2}" width=${Math.min(600, (IMG_MAX_HEIGHT_PX * probeAspectRatio).toFixed(0))} />`;
142+
}
143+
144+
console.log(`Match '${match}' is ok/will not be modified`);
145+
return match;
146+
}
132147
}

.github/workflows/image-minimizer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
types: [created, edited]
66
issues:
77
types: [opened, edited]
8+
pull_request:
9+
types: [opened, edited]
810

911
permissions:
1012
issues: write

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<h3 align="center">We are planning to <i>rewrite</i> large chunks of the codebase, to bring about <a href="https://github.com/TeamNewPipe/NewPipe/discussions/10118">a new, modern and stable NewPipe</a>!</h3>
2+
<h4 align="center">Please do <b>not</b> open pull requests for <i>new features</i> now, only bugfix PRs will be accepted.</h4>
3+
14
<p align="center"><a href="https://newpipe.net"><img src="assets/new_pipe_icon_5.png" width="150"></a></p>
25
<h2 align="center"><b>NewPipe</b></h2>
36
<h4 align="center">A libre lightweight streaming front-end for Android.</h4>
@@ -17,26 +20,26 @@
1720
<p align="center"><a href="https://newpipe.net">Website</a> &bull; <a href="https://newpipe.net/blog/">Blog</a> &bull; <a href="https://newpipe.net/FAQ/">FAQ</a> &bull; <a href="https://newpipe.net/press/">Press</a></p>
1821
<hr>
1922

20-
*Read this in other languages: [English](README.md), [Español](doc/README.es.md), [हिन्दी](doc/README.hi.md), [한국어](doc/README.ko.md), [Soomaali](doc/README.so.md), [Português Brasil](doc/README.pt_BR.md), [Polski](doc/README.pl.md), [日本語](doc/README.ja.md), [Română](doc/README.ro.md), [Türkçe](doc/README.tr.md), [正體中文](doc/README.zh_TW.md).*
23+
*Read this document in other languages: [Deutsch](doc/README.de.md), [English](README.md), [Español](doc/README.es.md), [Français](doc/README.fr.md), [हिन्दी](doc/README.hi.md), [Italiano](doc/README.it.md), [한국어](doc/README.ko.md), [Português Brasil](doc/README.pt_BR.md), [Polski](doc/README.pl.md), [ਪੰਜਾਬੀ ](doc/README.pa.md), [日本語](doc/README.ja.md), [Română](doc/README.ro.md), [Soomaali](doc/README.so.md), [Türkçe](doc/README.tr.md), [正體中文](doc/README.zh_TW.md), [অসমীয়া](doc/README.asm.md)*
2124

2225
<b>WARNING: THIS APP IS IN BETA, SO YOU MAY ENCOUNTER BUGS. IF YOU DO, OPEN AN ISSUE IN OUR GITHUB REPOSITORY BY FILLING OUT THE ISSUE TEMPLATE.</b>
2326

2427
<b>PUTTING NEWPIPE, OR ANY FORK OF IT, INTO THE GOOGLE PLAY STORE VIOLATES THEIR TERMS AND CONDITIONS.</b>
2528

2629
## Screenshots
2730

28-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_01.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_01.png)
29-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_02.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_02.png)
30-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_03.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_03.png)
31-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_04.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_04.png)
32-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_05.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_05.png)
33-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_06.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_06.png)
34-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_07.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_07.png)
35-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_08.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_08.png)
36-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_09.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_09.png)
37-
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_10.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_10.png)
38-
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_11.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_11.png)
39-
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_12.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_12.png)
31+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/00.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/00.png)
32+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/01.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/01.png)
33+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/02.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/02.png)
34+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/03.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/03.png)
35+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/04.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/04.png)
36+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/05.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/05.png)
37+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/06.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/06.png)
38+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/07.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/07.png)
39+
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/08.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/08.png)
40+
<br/><br/>
41+
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/09.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/09.png)
42+
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/10.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/10.png)
4043

4144
### Supported Services
4245

0 commit comments

Comments
 (0)