From 60b68b25fd51b6beb047ee69c42d1e89fba1c2ea Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 15 Nov 2024 19:53:38 +0000 Subject: [PATCH] =?UTF-8?q?=E8=AF=86=E5=88=AB=20media=20=E6=A0=87=E9=A2=98?= =?UTF-8?q?=20"[Movie]"=20close=20#1193?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../topic/titles/LabelFirstRawTitleParser.kt | 3 +++ .../commonTest/kotlin/title/TitleParserTest.kt | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/datasource/api/src/commonMain/kotlin/topic/titles/LabelFirstRawTitleParser.kt b/datasource/api/src/commonMain/kotlin/topic/titles/LabelFirstRawTitleParser.kt index 8a35ac04c7..6468bc2193 100644 --- a/datasource/api/src/commonMain/kotlin/topic/titles/LabelFirstRawTitleParser.kt +++ b/datasource/api/src/commonMain/kotlin/topic/titles/LabelFirstRawTitleParser.kt @@ -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)) } } } diff --git a/datasource/api/src/commonTest/kotlin/title/TitleParserTest.kt b/datasource/api/src/commonTest/kotlin/title/TitleParserTest.kt index 57aeed0d32..db5d402763 100644 --- a/datasource/api/src/commonTest/kotlin/title/TitleParserTest.kt +++ b/datasource/api/src/commonTest/kotlin/title/TitleParserTest.kt @@ -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()) + } } \ No newline at end of file