Minor fixes

- Fix categories modal showing when adding from source with no categories
- Use old categories icon in library bottom action menu

(cherry picked from commit 688cc64dffa8cdf1241d3b4e2467b5e8c8529800)

# Conflicts:
#	app/src/main/java/eu/kanade/presentation/components/MangaBottomActionMenu.kt
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
This commit is contained in:
arkon 2022-08-06 16:23:13 -04:00 committed by Jobobby04
parent 8b777e1e5a
commit c0db682476
5 changed files with 10 additions and 3 deletions

View File

@ -23,6 +23,7 @@ import androidx.compose.material.icons.filled.DoneAll
import androidx.compose.material.icons.filled.RemoveDone
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Download
import androidx.compose.material.icons.outlined.Label
import androidx.compose.material.icons.outlined.MoreVert
import androidx.compose.material.icons.outlined.SwapCalls
import androidx.compose.material.ripple.rememberRipple
@ -255,7 +256,7 @@ fun LibraryBottomActionMenu(
if (onChangeCategoryClicked != null) {
Button(
title = stringResource(R.string.action_move_category),
icon = Icons.Default.BookmarkAdd,
icon = Icons.Outlined.Label,
toConfirm = confirm[0],
onLongClick = { onLongClickItem(0) },
onClick = onChangeCategoryClicked,

View File

@ -246,7 +246,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
return super.getPackageName()
}
protected open fun setupNotificationChannels() {
private fun setupNotificationChannels() {
try {
Notifications.createChannels(this)
} catch (e: Exception) {

View File

@ -5,6 +5,7 @@ package eu.kanade.tachiyomi
*
* @since extension-lib 1.3
*/
@Suppress("UNUSED")
object AppInfo {
fun getVersionCode() = BuildConfig.VERSION_CODE
fun getVersionName() = BuildConfig.VERSION_NAME

View File

@ -469,7 +469,10 @@ open class BrowseSourcePresenter(
* @return List of categories, not including the default category
*/
suspend fun getCategories(): List<DomainCategory> {
return getCategories.subscribe().firstOrNull() ?: emptyList()
return getCategories.subscribe()
.firstOrNull()
?.filterNot { it.id == DomainCategory.UNCATEGORIZED_ID }
?: emptyList()
}
suspend fun getDuplicateLibraryManga(manga: DomainManga): DomainManga? {

View File

@ -201,6 +201,7 @@ class FavoritesSyncHelper(val context: Context) {
private suspend fun applyRemoteCategories(categories: List<String>) {
val localCategories = getCategories.await()
.filterNot(Category::isSystemCategory)
categories.forEachIndexed { index, remote ->
val local = localCategories.getOrElse(index) {
@ -346,6 +347,7 @@ class FavoritesSyncHelper(val context: Context) {
val insertedMangaCategories = mutableListOf<Pair<Long, Manga>>()
val categories = getCategories.await()
.filterNot(Category::isSystemCategory)
// Apply additions
throttleManager.resetThrottle()