mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-31 14:33:50 -04:00
Improve comic-downloader parsing (#650)
Sometimes comic-downloader will have filenames like spawn-chapter-123. Previously we did not support the -chapter- part, this patch adds support for it.
This commit is contained in:
parent
a14ea4c9ae
commit
12f96a5504
@ -40,6 +40,7 @@ namespace API.Tests.Parser
|
|||||||
[InlineData("Batman Wayne Family Adventures - Ep. 001 - Moving In", "Batman Wayne Family Adventures")]
|
[InlineData("Batman Wayne Family Adventures - Ep. 001 - Moving In", "Batman Wayne Family Adventures")]
|
||||||
[InlineData("Saga 001 (2012) (Digital) (Empire-Zone).cbr", "Saga")]
|
[InlineData("Saga 001 (2012) (Digital) (Empire-Zone).cbr", "Saga")]
|
||||||
[InlineData("spawn-123", "spawn")]
|
[InlineData("spawn-123", "spawn")]
|
||||||
|
[InlineData("spawn-chapter-123", "spawn")]
|
||||||
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "Spawn")]
|
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "Spawn")]
|
||||||
[InlineData("Batman Beyond 04 (of 6) (1999)", "Batman Beyond")]
|
[InlineData("Batman Beyond 04 (of 6) (1999)", "Batman Beyond")]
|
||||||
[InlineData("Batman Beyond 001 (2012)", "Batman Beyond")]
|
[InlineData("Batman Beyond 001 (2012)", "Batman Beyond")]
|
||||||
@ -79,6 +80,7 @@ namespace API.Tests.Parser
|
|||||||
[InlineData("Invincible 033.5 - Marvel Team-Up 14 (2006) (digital) (Minutemen-Slayer)", "0")]
|
[InlineData("Invincible 033.5 - Marvel Team-Up 14 (2006) (digital) (Minutemen-Slayer)", "0")]
|
||||||
[InlineData("Cyberpunk 2077 - Trauma Team 04.cbz", "0")]
|
[InlineData("Cyberpunk 2077 - Trauma Team 04.cbz", "0")]
|
||||||
[InlineData("spawn-123", "0")]
|
[InlineData("spawn-123", "0")]
|
||||||
|
[InlineData("spawn-chapter-123", "0")]
|
||||||
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "0")]
|
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "0")]
|
||||||
[InlineData("Batman Beyond 04 (of 6) (1999)", "0")]
|
[InlineData("Batman Beyond 04 (of 6) (1999)", "0")]
|
||||||
[InlineData("Batman Beyond 001 (2012)", "0")]
|
[InlineData("Batman Beyond 001 (2012)", "0")]
|
||||||
@ -117,6 +119,7 @@ namespace API.Tests.Parser
|
|||||||
[InlineData("Batman Wayne Family Adventures - Ep. 014 - Moving In", "14")]
|
[InlineData("Batman Wayne Family Adventures - Ep. 014 - Moving In", "14")]
|
||||||
[InlineData("Saga 001 (2012) (Digital) (Empire-Zone)", "1")]
|
[InlineData("Saga 001 (2012) (Digital) (Empire-Zone)", "1")]
|
||||||
[InlineData("spawn-123", "123")]
|
[InlineData("spawn-123", "123")]
|
||||||
|
[InlineData("spawn-chapter-123", "123")]
|
||||||
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "62")]
|
[InlineData("Spawn 062 (1997) (digital) (TLK-EMPIRE-HD).cbr", "62")]
|
||||||
[InlineData("Batman Beyond 04 (of 6) (1999)", "4")]
|
[InlineData("Batman Beyond 04 (of 6) (1999)", "4")]
|
||||||
[InlineData("Invincible 052 (c2c) (2008) (Minutemen-TheCouple)", "52")]
|
[InlineData("Invincible 052 (c2c) (2008) (Minutemen-TheCouple)", "52")]
|
||||||
|
@ -278,9 +278,9 @@ namespace API.Parser
|
|||||||
new Regex(
|
new Regex(
|
||||||
@"^(?<Series>.*)(?: |_)(?!\(\d{4}|\d{4}-\d{2}\))\(",
|
@"^(?<Series>.*)(?: |_)(?!\(\d{4}|\d{4}-\d{2}\))\(",
|
||||||
MatchOptions, RegexTimeout),
|
MatchOptions, RegexTimeout),
|
||||||
// spawn-123 (from https://github.com/Girbons/comics-downloader)
|
// spawn-123, spawn-chapter-123 (from https://github.com/Girbons/comics-downloader)
|
||||||
new Regex(
|
new Regex(
|
||||||
@"^(?<Series>.+?)-(?<Chapter>\d+)",
|
@"^(?<Series>.+?)-(chapter-)?(?<Chapter>\d+)",
|
||||||
MatchOptions, RegexTimeout),
|
MatchOptions, RegexTimeout),
|
||||||
// MUST BE LAST: Batman & Daredevil - King of New York
|
// MUST BE LAST: Batman & Daredevil - King of New York
|
||||||
new Regex(
|
new Regex(
|
||||||
@ -348,9 +348,9 @@ namespace API.Parser
|
|||||||
new Regex(
|
new Regex(
|
||||||
@"^(?!Vol)(?<Series>.+?)( |_)i(ssue)( |_) #(?<Chapter>\d*)",
|
@"^(?!Vol)(?<Series>.+?)( |_)i(ssue)( |_) #(?<Chapter>\d*)",
|
||||||
MatchOptions, RegexTimeout),
|
MatchOptions, RegexTimeout),
|
||||||
// spawn-123 (from https://github.com/Girbons/comics-downloader )
|
// spawn-123, spawn-chapter-123 (from https://github.com/Girbons/comics-downloader)
|
||||||
new Regex(
|
new Regex(
|
||||||
@"^(?<Series>.+?)-(?<Chapter>\d+)",
|
@"^(?<Series>.+?)-(chapter-)?(?<Chapter>\d+)",
|
||||||
MatchOptions, RegexTimeout),
|
MatchOptions, RegexTimeout),
|
||||||
// Cyberpunk 2077 - Your Voice 01
|
// Cyberpunk 2077 - Your Voice 01
|
||||||
// new Regex(
|
// new Regex(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user