Merge branch 'libre-tube:master' into master

This commit is contained in:
Faisal Khan 2023-02-01 22:45:22 +05:30 committed by GitHub
commit 5c593d7eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 8 deletions

View File

@ -2,6 +2,7 @@ package com.github.libretube.api
import android.content.Context import android.content.Context
import android.util.Log import android.util.Log
import androidx.core.text.isDigitsOnly
import com.github.libretube.R import com.github.libretube.R
import com.github.libretube.api.obj.Playlist import com.github.libretube.api.obj.Playlist
import com.github.libretube.api.obj.PlaylistId import com.github.libretube.api.obj.PlaylistId
@ -237,8 +238,12 @@ object PlaylistsHelper {
} }
private fun getPrivatePlaylistType(playlistId: String): PlaylistType { private fun getPrivatePlaylistType(playlistId: String): PlaylistType {
if (playlistId.all { it.isDigit() }) return PlaylistType.LOCAL return if (playlistId.isDigitsOnly()) {
if (playlistId.matches(pipedPlaylistRegex)) return PlaylistType.PRIVATE PlaylistType.LOCAL
return PlaylistType.PUBLIC } else if (playlistId.matches(pipedPlaylistRegex)) {
PlaylistType.PRIVATE
} else {
PlaylistType.PUBLIC
}
} }
} }

View File

@ -41,11 +41,7 @@ object TextUtils {
* @return Time in seconds * @return Time in seconds
*/ */
fun parseTimestamp(t: String): Long? { fun parseTimestamp(t: String): Long? {
if (t.all { c -> c.isDigit() }) { return t.toLongOrNull() ?: Duration.parseOrNull(t)?.inWholeSeconds
return t.toLong()
}
return Duration.parseOrNull(t)?.inWholeSeconds
} }
/** /**

View File

@ -450,4 +450,5 @@
<string name="skip_silence">Salta il silenzio</string> <string name="skip_silence">Salta il silenzio</string>
<string name="help">Aiuto</string> <string name="help">Aiuto</string>
<string name="faq">Domande frequenti</string> <string name="faq">Domande frequenti</string>
<string name="replies">Risposte</string>
</resources> </resources>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="share">شیئر کریں</string>
<string name="download">ڈاؤن لوڈ کریں</string>
<string name="login">لاگ ان کریں</string>
<string name="save">محفوظ کریں</string>
<string name="register">رجسٹر کریں</string>
<string name="logout">لاگ آؤٹ کریں</string>
<string name="loggedIn">لاگ ان ہو گیا۔</string>
<string name="registered">رجسٹر ہو گیا. اب آپ چینل سبسکرائب کر سکتے ہیں۔</string>
<string name="login_first">براہ کرم لاگ ان کریں اور دوبارہ کوشش کریں۔</string>
<string name="instances">منتخب کریں…</string>
<string name="already_logged_in">پہلے سے لاگ ان ہے۔ آپ اپنے اکاؤنٹ سے لاگ آؤٹ کر سکتے ہیں۔</string>
<string name="videos">ویڈیوز</string>
<string name="subscribe">سبسکرائب</string>
<string name="loggedout">لاگ آؤٹ ہو گیا۔</string>
<string name="search_hint">تلاش کریں</string>
<string name="startpage">گھر</string>
<string name="subscriptions">سبسکرپشنز</string>
<string name="choose_quality_dialog">معیار</string>
<string name="yes">ہاں</string>
<string name="password">پاس ورڈ</string>
<string name="cancel">منسوخ کریں</string>
</resources>