-
Notifications
You must be signed in to change notification settings - Fork 2
/
seriesFormat.groovy.j2
76 lines (74 loc) · 2.6 KB
/
seriesFormat.groovy.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
def normTV = {
it.replaceAll(/[`´‘’ʻ""“”]/, "'")
.replaceAll(/[|]/, " - ")
.replaceAll(/[?]/, "\uFE56") // "﹖" Small Question Mark
.replaceAll(/[\*]/, "\u204E") // "⁎" low asterisk
.replaceAll(/[*\p{Zs}]+/, " ")
.replaceAll(/\b[IiVvXx]+\b/, { it.upper() })
.replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower() })
}
Boolean isEng = any{ audio.language.any{ it ==~ /en/ } }{ audio.language ==~ /en/ }{true}
allOf
{"TV Shows"}
{
allOf
{ (!isEng && (audio.language != null)) ?
normTV(localize[audio.language[0]].n).colon(" - ").replaceTrailingBrackets() :
normTV(n).colon(" - ").replaceTrailingBrackets() }
{ def firstYear = episodelist.find{ it.regular }.airdate.year
"($firstYear)" }
.join(" ")
}
{ episode.special ? "Specials" : allOf{"Season"}{s}.join(" ") }
/* allOf{"Season"}{s}{sy}.join(" ") --- {sc >= 10 ? s.pad(2) : s} */
{
allOf
{
if (!isEng && (audio.language != null)) {
normTV(localize[audio.language[0]].n).colon("\u2236 ").replaceTrailingBrackets()
} else {
normTV(n).colon("\u2236 ").replaceTrailingBrackets()
}
}
{ episode.special ? "S00E" + special.pad(2) : s00e00 }
{
allOf
// { t.replacePart(replacement = ", Part $1") }
{
if (!isEng && (audio.language != null)) {
normTV(localize[audio.language[0]].t).colon("\u2236 ").slash("\u2571")
} else {
normTV(t).colon("\u2236 ").slash("\u2571") // ╱ is the replacement for slash
}
}
{"PT $pi"}
{
allOf
{" ["}
{
allOf
{ // Video
// net.filebot.media.VideoFormat.DEFAULT_GROUPS.guessFormat(dim[0], dim[1])
allOf
{ vf }
{ vc }
{ include '{{ scriptDir }}/partials/hdrPart.groovy' }
.join(" ")
}
{ include '{{ scriptDir }}/partials/audioPart.groovy' }
{ include '{{ scriptDir }}/partials/extraSource.groovy' }
.join(" - ")
}
{"]"}
{ include '{{ scriptDir }}/partials/repackPart.groovy' }
{ include '{{ scriptDir }}/partials/groupPart.groovy' }
{subt}
.join("")
}
.join(" ")
}
.join(" - ")
}
.join("/")
}