Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 865f335b25 | |||
| 6b1e89eda8 | |||
| 0dbaf919e2 |
@@ -15,8 +15,8 @@ android {
|
|||||||
applicationId 'org.koitharu.kotatsu'
|
applicationId 'org.koitharu.kotatsu'
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 522
|
versionCode 523
|
||||||
versionName '4.4.6'
|
versionName '4.4.7'
|
||||||
generatedDensities = []
|
generatedDensities = []
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ android {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
abortOnError false
|
abortOnError true
|
||||||
disable 'MissingTranslation', 'PrivateResource', 'NotifyDataSetChanged'
|
disable 'MissingTranslation', 'PrivateResource', 'NotifyDataSetChanged'
|
||||||
}
|
}
|
||||||
testOptions {
|
testOptions {
|
||||||
@@ -79,7 +79,7 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation('com.github.KotatsuApp:kotatsu-parsers:cc418570d5') {
|
implementation('com.github.KotatsuApp:kotatsu-parsers:a3ffecc00f') {
|
||||||
exclude group: 'org.json', module: 'json'
|
exclude group: 'org.json', module: 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.koitharu.kotatsu.core.parser
|
package org.koitharu.kotatsu.core.parser
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import kotlinx.coroutines.CoroutineDispatcher
|
import kotlinx.coroutines.CoroutineDispatcher
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -9,6 +10,7 @@ import kotlinx.coroutines.currentCoroutineContext
|
|||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
|
import org.koitharu.kotatsu.BuildConfig
|
||||||
import org.koitharu.kotatsu.core.cache.ContentCache
|
import org.koitharu.kotatsu.core.cache.ContentCache
|
||||||
import org.koitharu.kotatsu.core.cache.SafeDeferred
|
import org.koitharu.kotatsu.core.cache.SafeDeferred
|
||||||
import org.koitharu.kotatsu.core.prefs.SourceSettings
|
import org.koitharu.kotatsu.core.prefs.SourceSettings
|
||||||
@@ -77,7 +79,7 @@ class RemoteMangaRepository(
|
|||||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||||
cache.getPages(source, chapter.url)?.let { return it }
|
cache.getPages(source, chapter.url)?.let { return it }
|
||||||
val pages = asyncSafe {
|
val pages = asyncSafe {
|
||||||
parser.getPages(chapter)
|
parser.getPages(chapter).distinctById()
|
||||||
}
|
}
|
||||||
cache.putPages(source, chapter.url, pages)
|
cache.putPages(source, chapter.url, pages)
|
||||||
return pages.await()
|
return pages.await()
|
||||||
@@ -108,4 +110,20 @@ class RemoteMangaRepository(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun List<MangaPage>.distinctById(): List<MangaPage> {
|
||||||
|
if (isEmpty()) {
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
val result = ArrayList<MangaPage>(size)
|
||||||
|
val set = HashSet<Long>(size)
|
||||||
|
for (page in this) {
|
||||||
|
if (set.add(page.id)) {
|
||||||
|
result.add(page)
|
||||||
|
} else if (BuildConfig.DEBUG) {
|
||||||
|
Log.w(null, "Duplicate page: $page")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,4 @@
|
|||||||
<dimen name="grid_spacing_outer">2dp</dimen>
|
<dimen name="grid_spacing_outer">2dp</dimen>
|
||||||
<dimen name="preferred_grid_width">140dp</dimen>
|
<dimen name="preferred_grid_width">140dp</dimen>
|
||||||
<dimen name="bottom_sheet_width">420dp</dimen>
|
<dimen name="bottom_sheet_width">420dp</dimen>
|
||||||
<dimen name="fragment_horizontal_margin">48dp</dimen>
|
</resources>
|
||||||
</resources>
|
|
||||||
|
|||||||
@@ -405,8 +405,6 @@
|
|||||||
<string name="show_suspicious_content">显示可疑内容</string>
|
<string name="show_suspicious_content">显示可疑内容</string>
|
||||||
<string name="theme_name_dynamic">动态</string>
|
<string name="theme_name_dynamic">动态</string>
|
||||||
<string name="color_theme">颜色方案</string>
|
<string name="color_theme">颜色方案</string>
|
||||||
<string name="theme_name_mint">薄荷绿</string>
|
|
||||||
<string name="theme_name_october">October</string>
|
|
||||||
<string name="show_in_grid_view">用网格视图显示</string>
|
<string name="show_in_grid_view">用网格视图显示</string>
|
||||||
<string name="theme_name_miku">Miku</string>
|
<string name="theme_name_miku">Miku</string>
|
||||||
<string name="theme_name_asuka">Asuka</string>
|
<string name="theme_name_asuka">Asuka</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user