Skip to content

Commit

Permalink
Use better Country of Origin detection
Browse files Browse the repository at this point in the history
* Prioritize build-in `anime` variable first
* Replace `genres` to `info.Keywords`, making it TMDB-only script
* Add `KP` (N. Korea) to country lookup. Reason: aniDB indexed NK aeni.
  • Loading branch information
nattadasu authored Aug 3, 2024
1 parent 1df41f3 commit f928d53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ You can refer to `compiled/` directory to check logics that FileBot will use.
### POSIX, TV

THIS SCRIPT MUST BE USED WITH TMDB AS DATA SOURCE

```groovy
@FileBot/_posix_tv.groovy
```

### POSIX, Movies

THIS SCRIPT MUST BE USED WITH TMDB AS DATA SOURCE

```groovy
@FileBot/_posix_movie.groovy
```
Expand All @@ -62,12 +66,16 @@ You can refer to `compiled/` directory to check logics that FileBot will use.

### Windows, TV

THIS SCRIPT MUST BE USED WITH TMDB AS DATA SOURCE

```groovy
@FileBot/_windows_tv.groovy
```

### Windows, Movies

THIS SCRIPT MUST BE USED WITH TMDB AS DATA SOURCE

```groovy
@FileBot/_windows_movie.groovy
```
Expand Down
8 changes: 4 additions & 4 deletions common_movie.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
// check Country of Origin
def cjk_countries = /(CN|KR|JP|TW|HK)/
def cjkani_tags = /(Aeni|Donghua|Anime)/
def isAnime = genres =~ cjkani_tags || (genres =~ /Animation/ && country =~ cjk_countries) || anime ? true : false
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

// Categorized path
def cust_cat = isAnime ? "Videos/Anime " : "Videos/"
def cust_cat = is_anime ? "Videos/Anime " : "Videos/"
"$cust_cat" + "Movies/"
}
@./medianame.groovy
Expand Down
9 changes: 4 additions & 5 deletions common_tv.groovy
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
// check Country of Origin
def cjk_countries = /(CN|KR|JP|TW|HK)/
def cjkani_tags = /(Aeni|Donghua|Anime)/
def isAnime = genres =~ cjkani_tags || (genres =~ /Animation/ && country =~ cjk_countries) || anime ? true : false
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

// Categorized path
def cust_cat = isAnime ? "Videos/Anime" : "Videos/TV Series"
"$cust_cat/"
is_anime ? "Videos/Anime/" : "Videos/TV Series/"
}
@./medianame.groovy
@./season.groovy
Expand Down

0 comments on commit f928d53

Please sign in to comment.