I'm trying to refine my naming scheme for Anime.
The issue is that AniDB is the only database that has properly romanized original titles, whereas TheTVDB only has the original Japanese ones.
However I would also like to use TheTVDB for organization, as the most common scraper is TheTVDB (both for Plex and Kodi).
Final result I would like to have is something like:
Code: Select all
Anime/Mob Psycho 100 (2016)/Season 2 [Mob Psycho 100 II] (2019)/[HorribleSubs] Mob Psycho 100 - EP13 - Biribiri, Dareka ga Mite Iru [Ripped Apart, Someone Is Watching] [720p x264 - 2.0 AAC LC Jpn][0AE0673C].mkv
Anime/Neon Genesis Evangelion (1995)/Season 1 [Shinseiki Evangelion] (1995)/[NTb] Shinseiki Evangelion - EP01 - Shito, Shuurai [Angel Attack!] [720p x264 - 2.0 FLAC Jpn, 5.1 AC-3 Jpn, 5.1 AC-3 Eng - BluRay][D11B2120].mkv
Episode would be absolute numbering from TheTVDB (Mob Psycho 100 II would start from 13).
I'm currently using --db AniDB, --mapper "label =~ /anime/ ? [episode, XEM.TheTVDB] : [episode, XEM.AniDB]", and the following animeFormat (comments where it's broken):
Code: Select all
{
def norm = { it.replaceAll(/[`´‘’ʻ""“”]/, "'")
.replaceAll(/[|]/, " - ")
.replaceAll(/[?]/, "\uFE56")
.replaceAll(/[*\p{Zs}]+/, " ")
.replaceAll(/\b[IiVvXx]+\b/, { it.upper() })
.replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() }) }
def isEng = any{ audio.language.first() ==~ /en/ }{ true }
def isJpn = any{ languages.first().ISO2 ==~ /ja/ || audio.language.first() ==~ /ja/ }{ false }
String theTVDBseriesName = XEM.TheTVDB.seriesName
String mainTitle = any{ theTVDBseriesName }{ norm(n).colon(" - ").replaceTrailingBrackets() }
String primTitle = norm(primaryTitle).colon(" - ")
allOf
{ "Anime" }
{
allOf
{ mainTitle }
{ "($y)" } // can't use it as it refers to AniDB year e.g. 2019 for Mob Psycho 100 S2
.join(" ")
}
{
if (episode.special) {
"Specials"
} else {
allOf
{ "Season" }
{ s }
{ if (mainTitle != primTitle) "[" + norm(primaryTitle).colon(" - ") + "]" }
{ "($sy)" } // missing as AniDB doesn't have it, but would match $y
.join(" ")
}
}
{ allOf
{ allOf
{ def grp = net.filebot.media.MediaDetection.releaseInfo.getReleaseGroup(fn.replaceAll(/\[.*\]$/, ""))
(grp) ? "[$grp]" : "[$group]" }
{ mainTitle }
.join(" ") }
{ episode.special ? "S$special" : "EP" + XEM.TheTVDB.absolute.pad(2) }
{ allOf
{ def trLang = any{ if (isJpn) "x-jat" }{ if (isEng) "eng" }{ audio.language.first() }{"eng"}
switch (trLang) {
case { it == "x-jat" }:
allOf
{ norm(localize."$trLang".t).colon(", ").slash("\u2571") }
{ "[" + norm(t).colon(", ").slash("\u2571") + "]" }
.join(" ")
break
case { it == "eng" }:
norm(t).colon(", ").slash("\u2571")
break
default:
norm(localize."$trLang".t).colon(", ").slash("\u2571")
}
}
// simplified rest of the naming (not relevant)
{ allOf
{" ["}
{ allOf{vf}{vc}.join(" ") }
{"]"}
.join("") }
.join(" ") }
.join(" - ") }
.join("/") }