Skip to content

Commit 7cecda5

Browse files
committed
Merge branch 'dev' into refactor
Had to make some adjustments to make #12188 work
2 parents 1d94fd1 + d9dccfa commit 7cecda5

File tree

36 files changed

+69
-18
lines changed

36 files changed

+69
-18
lines changed

.github/workflows/image-minimizer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ module.exports = async ({github, context}) => {
3333

3434
// Regex for finding images (simple variant) ![ALT_TEXT](https://*.githubusercontent.com/<number>/<variousHexStringsAnd->.<fileExtension>)
3535
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;
36+
const REGEX_ASSETS_IMAGE_LOOKUP = /\!\[([^\]]*)\]\((https:\/\/github\.com\/(?:user-attachments\/assets|[-\w\d]+\/[-\w\d]+\/assets\/\d+)\/[\-0-9a-f]{32,512})\)/gm;
3737

3838
// Check if we found something
3939
let foundSimpleImages = REGEX_USER_CONTENT_IMAGE_LOOKUP.test(initialBody)
40-
|| REGEX_ASSETS_IMAGE_LOCKUP.test(initialBody);
40+
|| REGEX_ASSETS_IMAGE_LOOKUP.test(initialBody);
4141
if (!foundSimpleImages) {
4242
console.log('Found no simple images to process');
4343
return;
@@ -52,7 +52,7 @@ module.exports = async ({github, context}) => {
5252

5353
// Try to find and replace the images with minimized ones
5454
let newBody = await replaceAsync(initialBody, REGEX_USER_CONTENT_IMAGE_LOOKUP, minimizeAsync);
55-
newBody = await replaceAsync(newBody, REGEX_ASSETS_IMAGE_LOCKUP, minimizeAsync);
55+
newBody = await replaceAsync(newBody, REGEX_ASSETS_IMAGE_LOOKUP, minimizeAsync);
5656

5757
if (!wasMatchModified) {
5858
console.log('Nothing was modified. Skipping update');

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ android {
2727
if (System.properties.containsKey('versionCodeOverride')) {
2828
versionCode System.getProperty('versionCodeOverride') as Integer
2929
} else {
30-
versionCode 1003
30+
versionCode 1004
3131
}
32-
versionName "0.27.6"
32+
versionName "0.27.7"
3333
if (System.properties.containsKey('versionNameSuffix')) {
3434
versionNameSuffix System.getProperty('versionNameSuffix')
3535
}

app/src/main/java/org/schabi/newpipe/local/BaseLocalListFragment.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ public void showLoading() {
194194
if (itemsList != null) {
195195
animateHideRecyclerViewAllowingScrolling(itemsList);
196196
}
197-
if (headerRootBinding != null) {
198-
animate(headerRootBinding.getRoot(), false, 200);
199-
}
200197
}
201198

202199
@Override
@@ -205,9 +202,6 @@ public void hideLoading() {
205202
if (itemsList != null) {
206203
animate(itemsList, true, 200);
207204
}
208-
if (headerRootBinding != null) {
209-
animate(headerRootBinding.getRoot(), true, 200);
210-
}
211205
}
212206

213207
@Override
@@ -253,9 +247,6 @@ public void handleError() {
253247
if (itemsList != null) {
254248
animateHideRecyclerViewAllowingScrolling(itemsList);
255249
}
256-
if (headerRootBinding != null) {
257-
animate(headerRootBinding.getRoot(), false, 200);
258-
}
259250
}
260251

261252
@Override

app/src/main/java/org/schabi/newpipe/ui/components/video/comment/Comment.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ fun Comment(comment: CommentsInfoItem, onCommentAuthorOpened: () -> Unit) {
9999
}
100100

101101
val nameAndDate = remember(comment) {
102-
val date = Localization.relativeTimeOrTextual(
103-
context, comment.uploadDate, comment.textualUploadDate
102+
Localization.concatenateStrings(
103+
Localization.localizeUserName(comment.uploaderName),
104+
Localization.relativeTimeOrTextual(
105+
context, comment.uploadDate, comment.textualUploadDate
106+
)
104107
)
105-
Localization.concatenateStrings(comment.uploaderName, date)
106108
}
107109
Text(
108110
text = nameAndDate,

app/src/main/java/org/schabi/newpipe/util/Localization.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.os.Build;
1212
import android.text.TextUtils;
1313
import android.text.format.DateUtils;
14+
import android.text.BidiFormatter;
1415
import android.util.DisplayMetrics;
1516
import android.util.Log;
1617

@@ -85,6 +86,25 @@ public static String concatenateStrings(final String delimiter, final List<Strin
8586
.collect(Collectors.joining(delimiter));
8687
}
8788

89+
/**
90+
* Localize a user name like <code>@foobar</code>.
91+
*
92+
* Will correctly handle right-to-left usernames by using a {@link BidiFormatter}.
93+
*
94+
* @param plainName username, with an optional leading <code>@</code>
95+
* @return a usernames that can include RTL-characters
96+
*/
97+
@NonNull
98+
public static String localizeUserName(final String plainName) {
99+
final BidiFormatter bidi = BidiFormatter.getInstance();
100+
101+
if (plainName.startsWith("@")) {
102+
return "@" + bidi.unicodeWrap(plainName.substring(1));
103+
} else {
104+
return bidi.unicodeWrap(plainName);
105+
}
106+
}
107+
88108
public static org.schabi.newpipe.extractor.localization.Localization getPreferredLocalization(
89109
final Context context) {
90110
return org.schabi.newpipe.extractor.localization.Localization
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
تم إصلاح YouTube الذي لا يقوم بتشغيل أي دفق
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
YouTube-un heç bir yayım oynatmaması düzəldildi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Opraveno nepřehrávání jakéhokoli streamu ve službě YouTube
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Behoben, dass YouTube keinen Stream abspielte
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This release fixes YouTube only providing a 360p stream.
2+
3+
Note that the solution employed in this version is likely temporary, and in the long run the SABR video protocol needs to be implemented, but TeamNewPipe members are currently busy so any help would be greatly appreciated! https://github.com/TeamNewPipe/NewPipe/issues/12248

0 commit comments

Comments
 (0)