Compare commits

...

6 Commits

Author SHA1 Message Date
dfb88feaf0 Update parsers 2023-04-06 19:48:22 +03:00
tryvseu
149b171eda Added translation using Weblate (Norwegian Nynorsk)
Added translation using Weblate (Norwegian Nynorsk)

Co-authored-by: tryvseu <tryvseu@tuta.io>
2023-04-06 18:44:43 +03:00
InfinityDouki56
c70a2487d9 Translated using Weblate (Filipino)
Currently translated at 92.2% (393 of 426 strings)

Co-authored-by: InfinityDouki56 <ced.paltep10@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/kotatsu/strings/fil/
Translation: Kotatsu/Strings
2023-04-06 18:44:43 +03:00
865f335b25 Fix lint errors 2023-03-25 16:26:24 +02:00
6b1e89eda8 Update parsers 2023-03-25 16:04:57 +02:00
0dbaf919e2 Remove pages duplicates #309 2023-03-25 15:48:39 +02:00
7 changed files with 41 additions and 9 deletions

View File

@@ -15,8 +15,8 @@ android {
applicationId 'org.koitharu.kotatsu'
minSdkVersion 21
targetSdkVersion 33
versionCode 522
versionName '4.4.6'
versionCode 524
versionName '4.4.8'
generatedDensities = []
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -59,7 +59,7 @@ android {
]
}
lint {
abortOnError false
abortOnError true
disable 'MissingTranslation', 'PrivateResource', 'NotifyDataSetChanged'
}
testOptions {
@@ -79,7 +79,7 @@ afterEvaluate {
}
dependencies {
//noinspection GradleDependency
implementation('com.github.KotatsuApp:kotatsu-parsers:cc418570d5') {
implementation('com.github.KotatsuApp:kotatsu-parsers:2340100999') {
exclude group: 'org.json', module: 'json'
}

View File

@@ -1,5 +1,6 @@
package org.koitharu.kotatsu.core.parser
import android.util.Log
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -9,6 +10,7 @@ import kotlinx.coroutines.currentCoroutineContext
import okhttp3.Headers
import okhttp3.Interceptor
import okhttp3.Response
import org.koitharu.kotatsu.BuildConfig
import org.koitharu.kotatsu.core.cache.ContentCache
import org.koitharu.kotatsu.core.cache.SafeDeferred
import org.koitharu.kotatsu.core.prefs.SourceSettings
@@ -77,7 +79,7 @@ class RemoteMangaRepository(
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
cache.getPages(source, chapter.url)?.let { return it }
val pages = asyncSafe {
parser.getPages(chapter)
parser.getPages(chapter).distinctById()
}
cache.putPages(source, chapter.url, pages)
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
}
}

View File

@@ -408,4 +408,17 @@
<string name="download_started">Nagsimula na ang pag-download</string>
<string name="color_theme">Scheme ng kulay</string>
<string name="theme_name_miku">Miku</string>
<string name="user_agent">Header ng UserAgent</string>
<string name="cache">Cache</string>
<string name="text_file_sizes">B|kB|MB|GB|TB</string>
<string name="standard">Standard</string>
<string name="webtoon">Webtoon</string>
<string name="read_mode">Read mode</string>
<string name="error">Error</string>
<string name="internal_storage">Internal storage</string>
<string name="external_storage">External storage</string>
<string name="vibration">Vibration</string>
<string name="domain">Domain</string>
<string name="light_indicator">LED indicator</string>
<string name="settings_apply_restart_required">Mangyaring i-restart ang application upang ilapat ang mga pagbabagong ito</string>
</resources>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View File

@@ -4,5 +4,4 @@
<dimen name="grid_spacing_outer">2dp</dimen>
<dimen name="preferred_grid_width">140dp</dimen>
<dimen name="bottom_sheet_width">420dp</dimen>
<dimen name="fragment_horizontal_margin">48dp</dimen>
</resources>
</resources>

View File

@@ -405,8 +405,6 @@
<string name="show_suspicious_content">显示可疑内容</string>
<string name="theme_name_dynamic">动态</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="theme_name_miku">Miku</string>
<string name="theme_name_asuka">Asuka</string>