Skip to content

Commit

Permalink
RSS: fix subject name filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Sep 22, 2024
1 parent 229add3 commit 235d8a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.app.data.source.media.source

import io.ktor.client.request.get
Expand Down Expand Up @@ -147,6 +156,7 @@ class RssMediaSource(
RssSearchQuery(
subjectName = name,
episodeSort = query.episodeSort,
allSubjectNames = query.subjectNames,
),
).map {
MediaMatch(it, MatchKind.FUZZY)
Expand All @@ -157,10 +167,11 @@ class RssMediaSource(

data class RssSearchQuery(
val subjectName: String,
val allSubjectNames: Set<String>,
val episodeSort: EpisodeSort,
)

fun RssSearchQuery.toFilterContext() = MediaListFilterContext(
subjectNames = setOf(subjectName),
subjectNames = allSubjectNames,
episodeSort = episodeSort,
)
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class RssTestPaneState(
val query = RssSearchQuery(
subjectName = testData.keyword,
episodeSort = EpisodeSort(sort),
allSubjectNames = setOf(testData.keyword),
)
viewingItem = null
launchRequestInBackground {
Expand Down

0 comments on commit 235d8a1

Please sign in to comment.