From 569255a697ea59728dd9a975c0a39f0a3fa891fd Mon Sep 17 00:00:00 2001 From: Natsu Tadama Date: Wed, 4 Dec 2024 02:30:23 +0700 Subject: [PATCH] Use Arrays instead regex string to check if its Anime/Donghua/Aeni --- modules/common_movie.groovy | 9 ++++----- modules/common_tv.groovy | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/common_movie.groovy b/modules/common_movie.groovy index a369f49..c90c639 100644 --- a/modules/common_movie.groovy +++ b/modules/common_movie.groovy @@ -2,12 +2,11 @@ @./r18_checker.groovy { // check Country of Origin - def cjk_countries = /(CN|JP|KR|KP|TW|HK)/ - def cjkani_tags = /(aeni|donghua|anime)/ - def is_anime = anime || info.Keywords =~ cjkani_tags || any {(genres =~ /Animation/ && country =~ cjk_countries)}{false} ? true : false - + def cjk_countries = ["CN", "JP", "KR", "KP", "TW", "HK"] + def cjkani_tags = ["aeni", "donghua", "anime"] + def is_cjk = any { anime } { info.Keywords.findAll { it in cjkani_tags } } { cjk_countries.contains(country) } { false } // Categorized path - is_anime ? "Anime Movies/" : "Movies/" + is_cjk && genres =~ /Animation/ ? "Anime Movies/" : "Movies/" } @./medianame.groovy {" ("}{y}{") [tmdbid-"}{tmdbid}{"]/"} diff --git a/modules/common_tv.groovy b/modules/common_tv.groovy index e689d74..9bd98ed 100644 --- a/modules/common_tv.groovy +++ b/modules/common_tv.groovy @@ -2,12 +2,11 @@ @./r18_checker.groovy { // check Country of Origin - def cjk_countries = /(CN|JP|KR|KP|TW|HK)/ - def cjkani_tags = /(aeni|donghua|anime)/ - def is_anime = anime || info.Keywords =~ cjkani_tags || (genres =~ /Animation/ && country =~ cjk_countries) ? true : false - + def cjk_countries = ["CN", "JP", "KR", "KP", "TW", "HK"] + def cjkani_tags = ["aeni", "donghua", "anime"] + def is_cjk = any { anime } { info.Keywords.findAll { it in cjkani_tags } } { cjk_countries.contains(country) } { false } // Categorized path - is_anime ? "Anime/" : "TV Series/" + is_cjk && genres =~ /Animation/ ? "Anime/" : "TV Series/" } @./medianame.groovy @./forceshowid_tv.groovy