Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
e4c80b4443
|
|||
|
940d448e00
|
|||
|
5ab48a7545
|
|||
|
cb2bdbdd9a
|
|||
|
|
8fdaf92cc4 | ||
|
|
0416077964 | ||
| 7b60ed6bad |
@@ -17,8 +17,8 @@ android {
|
|||||||
//TODO: update as soon as sources becomes available
|
//TODO: update as soon as sources becomes available
|
||||||
//noinspection OldTargetApi
|
//noinspection OldTargetApi
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 561
|
versionCode 562
|
||||||
versionName '5.3.4'
|
versionName '5.3.5'
|
||||||
generatedDensities = []
|
generatedDensities = []
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ afterEvaluate {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
//noinspection GradleDependency
|
//noinspection GradleDependency
|
||||||
implementation('com.github.KotatsuApp:kotatsu-parsers:06a043d290') {
|
implementation('com.github.KotatsuApp:kotatsu-parsers:db96a1ff2e') {
|
||||||
exclude group: 'org.json', module: 'json'
|
exclude group: 'org.json', module: 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ enum class ScoreFormat {
|
|||||||
|
|
||||||
POINT_5 -> score / 5f
|
POINT_5 -> score / 5f
|
||||||
POINT_3 -> score / 3f
|
POINT_3 -> score / 3f
|
||||||
}
|
}.coerceIn(0f, 1f)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class MALRepository @Inject constructor(
|
|||||||
status = json.getString("status"),
|
status = json.getString("status"),
|
||||||
chapter = json.getInt("num_chapters_read"),
|
chapter = json.getInt("num_chapters_read"),
|
||||||
comment = json.getString("comments"),
|
comment = json.getString("comments"),
|
||||||
rating = json.getDouble("score").toFloat() / 10f,
|
rating = (json.getDouble("score").toFloat() / 10f).coerceIn(0f, 1f),
|
||||||
)
|
)
|
||||||
db.scrobblingDao.upsert(entity)
|
db.scrobblingDao.upsert(entity)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class ShikimoriRepository @Inject constructor(
|
|||||||
status = json.getString("status"),
|
status = json.getString("status"),
|
||||||
chapter = json.getInt("chapters"),
|
chapter = json.getInt("chapters"),
|
||||||
comment = json.getString("text"),
|
comment = json.getString("text"),
|
||||||
rating = json.getDouble("score").toFloat() / 10f,
|
rating = (json.getDouble("score").toFloat() / 10f).coerceIn(0f, 1f),
|
||||||
)
|
)
|
||||||
db.scrobblingDao.upsert(entity)
|
db.scrobblingDao.upsert(entity)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import androidx.annotation.WorkerThread
|
|||||||
import androidx.core.os.LocaleListCompat
|
import androidx.core.os.LocaleListCompat
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.cancelAndJoin
|
||||||
|
import kotlinx.coroutines.ensureActive
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import org.koitharu.kotatsu.core.model.getLocaleTitle
|
import org.koitharu.kotatsu.core.model.getLocaleTitle
|
||||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||||
@@ -19,18 +22,26 @@ class NewSourcesViewModel @Inject constructor(
|
|||||||
|
|
||||||
private val initialList = settings.newSources
|
private val initialList = settings.newSources
|
||||||
val sources = MutableStateFlow<List<SourceConfigItem>?>(null)
|
val sources = MutableStateFlow<List<SourceConfigItem>?>(null)
|
||||||
|
private var listUpdateJob: Job? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
launchJob(Dispatchers.Default) {
|
listUpdateJob = launchJob(Dispatchers.Default) {
|
||||||
sources.value = buildList()
|
sources.value = buildList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onItemEnabledChanged(item: SourceConfigItem.SourceItem, isEnabled: Boolean) {
|
fun onItemEnabledChanged(item: SourceConfigItem.SourceItem, isEnabled: Boolean) {
|
||||||
if (isEnabled) {
|
val prevJob = listUpdateJob
|
||||||
settings.hiddenSources -= item.source.name
|
listUpdateJob = launchJob(Dispatchers.Default) {
|
||||||
} else {
|
if (isEnabled) {
|
||||||
settings.hiddenSources += item.source.name
|
settings.hiddenSources -= item.source.name
|
||||||
|
} else {
|
||||||
|
settings.hiddenSources += item.source.name
|
||||||
|
}
|
||||||
|
prevJob?.cancelAndJoin()
|
||||||
|
val list = buildList()
|
||||||
|
ensureActive()
|
||||||
|
sources.value = list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,3 +72,4 @@ class NewSourcesViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import kotlinx.coroutines.flow.onStart
|
|||||||
import org.koitharu.kotatsu.core.db.MangaDatabase
|
import org.koitharu.kotatsu.core.db.MangaDatabase
|
||||||
import org.koitharu.kotatsu.core.model.FavouriteCategory
|
import org.koitharu.kotatsu.core.model.FavouriteCategory
|
||||||
import org.koitharu.kotatsu.core.prefs.AppSettings
|
import org.koitharu.kotatsu.core.prefs.AppSettings
|
||||||
import org.koitharu.kotatsu.core.prefs.observeAsFlow
|
|
||||||
import org.koitharu.kotatsu.favourites.data.FavouriteCategoryEntity
|
import org.koitharu.kotatsu.favourites.data.FavouriteCategoryEntity
|
||||||
import org.koitharu.kotatsu.favourites.data.toFavouriteCategory
|
import org.koitharu.kotatsu.favourites.data.toFavouriteCategory
|
||||||
import org.koitharu.kotatsu.favourites.data.toMangaList
|
import org.koitharu.kotatsu.favourites.data.toMangaList
|
||||||
@@ -52,8 +51,8 @@ class ShelfContentObserveUseCase @Inject constructor(
|
|||||||
private fun observeLocalManga(sortOrder: SortOrder, limit: Int): Flow<List<Manga>> {
|
private fun observeLocalManga(sortOrder: SortOrder, limit: Int): Flow<List<Manga>> {
|
||||||
return combine<LocalManga?, String, Any?>(
|
return combine<LocalManga?, String, Any?>(
|
||||||
localStorageChanges,
|
localStorageChanges,
|
||||||
settings.observe().filter { it == AppSettings.KEY_LOCAL_MANGA_DIRS }
|
settings.observe().filter { it == AppSettings.KEY_LOCAL_MANGA_DIRS }.onStart { emit("") }
|
||||||
) { _, _ -> Any() }
|
) { a, b -> a to b }
|
||||||
.onStart { emit(null) }
|
.onStart { emit(null) }
|
||||||
.mapLatest {
|
.mapLatest {
|
||||||
localMangaRepository.getList(0, null, sortOrder).take(limit)
|
localMangaRepository.getList(0, null, sortOrder).take(limit)
|
||||||
|
|||||||
@@ -225,4 +225,8 @@
|
|||||||
<string name="various_languages">विभिन्न भाषाहरू</string>
|
<string name="various_languages">विभिन्न भाषाहरू</string>
|
||||||
<string name="search_chapters">अध्याय खोज्नुहोस्</string>
|
<string name="search_chapters">अध्याय खोज्नुहोस्</string>
|
||||||
<string name="appearance">उपस्थिति</string>
|
<string name="appearance">उपस्थिति</string>
|
||||||
|
<string name="history_shortcuts">हालैको मंगा सर्टकट देखाउनुहोस्</string>
|
||||||
|
<string name="reader_control_ltr_summary">दायाँ किनारामा ट्याप गर्नुहोस् वा दायाँ कुञ्जी थिच्दा सधैं अर्को पृष्ठमा स्विच हुन्छ</string>
|
||||||
|
<string name="reader_control_ltr">Ergonomic पाठक नियन्त्रण</string>
|
||||||
|
<string name="manga_error_description_pattern">त्रुटि विवरण:<br> <tt>%1$s</tt><br><br> 1. <a href=%2$s>वेब ब्राउजरमा मंगा खोल्ने</a> प्रयास गर्नुहोस् कि यो यसको स्रोतमा उपलब्ध छ<br> 2. निश्चित गर्नुहोस् कि तपाइँ <a href=kotatsu://about>Kotatsu को नवीनतम संस्करण</a> प्रयोग गर्दै हुनुहुन्छ<br> 3. यदि यो उपलब्ध छ भने, विकासकर्ताहरूलाई त्रुटि रिपोर्ट पठाउनुहोस्।</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -389,7 +389,7 @@
|
|||||||
<string name="address">Địa chỉ</string>
|
<string name="address">Địa chỉ</string>
|
||||||
<string name="invert_colors">Đảo màu</string>
|
<string name="invert_colors">Đảo màu</string>
|
||||||
<string name="invalid_port_number">Cổng không hợp lệ</string>
|
<string name="invalid_port_number">Cổng không hợp lệ</string>
|
||||||
<string name="download_option_manual_selection">Chọn các chương bằng tay</string>
|
<string name="download_option_manual_selection">Chọn thủ công các chương</string>
|
||||||
<string name="download_option_all_unread">Tất cả các chương chưa đọc</string>
|
<string name="download_option_all_unread">Tất cả các chương chưa đọc</string>
|
||||||
<string name="resume">Tiếp tục</string>
|
<string name="resume">Tiếp tục</string>
|
||||||
<string name="clear_new_chapters_counters">Xoá thông tin về chương mới</string>
|
<string name="clear_new_chapters_counters">Xoá thông tin về chương mới</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user