File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ exports.addDefaults = /** @type Parser */ parser => {
232
232
const middleTitle = title . slice ( startIndex , endIndex ) ;
233
233
234
234
// try to match the episode inside the title with a separator, if not found include the start of the title as well
235
- const matches = beginningTitle . match ( / (?< ! m o v i e \W * | f i l m \W * | ^ ) (?: [ . ] + - [ . ] + | [ ( [ ] [ . ] * ) ( \d { 1 , 4 } ) (?: a | b | v \d ) ? (?: \W | $ ) (? ! m o v i e | f i l m ) / i ) ||
235
+ const matches = Array . from ( beginningTitle . matchAll ( / (?< ! m o v i e \W * | f i l m \W * | ^ ) (?: [ . ] + - [ . ] + | [ ( [ ] [ . ] * ) ( \d { 1 , 4 } ) (?: a | b | v \d | \. \d ) ? (?: \W | $ ) (? ! m o v i e | f i l m | \d + ) / gi ) ) . pop ( ) ||
236
236
middleTitle . match ( / ^ (?: [ ( [ - ] [ . ] ? ) ? ( \d { 1 , 4 } ) (?: a | b | v \d ) ? (?: \W | $ ) (? ! m o v i e | f i l m ) / i) ;
237
237
238
238
if ( matches ) {
Original file line number Diff line number Diff line change @@ -674,6 +674,11 @@ describe("Parsing episode", () => {
674
674
expect ( parse ( releaseName ) ) . to . deep . include ( { episode : 35 } ) ;
675
675
} ) ;
676
676
677
+ it ( "should detect anime episode with hyphen number in title" , ( ) => {
678
+ const releaseName = "[SubsPlease] Fairy Tail - 100 Years Quest - 05 (1080p) [1107F3A9].mkv" ;
679
+ expect ( parse ( releaseName ) ) . to . deep . include ( { episode : 5 } ) ;
680
+ } ) ;
681
+
677
682
it ( "should detect anime episode recap episode" , ( ) => {
678
683
const releaseName = "[KH] Sword Art Online II - 14.5 - Debriefing.mkv" ;
679
684
expect ( parse ( releaseName ) ) . to . deep . include ( { episode : 14 } ) ;
You can’t perform that action at this time.
0 commit comments