Commit graph

4090 commits

Author SHA1 Message Date
TransZAllen
6ea8f678f1 improve comments on TTML → SRT conversion
- update class header with proper technical references and remove author tag.
- update comments of replacing NBSP('\u00A0'), especially adding examples
  of rendering incorrectly.
2025-10-29 19:25:43 +08:00
TransZAllen
38360ba96f Update app/src/main/java/org/schabi/newpipe/streams/SrtFromTtmlWriter.java
Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
2025-10-28 17:39:04 +08:00
TransZAllen
c76fe2adc6 refactor(ttml): extract recursion into traverseChildNodesForNestedTags()
- Extracted child-node traversal logic from `extractText()`
  into a helper method `traverseChildNodesForNestedTags()`.
- No functional change.
2025-10-17 12:06:18 +08:00
TransZAllen
b984a31117 refactor(ttml): improve extractText() to preserve spaces and special characters
- Replaced `text()` with `getWholeText()`:
  - avoids losing whitespaces at the beginning, end, or within the text;
  - avoids merging two or more consecutive spaces into a single space ' ';
  - avoids converting '\r', '\n', and '\r\n' within the text into a single space ' ';
  For subtitle conversion, the goal is to preserve every character exactly as intended by the subtitle author.
- Normalized tabs, line breaks, and other special characters for SRT-safe output.
- Added comprehensive unit tests in `SrtFromTtmlWriterTest.java`, including cases for simple and nested tags.
2025-10-17 01:57:01 +08:00
TobiGr
99fd1c4a89 Fix JDoc and apply suggestions 2025-08-27 10:38:13 +02:00
TransZAllen
7ee20c72fb [Bug] Fix missing subtitle text in manually downloaded *.SRT files. (issue #10030)
- Previously, *.SRT files only contained timestamps and sequence numbers, without the actual text content.
- Added recursive text extraction to handle nested tags in TTML
  files.(e.g.: <span> tags)
2025-08-27 14:03:42 +08:00
Tobi
e5cd710a74 Merge pull request #12460 from Isira-Seneviratne/Short-count-refactor
Fix short count formatting for Android versions below 7.0
2025-08-01 10:56:41 -07:00
Stypox
5c57eec8f2 Merge branch 'master' into dev 2025-07-31 23:52:01 +02:00
Stypox
6abe2cb3c7 Update the names of YT kiosks 2025-07-31 23:43:19 +02:00
Stypox
e801022ae9 Show tabs above kiosks in drawer 2025-07-31 23:43:19 +02:00
Stypox
c06dbe52fc Remove DEBUG statements and don't replace yt trending with live
You can use this command to test instead:

adb shell run-as org.schabi.newpipe.debug.pr12450 'sed -i '"'"'s#<int name="last_used_preferences_version" value="8" />#<int name="last_used_preferences_version" value="6" />#'"'"' shared_prefs/org.schabi.newpipe.debug.pr12450_preferences.xml' && adb shell run-as org.schabi.newpipe.debug.pr12450 'sed -i '"'"'s#\]}</string>#,{\&quot;tab_id\&quot;:5,\&quot;service_id\&quot;:0,\&quot;kiosk_id\&quot;:\&quot;Trending\&quot;},{\&quot;tab_id\&quot;:5,\&quot;service_id\&quot;:1,\&quot;kiosk_id\&quot;:\&quot;Top 50\&quot;}]}</string>#'"'"' shared_prefs/org.schabi.newpipe.debug.pr12450_preferences.xml'
2025-07-31 23:43:19 +02:00
Stypox
d5a25482db [YouTube] Add icons and strings for new trending pages 2025-07-31 23:43:19 +02:00
TobiGr
07b0c92798 WIP: Add SettingsMigration to change YouTube trending kiosk tab 2025-07-31 23:43:19 +02:00
Stypox
028cd9d7b8 Merge branch 'release-0.28.0' into dev 2025-07-30 11:42:06 +02:00
Stypox
a124543144 Merge pull request #12470 from litetex/cleanup-PlayerHelper-localization 2025-07-28 15:30:07 +02:00
Stypox
e12376bad6 Fix player formatters resetting too early on language change
formatters() is called again by the player before the user has a chance to click on the language in the language chooser.

So the correct solution would probably be to attach to https://developer.android.com/reference/android/content/Intent#ACTION_LOCALE_CHANGED, but let's keep it simple. I added `PlayerHelper.resetFormat();` in `ContentSettingsFragment.onDestroy()` and it works. It will mean the player formatters will be reset every time the user exits content settings, but whatever.
2025-07-28 15:29:06 +02:00
litetex
f86aa0a5a9 Encapsulate Formatters in PlayerHelper
and reset them when the language is changed/changing.
This way they will be re-initialized on the next call.

Also Remove a bunch of outdated/non-thread safe code (STRING_FORMATTER)
2025-07-28 15:11:27 +02:00
litetex
e72db1a816 Remove unused method 2025-07-28 15:11:27 +02:00
litetex
6ac5acd9ff Cleanup `Localization` formatting 2025-07-28 15:11:27 +02:00
litetex
9e2e6f211d Use regions 2025-07-28 15:11:27 +02:00
Stypox
307598fd40 Merge pull request #12455 from TobiGr/nextPage-nullable 2025-07-28 14:52:08 +02:00
Stypox
a46a01d504 Improve null checking further in SearchFragment.handleNextItems 2025-07-28 14:43:46 +02:00
Isira Seneviratne
7de1f6c8e3 Improve scale display 2025-07-28 09:02:52 +05:30
TobiGr
96a995c182 Update USER_AGENT to Firefox 140 ESR 2025-07-27 09:39:53 +02:00
Isira Seneviratne
34e55f6eb4 Fix short count formatting for Android versions below 7.0 2025-07-24 07:56:44 +05:30
Michael Zh
fa2421027c Fix compile
Co-Authored-By: Isira Seneviratne <31027858+Isira-Seneviratne@users.noreply.github.com>
2025-07-23 18:49:28 -04:00
Michael Zh
1564a43e8f WIP: Fix compile 2025-07-23 18:45:30 -04:00
Michael Zh
6b4698ac71 Fix error toast crash 2025-07-23 18:45:30 -04:00
Michael Zh
7c85d41aed Specify RECEIVER_EXPORTED/RECEIVER_NOT_EXPORTED for sdk34 2025-07-23 18:45:30 -04:00
TobiGr
6ac41b1e9a Use correct fix for nextPage being null while creating error report in SearchFragment.handleNextItems() 2025-07-22 16:12:02 +02:00
Kouki Badr
e28c6a1373 fix: handle nullable nextPage behavior when searching albums #12401 (#12408)
* fix: handle nullable nextPage behavior when searching albums #12401

* feat: add nullable annotation to newPage attribute in SearchFragment

* Updated more usages of InfoItemsPage#getNextPage. Nullability is already handled in these areas so no other changes needed

---------

Co-authored-by: Siddhesh Naik <siddheshnaik20@protonmail.com>
2025-07-22 08:58:56 +05:30
litetex
722e290f8f Cleaned up some code related to app language
* Use build constants when possible
* Inline variables
* Don't use var for normal-sized types (that way it's easier to review)
* Split code into methods
2025-07-20 21:52:07 +02:00
Isira Seneviratne
2ea50b203c Clean up imports 2025-07-20 16:43:37 +05:30
Isira Seneviratne
c1a8418b82 Properly handle when system language is selected 2025-07-20 16:27:07 +05:30
Isira Seneviratne
dec82a8a5c Add link for future reference 2025-07-20 05:03:20 +05:30
Isira Seneviratne
15f79507c4 Enable per-app language preferences for Android < 13 2025-07-20 04:50:49 +05:30
Stypox
711312e3b3 Fix state not saved 2025-07-19 20:39:55 +02:00
Stypox
cb15a70e46 Improve comment 2025-07-19 20:34:09 +02:00
Stypox
bb9a1289d2 Show error panel in EmptyFragment 2025-07-19 19:41:13 +02:00
tobigr
567ced1216 Fix error detection when loading main page tabs
Do not crash if something unexpected happens.
2025-07-19 13:37:54 +02:00
tobigr
5219656346 Display dialog informing the user about the removal of the Top 50 kiosk 2025-07-19 13:37:54 +02:00
tobigr
eae62b4669 Update Extractor and add migration to remove SoundCloud Top 50 kiosk 2025-07-18 18:59:28 +02:00
Stypox
2a5c46ed92 Merge pull request #12258 from Profpatsch/show-service-name-in-search 2025-07-16 15:02:43 +02:00
Stypox
fc17536929 Merge pull request #12412 from Stypox/fix-ghost-notifications 2025-07-14 21:56:22 +02:00
watermelon42
8bd5694bd3 Added support for importing Soundcloud likes as a new tab before About in a user's channel.
The likes are also retrieved in the feed if the user is subscribed to.
2025-07-11 09:50:33 +02:00
Stypox
ac14ccea28 Merge pull request #12410 from Stypox/fix-android-auto-thumbnails 2025-07-08 11:42:20 +02:00
Stypox
aa8fc53220 Fix fullscreen eliciting "clear queue" prompt 2025-07-07 15:07:46 +02:00
Stypox
a274623ec6 Fix ghost notifications on Android 10
Fixes #12400, see there for explanation. Citing from there:

So apparently the problem is onGetRoot always returning a BrowserRoot instance. Making it return null solved the issue (but again, breaks Android Auto compatibility). It turns out (see https://stackoverflow.com/q/63818988/) that onGetRoot is also used for media resumption https://developer.android.com/media/implement/surfaces/mobile#mediabrowserservice_implementation, which causes a new notification to pop up (in this case a useless notification because our onGetRoot does not return something that can be used for resumption). So what needs to be done is to check if rootHints?.getBoolean(EXTRA_RECENT) == true and if that's the case not return anything (as EXTRA_RECENT is used by the system for resumption).

The PackageValidator file is taken from 329a21b63c/common/src/main/java/com/example/android/uamp/media/PackageValidator.kt .
2025-07-07 01:06:59 +02:00
Stypox
24b6087fe1 Use Kotlin's .toUri() instead of Uri.parse() 2025-07-06 15:05:30 +02:00
Stypox
ef38ac4238 Fix thumbnails appearing on Android Auto even if disabled 2025-07-06 14:49:09 +02:00