add 3.14 python default github foss

pull/1328/merge
deniscerri 3 weeks ago
parent 13320bb64f
commit ff30d5f2de
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -167,13 +167,15 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs_nio:2.1.5"
githubImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
githubImplementation "io.github.deniscerri:ytdlnis_packages.python:3.14.6"
githubImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
githubImplementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
//githubImplementation "io.github.deniscerri:ytdlnis_packages.deno:2.7.7"
fossImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
fossImplementation "io.github.deniscerri:ytdlnis_packages.python:3.14.6"
fossImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"
fossImplementation "io.github.junkfood02.youtubedl-android:ffmpeg:0.17.2"
//fossImplementation "io.github.deniscerri:ytdlnis_packages.deno:2.7.7"
izzyImplementation "io.github.junkfood02.youtubedl-android:library:0.18.1"
izzyImplementation "io.github.junkfood02.youtubedl-android:aria2c:0.18.1"

@ -580,6 +580,7 @@ class MainActivity : BaseActivity() {
}
val skipRemindingPackageUpdate = preferences.getStringSet("skip_reminding_package_update", setOf())!!.toMutableSet()
RuntimeManager.getInstance().assertInit()
RuntimeManager.packages.forEach { pkg ->
val instance = pkg.plugin.getInstance()
if (instance.bundledVersion.isNullOrBlank() && instance.downloadedVersion.isNullOrBlank()) return@forEach

@ -285,11 +285,12 @@ abstract class PackageBase {
it.assets = it.assets.filter { a -> a.name.contains(supportedArch) }
it.downloadSize = it.assets.first().size
it.isInstalled = downloadedVersion == "v${it.version}"
it.isBundled = bundledVersion == "v${it.version}"
it.isBundled = location.isBundled && bundledVersion == "v${it.version}"
val latestVersion = bundledVersion?.replace("v|.".toRegex(), "")?.toInt()
?: downloadedVersion?.replace("v|.".toRegex(), "")?.toInt() ?: 0
val bundledRaw = (bundledVersion ?: "0").ifEmpty{ "0" }.replace("[v.]".toRegex(), "").toInt()
val downloadedRaw = (downloadedVersion ?: "0").ifEmpty{ "0" }.replace("[v.]".toRegex(), "").toInt()
val latestVersion = bundledRaw.coerceAtLeast(downloadedRaw)
it.oldVersion = latestVersion > it.version.replace(".", "").toInt()
}

@ -1,10 +1,12 @@
package com.deniscerri.ytdl.core.packages
import com.deniscerri.ytdl.BuildConfig
object Python : PackageBase() {
override val executableName: String get() = "python"
override val packageFolderName: String get() = "python"
override val bundledZipName: String get() = "libpython.zip.so"
override val bundledVersion: String get() = "v3.12.11"
override val bundledVersion: String get() = if (BuildConfig.FLAVOR == "izzy") "v3.12.11" else "v3.14.6"
override val canUninstall: Boolean = false
override val githubRepo: String get() = "deniscerri/ytdlnis-packages"
override val githubPackageName: String get() = "python"

@ -73,50 +73,38 @@ class HistoryViewModel(application: Application) : AndroidViewModel(application)
repository = HistoryRepository(dao)
websites = repository.websites
val filters = listOf(dao.getAllHistory(), sortOrder, sortType, websiteFilter, statusFilter, queryFilter, typeFilter)
paginatedItems = combine(filters) { f ->
val sortOrder = f[1] as SORTING
val sortType = f[2] as HistorySortType
val website = f[3] as String
val status = f[4] as HistoryStatus
val query = f[5] as String
val type = f[6] as String
var pager = Pager(
val filtersFlow = combine(
combine(sortOrder, sortType, websiteFilter, ::Triple),
combine(statusFilter, queryFilter, typeFilter, ::Triple)
) { (order, sort, site), (status, query, type) ->
HistoryFilters(
sortOrder = order,
sortType = sort,
website = site,
status = status,
query = query,
type = type
)
}
paginatedItems = filtersFlow.flatMapLatest { f ->
Pager(
config = PagingConfig(pageSize = 20, initialLoadSize = 20, prefetchDistance = 1),
pagingSourceFactory = {
repository.getPaginatedSource(query, type, website, sortType, sortOrder)
repository.getPaginatedSource(f.query, f.type, f.website, f.sortType, f.sortOrder)
}
).flow
when(status) {
HistoryStatus.DELETED -> {
pager = pager.map {
it.filter { it2 ->
it2.downloadPath.any { it3 ->
!FileUtil.exists(it3)
}
}
).flow.map { pagingData ->
when (f.status) {
HistoryStatus.DELETED -> pagingData.filter { item ->
item.downloadPath.any { !FileUtil.exists(it) }
}
}
HistoryStatus.NOT_DELETED -> {
pager = pager.map {
it.filter { it2 ->
it2.downloadPath.any { it3 ->
FileUtil.exists(it3)
}
}
HistoryStatus.NOT_DELETED -> pagingData.filter { item ->
item.downloadPath.any { FileUtil.exists(it) }
}
else -> pagingData
}
else -> {}
}
withContext(Dispatchers.IO) {
totalCount.value = repository.getFilteredIDs(query, type, website, sortType, sortOrder, status).count()
}
pager
}.flatMapLatest { it }
}
}
fun setSorting(sort: HistorySortType){

@ -346,7 +346,7 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, SearchSuggesti
shimmerCards!!.stopShimmer()
shimmerCards!!.visibility = GONE
showDownloadAllFab = totalCount > 1 && firstResult!!.playlistTitle.isNotEmpty()
showDownloadAllFab = totalCount > 1 && firstResult?.playlistTitle.orEmpty().isNotEmpty()
downloadAllFab!!.isVisible = showDownloadAllFab
}
}

@ -115,10 +115,10 @@ class PackagesFragment : Fragment(), PackagesAdapter.OnItemClickListener, Packag
lifecycleScope.launch {
val instance = tmpItem!!.getInstance()
instance.getReleases().apply {
this.onFailure {
this.onFailure { failure ->
lifecycleScope.launch {
withContext(Dispatchers.Main) {
Toast.makeText(requireContext(), it.message ?: getString(R.string.errored), Toast.LENGTH_SHORT).show()
Toast.makeText(requireContext(), failure.message ?: getString(R.string.errored), Toast.LENGTH_SHORT).show()
}
}
}

Loading…
Cancel
Save