Skip to content

Commit

Permalink
Refactor ID handling to improve consistency across database checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadasu committed Dec 6, 2024
1 parent effdbea commit ae09048
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion modules/medianame.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
// Replace title from short_title if series_id matches "series" from filebot
// Otherwise, use the original name
def database = any { info.database } { "IMDb" }
def fixed_id = database == "IMDb" ? "tt${id}" : id
def name_ = n
short_title.each {
if (it.mid == id && it.src == database) {
if (it.mid == fixed_id && it.src == database) {
name_ = it.title
}
}
Expand Down
11 changes: 8 additions & 3 deletions modules/r18_checker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
[236530, tmdb_tv] // How I Attended an All-Guy's Mixer, 2024
]

def database = any { info.database } { "IMDb" }
def fixed_id = database == "IMDb" ? "tt${id}" : id

// REQUIRES USER TO SET ADDITIONAL PROPERTY ON FILEBOT
// READ: https://www.filebot.net/forums/viewtopic.php?p=58610#p58610
def is_adult = any { info.adult } { false }

def is_same_id = known_titles.find { it[0] == id && it[1] == info.database } != null
def is_adult_override = override_tag.find { it[0] == id && it[1] == info.database } != null
is_same_id = is_adult_override ? false : is_same_id
def is_same_id = known_titles.find { it[0] == fixed_id && it[1] == database } != null
def is_adult_override = override_tag.find { it[0] == fixed_id && it[1] == database } != null
def is_r18 = info.Keywords.findAll { it in known_tags } || is_same_id || is_adult

// Apply R18+ tag to the path name
is_r18 = is_adult_override ? false : is_r18
is_r18 ? "R18+ " : ""
}

0 comments on commit ae09048

Please sign in to comment.