Skip to content

Commit cd056a7

Browse files
authored
Merge pull request #12969 from TeamNewPipe/refactor-merge
Merge dev into refactor
2 parents 8ae5a55 + 040b4c4 commit cd056a7

File tree

39 files changed

+395
-73
lines changed

39 files changed

+395
-73
lines changed

.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.

app/src/main/java/org/schabi/newpipe/database/subscription/SubscriptionEntity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ data class SubscriptionEntity(
5555
fun toChannelInfoItem(): ChannelInfoItem {
5656
return ChannelInfoItem(this.serviceId, this.url, this.name).apply {
5757
thumbnails = ImageStrategy.dbUrlToImageList(this@SubscriptionEntity.avatarUrl)
58-
subscriberCount = this.subscriberCount
59-
description = this.description
58+
subscriberCount = this@SubscriptionEntity.subscriberCount ?: -1
59+
description = this@SubscriptionEntity.description
6060
}
6161
}
6262

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class VideoDetailFragment :
136136
// player objects
137137
private var playQueue: PlayQueue? = null
138138
@JvmField @State var autoPlayEnabled: Boolean = true
139+
@JvmField @State var originalOrientation: Int = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
139140
private var playerService: PlayerService? = null
140141
private var player: Player? = null
141142

@@ -1730,25 +1731,24 @@ class VideoDetailFragment :
17301731
}
17311732

17321733
override fun onFullscreenToggleButtonClicked() {
1733-
// On Android TV screen rotation is not supported
1734-
// In tablet user experience will be better if screen will not be rotated
1735-
// from landscape to portrait every time.
1736-
// Just turn on fullscreen mode in landscape orientation
1737-
// or portrait & unlocked global orientation
1738-
val isLandscape = DeviceUtils.isLandscape(requireContext())
1739-
if (DeviceUtils.isTv(activity) || DeviceUtils.isTablet(activity) &&
1740-
(!PlayerHelper.globalScreenOrientationLocked(activity) || isLandscape)
1741-
) {
1742-
player!!.UIs().get(MainPlayerUi::class)?.toggleFullscreen()
1734+
val playerUi: MainPlayerUi = player?.UIs()?.get(MainPlayerUi::class.java) ?: return
1735+
1736+
// On tablets and TVs, just toggle fullscreen UI without orientation change.
1737+
if (DeviceUtils.isTablet(activity) || DeviceUtils.isTv(activity)) {
1738+
playerUi.toggleFullscreen()
17431739
return
17441740
}
17451741

1746-
val newOrientation = if (isLandscape)
1747-
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
1748-
else
1749-
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
1750-
1751-
activity.setRequestedOrientation(newOrientation)
1742+
if (playerUi.isFullscreen) {
1743+
// EXITING FULLSCREEN
1744+
playerUi.toggleFullscreen()
1745+
activity.setRequestedOrientation(originalOrientation)
1746+
} else {
1747+
// ENTERING FULLSCREEN
1748+
originalOrientation = activity.getRequestedOrientation()
1749+
playerUi.toggleFullscreen()
1750+
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE)
1751+
}
17521752
}
17531753

17541754
/*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public void handleIntent(@NonNull final Intent intent) {
391391
return;
392392
}
393393
final PlayQueueItem newItem = newQueue.getStreams().get(0);
394-
newQueue.enqueueNext(newItem, false);
394+
playQueue.enqueueNext(newItem, false);
395395
return;
396396
}
397397

app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static android.content.Intent.FLAG_GRANT_PREFIX_URI_PERMISSION;
44
import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
5+
import static android.content.Intent.createChooser;
56
import static us.shandian.giga.get.DownloadMission.ERROR_CONNECT_HOST;
67
import static us.shandian.giga.get.DownloadMission.ERROR_FILE_CREATION;
78
import static us.shandian.giga.get.DownloadMission.ERROR_HTTP_NO_CONTENT;
@@ -349,11 +350,15 @@ private void viewWithFileProvider(Mission mission) {
349350
if (BuildConfig.DEBUG)
350351
Log.v(TAG, "Mime: " + mimeType + " package: " + BuildConfig.APPLICATION_ID + ".provider");
351352

352-
Intent intent = new Intent(Intent.ACTION_VIEW);
353-
intent.setDataAndType(resolveShareableUri(mission), mimeType);
354-
intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
355-
intent.addFlags(FLAG_GRANT_PREFIX_URI_PERMISSION);
356-
ShareUtils.openIntentInApp(mContext, intent);
353+
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
354+
viewIntent.setDataAndType(resolveShareableUri(mission), mimeType);
355+
viewIntent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
356+
viewIntent.addFlags(FLAG_GRANT_PREFIX_URI_PERMISSION);
357+
358+
Intent chooserIntent = createChooser(viewIntent, null);
359+
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | FLAG_GRANT_READ_URI_PERMISSION);
360+
361+
ShareUtils.openIntentInApp(mContext, chooserIntent);
357362
}
358363

359364
private void shareFile(Mission mission) {
@@ -364,8 +369,7 @@ private void shareFile(Mission mission) {
364369
shareIntent.putExtra(Intent.EXTRA_STREAM, resolveShareableUri(mission));
365370
shareIntent.addFlags(FLAG_GRANT_READ_URI_PERMISSION);
366371

367-
final Intent intent = new Intent(Intent.ACTION_CHOOSER);
368-
intent.putExtra(Intent.EXTRA_INTENT, shareIntent);
372+
final Intent intent = createChooser(shareIntent, null);
369373
// unneeded to set a title to the chooser on Android P and higher because the system
370374
// ignores this title on these versions
371375
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) {

app/src/main/res/values-bn/strings.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
<string name="clear_queue_confirmation_summary">এক প্লেয়ার থেকে অন্য প্লেয়ারে পরিবর্তন করলে তোমার সারি প্রতিস্থাপিত হতে পারে</string>
297297
<string name="clear_queue_confirmation_title">কিউ মোছার আগে নিশ্চিত করো</string>
298298
<string name="notification_actions_at_most_three">কমপ্যাক্ট বিজ্ঞপ্তিতে প্রদর্শন করতে তুমি সর্বাধিক তিনটি ক্রিয়া নির্বাচন করতে পারো!</string>
299-
<string name="notification_actions_summary">নিচের প্রতিটি প্রজ্ঞাপন ক্রিয়া সম্পাদনা করো। ডান দিকের চেকবাক্স ব্যবহার করে কম্প্যাক্ট নোটিফিকেশনে দেখানোর জন্য তিনটি পর্যন্ত নির্বাচন করো</string>
299+
<string name="notification_actions_summary">নিচের প্রতিটি প্রজ্ঞাপন ক্রিয়া সম্পাদনা করুন । ডান দিকের চেকবাক্স ব্যবহার করে কম্প্যাক্ট নোটিফিকেশনে দেখানোর জন্য তিনটি পর্যন্ত নির্বাচন করুন ।</string>
300300
<string name="notification_scale_to_square_image_summary">প্রদর্শিত ভিডিও থাম্বনেইল ১৬:৯ থেকে ১:১অনুপাতে পরিবর্তন করো</string>
301301
<string name="settings_category_feed_title">ফিড</string>
302302
<string name="overwrite">ওভাররাইট</string>
@@ -627,4 +627,8 @@
627627
<string name="main_page_content_swipe_remove">ভুক্তি মুছতে ডানে-বামে সরাও</string>
628628
<string name="loading_stream_details">সম্প্রচার বিষয়ক তথ্য প্রক্রিয়ারত…</string>
629629
<string name="progressive_load_interval_title">প্লেব্যাক লোড বিরতির আকার</string>
630+
<string name="yes">হ্যা</string>
631+
<string name="no">না</string>
632+
<string name="tab_bookmarks_short">প্লেলিস্ট</string>
633+
<string name="ignore_hardware_media_buttons_summary">উদাহরণস্বরূপ, যদি আপনি ভাঙা ফিজিক্যাল বোতাম সহ একটি হেডসেট ব্যবহার করেন তবে এটি কার্যকর</string>
630634
</resources>

app/src/main/res/values-da/strings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,4 +832,11 @@
832832
<string name="short_billion">%sB</string>
833833
<string name="delete_file">Slet fil</string>
834834
<string name="account_terminated_service_provides_reason">Kontoen er blevet lukket\n\n%1$s angiver følgende årsag: %2$s</string>
835+
<string name="channel_tab_likes">Likes</string>
836+
<string name="migration_info_6_7_title">SoundCloud Top 50-siden fjernet</string>
837+
<string name="migration_info_6_7_message">SoundCloud har udfaset de oprindelige Top 50-hitlister. Den tilhørende fane er blevet fjernet fra din hovedside.</string>
838+
<string name="migration_info_7_8_title">YouTube kombineret trending fjernet</string>
839+
<string name="migration_info_7_8_message">YouTube har udfaset den kombinerede trending-side pr. 21. juli 2025. NewPipe har erstattet standardsiden for trending med trending livestreams.\n\nDu kan også vælge andre trending-sider under \"Indstillinger &gt; Indhold &gt; Indhold på hovedsiden\".</string>
840+
<string name="trending_gaming">Gaming-trends</string>
841+
<string name="trending_podcasts">Trending podcasts</string>
835842
</resources>

0 commit comments

Comments
 (0)