From 42247c1d57ef748f5bf0729c22363a818e3fa07c Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Tue, 5 May 2026 13:09:48 +0530 Subject: [PATCH] ref(folder): remove trailing (none) when no genre is set --- .../nuvio/app/features/collection/CollectionModels.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/CollectionModels.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/CollectionModels.kt index 3a6a6013..ba9080d6 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/CollectionModels.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/CollectionModels.kt @@ -62,7 +62,7 @@ data class CollectionSource( addonId = sourceAddonId, type = sourceType, catalogId = sourceCatalogId, - genre = genre, + genre = genre.normalizedOptionalGenre(), ) } } @@ -193,7 +193,7 @@ data class CollectionFolder( addonId = source.addonId, type = source.type, catalogId = source.catalogId, - genre = source.genre, + genre = source.genre.normalizedOptionalGenre(), ) } } @@ -217,6 +217,11 @@ data class Collection( get() = FolderViewMode.fromString(viewMode) } +private fun String?.normalizedOptionalGenre(): String? = + this + ?.trim() + ?.takeIf { it.isNotEmpty() && !it.equals("none", ignoreCase = true) } + data class AvailableCatalog( val addonId: String, val addonName: String,