Skip to content

Commit 51a749a

Browse files
Merge branch 'refactor' into History-Compose
# Conflicts: # app/src/androidTest/java/org/schabi/newpipe/database/FeedDAOTest.kt # app/src/main/java/org/schabi/newpipe/local/feed/FeedDatabaseManager.kt # app/src/main/java/org/schabi/newpipe/local/feed/service/FeedLoadManager.kt # app/src/main/java/org/schabi/newpipe/settings/BackupRestoreSettingsFragment.java # app/src/main/java/org/schabi/newpipe/ui/components/about/LicenseDialog.kt # app/src/main/java/org/schabi/newpipe/ui/components/items/ItemList.kt # app/src/main/java/org/schabi/newpipe/ui/components/items/playlist/PlaylistListItem.kt # app/src/main/java/org/schabi/newpipe/ui/components/items/stream/StreamThumbnail.kt # app/src/main/java/org/schabi/newpipe/ui/components/video/RelatedItems.kt
2 parents 5e88ac4 + 50b9a7b commit 51a749a

332 files changed

Lines changed: 3768 additions & 3472 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.

.editorconfig

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,13 @@
66
root = true
77

88
[*.{kt,kts}]
9+
ktlint_code_style = android_studio
10+
# https://pinterest.github.io/ktlint/latest/rules/standard/#function-naming
911
ktlint_function_naming_ignore_when_annotated_with = Composable
10-
ktlint_standard_annotation = disabled
11-
ktlint_standard_argument-list-wrapping = disabled
12-
ktlint_standard_backing-property-naming = disabled
13-
ktlint_standard_blank-line-before-declaration = disabled
14-
ktlint_standard_blank-line-between-when-conditions = disabled
15-
ktlint_standard_chain-method-continuation = disabled
12+
1613
ktlint_standard_class-signature = disabled
17-
ktlint_standard_comment-wrapping = disabled
18-
ktlint_standard_enum-wrapping = disabled
1914
ktlint_standard_function-expression-body = disabled
20-
ktlint_standard_function-literal = disabled
21-
ktlint_standard_function-signature = disabled
22-
ktlint_standard_indent = disabled
23-
ktlint_standard_kdoc = disabled
2415
ktlint_standard_max-line-length = disabled
2516
ktlint_standard_mixed-condition-operators = disabled
26-
ktlint_standard_multiline-expression-wrapping = disabled
27-
ktlint_standard_multiline-if-else = disabled
28-
ktlint_standard_no-blank-line-in-list = disabled
29-
ktlint_standard_no-consecutive-comments = disabled
30-
ktlint_standard_no-empty-first-line-in-class-body = disabled
31-
ktlint_standard_no-empty-first-line-in-method-block = disabled
32-
ktlint_standard_no-line-break-after-else = disabled
33-
ktlint_standard_no-semi = disabled
34-
ktlint_standard_no-single-line-block-comment = disabled
3517
ktlint_standard_package-name = disabled
36-
ktlint_standard_parameter-list-wrapping = disabled
3718
ktlint_standard_property-naming = disabled
38-
ktlint_standard_spacing-between-declarations-with-annotations = disabled
39-
ktlint_standard_spacing-between-declarations-with-comments = disabled
40-
ktlint_standard_statement-wrapping = disabled
41-
ktlint_standard_string-template-indent = disabled
42-
ktlint_standard_trailing-comma-on-call-site = disabled
43-
ktlint_standard_trailing-comma-on-declaration-site = disabled
44-
ktlint_standard_try-catch-finally-spacing = disabled
45-
ktlint_standard_when-entry-bracing = disabled

.github/CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
NewPipe contribution guidelines
44
===============================
55

6+
## AI policy
7+
8+
* Using generative AI to develop new features or making larger code changes is generally prohibited. Please refrain from contributions which are heavily depending on AI generated source code because they are usually lacking a fundamental understanding of the overall project structure and thus come with poor quality. However, you are allowed to use gen. AI if you
9+
* are aware of the project structure,
10+
* ensure that the generated code follows the project structure,
11+
* fully understand the generated code, and
12+
* review the generated code completely.
13+
* Using AI to find the root cause of bugs and generating small fixes might be acceptable. However, gen. AI often does not fix the underlying problem but is trying to fix the symptoms. If you are using AI to fix bugs, ensure that the root cause is tackled.
14+
* The use of AI to generate documentation is allowed. We ask you to thoroughly check the quality of generated documentation – wrong, misleading or uninformative documentation is useless and wastes the reader's time. Ensure that reasoning is documented.
15+
* Using generative AI to write or fill in PR or issue templates is prohibited. Those texts are often lengthy and miss critical information.
16+
* PRs and issues that do not follow this AI policy can be closed without further explanation.
17+
18+
619
## Crash reporting
720

821
Report crashes through the **automated crash report system** of NewPipe.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ body:
2626
required: true
2727
- label: "I have read and understood the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md)."
2828
required: true
29+
- label: "I have read and understood the [AI policy](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#ai-policy). The content of this bug report is not generated by AI."
30+
required: true
2931

3032
- type: input
3133
id: app-version

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ body:
2525
required: true
2626
- label: "I have read and understood the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md)."
2727
required: true
28+
- label: "I have read and understood the [AI policy](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#ai-policy). The content of this request is not generated by AI."
29+
required: true
2830

2931

3032
- type: textarea

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ The APK can be found by going to the "Checks" tab below the title. On the left p
3232

3333
#### Due diligence
3434
- [ ] I read the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md).
35+
- [ ] The proposed changes follow the [AI policy](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md#ai-policy).
36+
- [ ] I tested the changes using an emulator or a physical device.

.github/workflows/backport-pr.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Backport merged pull request
2+
on:
3+
issue_comment:
4+
types: [created]
5+
permissions:
6+
contents: write # for comment creation on original PR
7+
pull-requests: write
8+
jobs:
9+
backport:
10+
name: Backport pull request
11+
runs-on: ubuntu-latest
12+
13+
# Only run when the comment starts with the `/backport` command on a PR and
14+
# the commenter has write access to the repository. We do not want to allow
15+
# everybody to trigger backports and create branches in our repository.
16+
if: >
17+
github.event.issue.pull_request &&
18+
startsWith(github.event.comment.body, '/backport ') &&
19+
(
20+
github.event.comment.author_association == 'OWNER' ||
21+
github.event.comment.author_association == 'COLLABORATOR' ||
22+
github.event.comment.author_association == 'MEMBER'
23+
)
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Get backport metadata
27+
# the target branch is the first argument after `/backport`
28+
env:
29+
COMMENT_BODY: ${{ github.event.comment.body }}
30+
run: |
31+
set -euo pipefail
32+
body="$COMMENT_BODY"
33+
34+
line=${body%%$'\n'*} # Get the first line
35+
if [[ $line =~ ^/backport[[:space:]]+([^[:space:]]+) ]]; then
36+
echo "BACKPORT_TARGET=${BASH_REMATCH[1]}" >> "$GITHUB_ENV"
37+
else
38+
echo "Usage: /backport <target-branch>" >&2
39+
exit 1
40+
fi
41+
42+
- name: Create backport pull request
43+
uses: korthout/backport-action@v4
44+
with:
45+
add_labels: 'backport'
46+
copy_labels_pattern: '.*'
47+
label_pattern: ''
48+
target_branches: ${{ env.BACKPORT_TARGET }}

.github/workflows/build-release-apk.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
release:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111
with:
1212
ref: 'master'
1313

14-
- uses: actions/setup-java@v4
14+
- uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
1717
java-version: '21'
@@ -32,7 +32,7 @@ jobs:
3232
mv app/build/outputs/apk/release/*.apk "app/build/outputs/apk/release/NewPipe_v$VERSION_NAME.apk"
3333
3434
- name: "Upload APK"
35-
uses: actions/upload-artifact@v4
35+
uses: actions/upload-artifact@v6
3636
with:
3737
name: app
3838
path: app/build/outputs/apk/release/*.apk

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
contents: read
3838

3939
steps:
40-
- uses: actions/checkout@v4
41-
- uses: gradle/wrapper-validation-action@v2
40+
- uses: actions/checkout@v6
41+
- uses: gradle/actions/wrapper-validation@v4
4242

4343
- name: create and checkout branch
4444
# push events already checked out the branch
@@ -48,7 +48,7 @@ jobs:
4848
run: git checkout -B "$BRANCH"
4949

5050
- name: set up JDK
51-
uses: actions/setup-java@v4
51+
uses: actions/setup-java@v5
5252
with:
5353
java-version: 21
5454
distribution: "temurin"
@@ -58,7 +58,7 @@ jobs:
5858
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
5959

6060
- name: Upload APK
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v6
6262
with:
6363
name: app
6464
path: app/build/outputs/apk/debug/*.apk
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
matrix:
7171
include:
72-
- api-level: 21
72+
- api-level: 23
7373
target: default
7474
arch: x86
7575
- api-level: 35
@@ -80,7 +80,7 @@ jobs:
8080
contents: read
8181

8282
steps:
83-
- uses: actions/checkout@v4
83+
- uses: actions/checkout@v6
8484

8585
- name: Enable KVM
8686
run: |
@@ -89,7 +89,7 @@ jobs:
8989
sudo udevadm trigger --name-match=kvm
9090
9191
- name: set up JDK
92-
uses: actions/setup-java@v4
92+
uses: actions/setup-java@v5
9393
with:
9494
java-version: 21
9595
distribution: "temurin"
@@ -104,7 +104,7 @@ jobs:
104104
script: ./gradlew connectedCheck --stacktrace
105105

106106
- name: Upload test report when tests fail # because the printed out stacktrace (console) is too short, see also #7553
107-
uses: actions/upload-artifact@v4
107+
uses: actions/upload-artifact@v6
108108
if: failure()
109109
with:
110110
name: android-test-report-api${{ matrix.api-level }}
@@ -118,19 +118,19 @@ jobs:
118118
contents: read
119119

120120
steps:
121-
- uses: actions/checkout@v4
121+
- uses: actions/checkout@v6
122122
with:
123123
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
124124

125125
- name: Set up JDK
126-
uses: actions/setup-java@v4
126+
uses: actions/setup-java@v5
127127
with:
128128
java-version: 21
129129
distribution: "temurin"
130130
cache: 'gradle'
131131

132132
- name: Cache SonarCloud packages
133-
uses: actions/cache@v4
133+
uses: actions/cache@v5
134134
with:
135135
path: ~/.sonar/cache
136136
key: ${{ runner.os }}-sonar

.github/workflows/image-minimizer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121

22-
- uses: actions/setup-node@v4
22+
- uses: actions/setup-node@v6
2323
with:
2424
node-version: 16
2525

2626
- name: Install probe-image-size
2727
run: npm i probe-image-size@7.2.3 --ignore-scripts
2828

2929
- name: Minimize simple images
30-
uses: actions/github-script@v7
30+
uses: actions/github-script@v8
3131
timeout-minutes: 3
3232
with:
3333
script: |

app/build.gradle.kts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ android {
4444
defaultConfig {
4545
applicationId = "org.schabi.newpipe"
4646
resValue("string", "app_name", "NewPipe")
47-
minSdk = 21
47+
minSdk = 23
4848
targetSdk = 35
4949

50-
versionCode = System.getProperty("versionCodeOverride")?.toInt() ?: 1005
50+
versionCode = System.getProperty("versionCodeOverride")?.toInt() ?: 1006
5151

52-
versionName = "0.28.0"
52+
versionName = "0.28.1"
5353
System.getProperty("versionNameSuffix")?.let { versionNameSuffix = it }
5454

5555
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -140,6 +140,13 @@ ksp {
140140
// Custom dependency configuration for ktlint
141141
val ktlint by configurations.creating
142142

143+
// https://checkstyle.org/#JRE_and_JDK
144+
tasks.withType<Checkstyle>().configureEach {
145+
javaLauncher = javaToolchains.launcherFor {
146+
languageVersion = JavaLanguageVersion.of(21)
147+
}
148+
}
149+
143150
checkstyle {
144151
configDirectory = rootProject.file("checkstyle")
145152
isIgnoreFailures = false
@@ -304,10 +311,6 @@ dependencies {
304311
implementation(libs.google.exoplayer.smoothstreaming)
305312
implementation(libs.google.exoplayer.ui)
306313

307-
// Metadata generator for service descriptors
308-
compileOnly(libs.google.autoservice.annotations)
309-
ksp(libs.google.autoservice.compiler)
310-
311314
// Manager for complex RecyclerView layouts
312315
implementation(libs.lisawray.groupie.core)
313316
implementation(libs.lisawray.groupie.viewbinding)
@@ -322,6 +325,8 @@ dependencies {
322325

323326
// Crash reporting
324327
implementation(libs.acra.core)
328+
compileOnly(libs.google.autoservice.annotations)
329+
ksp(libs.zacsweers.autoservice.compiler)
325330

326331
// Properly restarting
327332
implementation(libs.jakewharton.phoenix)

0 commit comments

Comments
 (0)