kotlin 1.7.10, crash fixes

This commit is contained in:
LagradOst 2022-07-21 01:48:40 +02:00
parent b034273318
commit 7c2512aec8
5 changed files with 13 additions and 11 deletions

View file

@ -36,7 +36,7 @@ android {
targetSdkVersion 30 targetSdkVersion 30
versionCode 49 versionCode 49
versionName "3.0.0" versionName "3.0.1"
resValue "string", "app_version", resValue "string", "app_version",
"${defaultConfig.versionName}${versionNameSuffix ?: ""}" "${defaultConfig.versionName}${versionNameSuffix ?: ""}"
@ -94,7 +94,6 @@ dependencies {
implementation 'androidx.test.ext:junit-ktx:1.1.3' implementation 'androidx.test.ext:junit-ktx:1.1.3'
testImplementation 'org.json:json:20180813' testImplementation 'org.json:json:20180813'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.8.0' implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2' implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.5.0' // dont change this to 1.6.0 it looks ugly af implementation 'com.google.android.material:material:1.5.0' // dont change this to 1.6.0 it looks ugly af

View file

@ -32,9 +32,8 @@ class APIRepository(val api: MainAPI) {
val hasQuickSearch = api.hasQuickSearch val hasQuickSearch = api.hasQuickSearch
suspend fun load(url: String): Resource<LoadResponse> { suspend fun load(url: String): Resource<LoadResponse> {
if (isInvalidData(url)) throw ErrorLoadingException()
return safeApiCall { return safeApiCall {
if (isInvalidData(url)) throw ErrorLoadingException()
api.load(api.fixUrl(url)) ?: throw ErrorLoadingException() api.load(api.fixUrl(url)) ?: throw ErrorLoadingException()
} }
} }

View file

@ -1224,7 +1224,7 @@ class ResultFragment : ResultTrailerPlayer() {
sortUrls( sortUrls(
currentLinks ?: return@main currentLinks ?: return@main
),//(currentLinks ?: return@main).filter { !it.isM3u8 }, ),//(currentLinks ?: return@main).filter { !it.isM3u8 },
getString(R.string.episode_action_download_mirror) context?.getString(R.string.episode_action_download_mirror) ?: ""
) { link -> ) { link ->
startDownload( startDownload(
context, context,

View file

@ -1602,11 +1602,15 @@ object VideoDownloadManager {
} }
private fun saveQueue() { private fun saveQueue() {
val dQueue = try {
downloadQueue.toList() val dQueue =
.mapIndexed { index, any -> DownloadQueueResumePackage(index, any) } downloadQueue.toList()
.toTypedArray() .mapIndexed { index, any -> DownloadQueueResumePackage(index, any) }
setKey(KEY_RESUME_QUEUE_PACKAGES, dQueue) .toTypedArray()
setKey(KEY_RESUME_QUEUE_PACKAGES, dQueue)
} catch (e : Exception) {
logError(e)
}
} }
/*fun isMyServiceRunning(context: Context, serviceClass: Class<*>): Boolean { /*fun isMyServiceRunning(context: Context, serviceClass: Class<*>): Boolean {

View file

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = "1.6.21" ext.kotlin_version = "1.7.10"
repositories { repositories {
google() google()
jcenter() jcenter()