mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-08-19 05:45:41 +00:00
Merge pull request #1749 from skoruppa/cmp-rewrite
Simkl: let anime by a separate type
This commit is contained in:
commit
562266e408
3 changed files with 6 additions and 2 deletions
|
|
@ -170,7 +170,7 @@ internal fun buildLibraryVerticalProjection(
|
|||
}
|
||||
}
|
||||
val availableTypes = deduplicatedEntries.values
|
||||
.map { entry -> entry.item.type.normalizedLibraryType() }
|
||||
.map { entry -> (entry.item.mediaCategory ?: entry.item.type).normalizedLibraryType() }
|
||||
.filter { it.isNotBlank() }
|
||||
.distinct()
|
||||
.sorted()
|
||||
|
|
@ -178,7 +178,7 @@ internal fun buildLibraryVerticalProjection(
|
|||
?.normalizedLibraryType()
|
||||
?.takeIf { it in availableTypes }
|
||||
val filteredEntries = deduplicatedEntries.values.filter { entry ->
|
||||
effectiveType == null || entry.item.type.normalizedLibraryType() == effectiveType
|
||||
effectiveType == null || (entry.item.mediaCategory ?: entry.item.type).normalizedLibraryType() == effectiveType
|
||||
}
|
||||
val entryByKey = filteredEntries.associateBy { entry -> libraryDisplayItemKey(entry.item) }
|
||||
val sortedEntries = sortLibraryItems(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ data class LibraryItem(
|
|||
val imdbId: String? = null,
|
||||
val tmdbId: Int? = null,
|
||||
val traktId: Int? = null,
|
||||
/** Original media category from the tracking provider (e.g. "anime").
|
||||
* Used for UI filtering while [type] stays as "movie"/"series" for meta addon compatibility. */
|
||||
val mediaCategory: String? = null,
|
||||
override val trackingProviderId: String? = null,
|
||||
override val trackingProviderItemId: String? = null,
|
||||
override val trackingSourceUrl: String? = null,
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ private fun SimklLibraryEntry.toLibraryItem(
|
|||
listKeys = setOf(listKey),
|
||||
imdbId = media.ids.idValue("imdb"),
|
||||
tmdbId = media.ids.idValue("tmdb")?.toIntOrNull(),
|
||||
mediaCategory = if (mediaType == SimklMediaType.ANIME) "anime" else null,
|
||||
trackingProviderId = TrackingProviderId.SIMKL.storageId,
|
||||
trackingProviderItemId = simklId?.let { "simkl:$it" },
|
||||
trackingSourceUrl = buildSimklSourceUrl(mediaType, media),
|
||||
|
|
|
|||
Loading…
Reference in a new issue