Merge branch 'devel' into feature/nextgen
# Conflicts: # app/build.gradle
This commit is contained in:
@@ -14,8 +14,8 @@ android {
|
|||||||
applicationId 'org.koitharu.kotatsu'
|
applicationId 'org.koitharu.kotatsu'
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 32
|
targetSdkVersion 32
|
||||||
versionCode 415
|
versionCode 416
|
||||||
versionName '3.4.3'
|
versionName '3.4.4'
|
||||||
generatedDensities = []
|
generatedDensities = []
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -28,10 +28,6 @@ android {
|
|||||||
// define this values in your local.properties file
|
// define this values in your local.properties file
|
||||||
buildConfigField 'String', 'SHIKIMORI_CLIENT_ID', "\"${localProperty('shikimori.clientId')}\""
|
buildConfigField 'String', 'SHIKIMORI_CLIENT_ID', "\"${localProperty('shikimori.clientId')}\""
|
||||||
buildConfigField 'String', 'SHIKIMORI_CLIENT_SECRET', "\"${localProperty('shikimori.clientSecret')}\""
|
buildConfigField 'String', 'SHIKIMORI_CLIENT_SECRET', "\"${localProperty('shikimori.clientSecret')}\""
|
||||||
|
|
||||||
if (currentBranch() == "feature/nextgen") {
|
|
||||||
applicationIdSuffix = '.next'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
@@ -80,11 +76,11 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation('com.github.nv95:kotatsu-parsers:c5c84c8630') {
|
implementation('com.github.nv95:kotatsu-parsers:6af8cec134') {
|
||||||
exclude group: 'org.json', module: 'json'
|
exclude group: 'org.json', module: 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
|
||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.8.0'
|
implementation 'androidx.core:core-ktx:1.8.0'
|
||||||
implementation 'androidx.activity:activity-ktx:1.5.0'
|
implementation 'androidx.activity:activity-ktx:1.5.0'
|
||||||
@@ -117,25 +113,24 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'io.insert-koin:koin-android:3.2.0'
|
implementation 'io.insert-koin:koin-android:3.2.0'
|
||||||
implementation 'io.coil-kt:coil-base:2.1.0'
|
implementation 'io.coil-kt:coil-base:2.1.0'
|
||||||
implementation 'io.coil-kt:coil-svg:2.1.0'
|
|
||||||
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
|
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
|
||||||
implementation 'com.github.solkin:disk-lru-cache:1.4'
|
implementation 'com.github.solkin:disk-lru-cache:1.4'
|
||||||
|
|
||||||
implementation 'ch.acra:acra-mail:5.9.3'
|
implementation 'ch.acra:acra-mail:5.9.5'
|
||||||
implementation 'ch.acra:acra-dialog:5.9.3'
|
implementation 'ch.acra:acra-dialog:5.9.5'
|
||||||
|
|
||||||
debugImplementation 'org.jsoup:jsoup:1.15.1'
|
debugImplementation 'org.jsoup:jsoup:1.15.2'
|
||||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.3'
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test:runner:1.4.0'
|
androidTestImplementation 'androidx.test:runner:1.4.0'
|
||||||
androidTestImplementation 'androidx.test:rules:1.4.0'
|
androidTestImplementation 'androidx.test:rules:1.4.0'
|
||||||
androidTestImplementation 'androidx.test:core-ktx:1.4.0'
|
androidTestImplementation 'androidx.test:core-ktx:1.4.0'
|
||||||
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit-ktx:1.1.3'
|
||||||
|
|
||||||
androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.3'
|
androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
|
||||||
androidTestImplementation 'io.insert-koin:koin-test:3.2.0'
|
androidTestImplementation 'io.insert-koin:koin-test:3.2.0'
|
||||||
androidTestImplementation 'io.insert-koin:koin-test-junit4:3.2.0'
|
androidTestImplementation 'io.insert-koin:koin-test-junit4:3.2.0'
|
||||||
|
|
||||||
|
|||||||
@@ -89,26 +89,25 @@ class MultiSearchViewModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun searchImpl(q: String) {
|
private suspend fun searchImpl(q: String) = coroutineScope {
|
||||||
val sources = settings.getMangaSources(includeHidden = false)
|
val sources = settings.getMangaSources(includeHidden = false)
|
||||||
val dispatcher = Dispatchers.Default.limitedParallelism(MAX_PARALLELISM)
|
val dispatcher = Dispatchers.Default.limitedParallelism(MAX_PARALLELISM)
|
||||||
val deferredList = coroutineScope {
|
val deferredList = sources.map { source ->
|
||||||
sources.map { source ->
|
async(dispatcher) {
|
||||||
async(dispatcher) {
|
runCatching {
|
||||||
runCatching {
|
val list = MangaRepository(source).getList(offset = 0, query = q)
|
||||||
val list = MangaRepository(source).getList(offset = 0, query = q)
|
.toUi(ListMode.GRID)
|
||||||
.toUi(ListMode.GRID)
|
if (list.isNotEmpty()) {
|
||||||
if (list.isNotEmpty()) {
|
MultiSearchListModel(source, list.size > MIN_HAS_MORE_ITEMS, list)
|
||||||
MultiSearchListModel(source, list.size > MIN_HAS_MORE_ITEMS, list)
|
} else {
|
||||||
} else {
|
null
|
||||||
null
|
|
||||||
}
|
|
||||||
}.onFailure {
|
|
||||||
it.printStackTraceDebug()
|
|
||||||
}
|
}
|
||||||
|
}.onFailure {
|
||||||
|
it.printStackTraceDebug()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val errors = ArrayList<Throwable>()
|
val errors = ArrayList<Throwable>()
|
||||||
for (deferred in deferredList) {
|
for (deferred in deferredList) {
|
||||||
deferred.await()
|
deferred.await()
|
||||||
@@ -120,13 +119,12 @@ class MultiSearchViewModel(
|
|||||||
errors.add(it)
|
errors.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (listData.value.isNotEmpty()) {
|
if (listData.value.isEmpty()) {
|
||||||
return
|
when (errors.size) {
|
||||||
}
|
0 -> Unit
|
||||||
when (errors.size) {
|
1 -> throw errors[0]
|
||||||
0 -> Unit
|
else -> throw CompositeException(errors)
|
||||||
1 -> throw errors[0]
|
}
|
||||||
else -> throw CompositeException(errors)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user