Skip to content

Commit

Permalink
识别 media 标题 "[Movie]" close #1193
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Nov 15, 2024
1 parent cdbf416 commit 60b68b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class LabelFirstRawTitleParser : RawTitleParser() {
|| word.contains("Blu-Ray", ignoreCase = true)
) {
builder.episodeRange = EpisodeRange.unknownSeason()
} else if (word.contains("Movie", ignoreCase = true)) {
// #1193
builder.episodeRange = EpisodeRange.single(EpisodeSort(1))
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions datasource/api/src/commonTest/kotlin/title/TitleParserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,20 @@ class TitleParserTest : PatternBasedTitleParserTestSuite() {
assertEquals("", r.subtitleLanguages.sortedBy { it.id }.joinToString { it.id })
assertEquals("1080P", r.resolution.toString())
}

@Test
fun `movie v2 as 01`() {
val r = parse("[北宇治字幕组] 蓦然回首 / Look Back [Movie v2][WebRip][HEVC_AAC×2][简繁日内封]")
assertEquals("01..01", r.episodeRange.toString())
assertEquals("CHS, CHT, JPN", r.subtitleLanguages.sortedBy { it.id }.joinToString { it.id })
assertEquals("null", r.resolution.toString())
}

@Test
fun `movie as 01`() {
val r = parse("[北宇治字幕组] 蓦然回首 / Look Back [Movie][WebRip][HEVC_AAC×2][简繁日内封]")
assertEquals("01..01", r.episodeRange.toString())
assertEquals("CHS, CHT, JPN", r.subtitleLanguages.sortedBy { it.id }.joinToString { it.id })
assertEquals("null", r.resolution.toString())
}
}

0 comments on commit 60b68b2

Please sign in to comment.