3,699
edits
m (Der Idiot moved page User talk:Dvdkhl to AniAdd without leaving a redirect) |
|||
(20 intermediate revisions by 3 users not shown) | |||
Line 42: | Line 42: | ||
Note: | Note: | ||
* Any string within '' is a terminal, all capital words are non-terminals | * Any string within ' ' is a terminal, all capital words are non-terminals | ||
* To simplify the CFG, possible (redundant) spaces aren't represented as terminals. (Every unquoted space within the CFG represents any count of spaces) | * To simplify the CFG, possible (redundant) spaces aren't represented as terminals. (Every unquoted space within the CFG represents any count of spaces) | ||
* * stands for any count of repetition of the preceding element (including 0 repetitions) | * * stands for any count of repetition of the preceding element (including 0 repetitions) | ||
Line 86: | Line 86: | ||
AnotherVar := YetAnother := "Another Expression list" | AnotherVar := YetAnother := "Another Expression list" | ||
It is also possible to create functions: | It is also possible to create functions: | ||
To create a function instead of a variable, the variable name is followed by <tt>'()'</tt>. | To create a function instead of a variable, the variable name is followed by <tt>'()'</tt>. | ||
Line 171: | Line 170: | ||
==== Comment ==== | ==== Comment ==== | ||
Anything after a <tt>#</tt> is ignored and may be used to comment code sections. | Anything after a <tt>#</tt> is ignored and may be used to comment code sections. | ||
Line 180: | Line 178: | ||
=== Predefined Variables === | === Predefined Variables === | ||
==== Titles ==== | ==== Titles ==== | ||
* ATr, ATe, ATk - Anime title, r: romaji, e: english, k: kanji | * ATr, ATe, ATk, ATs, ATo - Anime title, r: romaji, e: english, k: kanji, s: synonym, o: other | ||
* ETr, ETe, ETk - Episode title, languages as above | * ETr, ETe, ETk - Episode title, languages as above | ||
* GTs, GTl - Group title, s: short, l: long | * GTs, GTl - Group title, s: short, l: long | ||
Line 188: | Line 186: | ||
* EpCount - Anime Episode count | * EpCount - Anime Episode count | ||
* AYearBegin, AYearEnd - The beginning & ending year of the anime | * AYearBegin, AYearEnd - The beginning & ending year of the anime | ||
* ACatList - The Categories associated with the anime. | |||
==== Episode information ==== | |||
* EpNo - File's Episode number | |||
==== File information ==== | ==== File information ==== | ||
Line 194: | Line 197: | ||
* Cen - File is censored if the value is '1' | * Cen - File is censored if the value is '1' | ||
* Ver - File version | * Ver - File version | ||
* Source - Where the file came from (HDTV, DTV, WWW, etc) | |||
* Quality - How good the quality of the file is (Very Good, Good, Eye Cancer) | |||
* AniDBFN - Default AniDB filename | |||
* CurrentFN - Current Filename | |||
* FCrc - The file's crc | |||
* FVideoRes - Video Resolution (e.g. 1920x1080) | |||
* FALng - List of available audio languages (japanese, english'japanese'german) | |||
* FSLng - List of available subtitle languages (japanese, english'japanese'german) | |||
* FACodec - Codecs used for the Audiostreams | |||
* FVCodec - Codecs used for the Videostreams | |||
* Watched - File is watched if the value is '1' otherwise unwatched and "" | |||
More predefined variables will be added on request. | More predefined variables will be added on request. | ||
=== Predefined Functions === | === Predefined Functions === | ||
* NUM $max(NUM, NUM) - Both NUMs need to be numerical string. Returns the greater NUM | * NUM $min/max(NUM, NUM) - Both NUMs need to be numerical string. Returns the smaller/greater NUM | ||
* NUM $len(STR) - Returns a numerical string represinting the character count of STR | * NUM $len(STR) - Returns a numerical string represinting the character count of STR | ||
* STR $pad(STR, NUM, CHAR) - STR: String to be padded | * STR $pad(STR, NUM, CHAR) - STR: String to be padded; NUM min string length; CHAR: The character used to pad the string | ||
* STR $repl(SRC, REGEX, REPL) - SRC: Source | * STR $repl(SRC, REGEX, REPL) - SRC: Source; REGEX: Regex used to match; REPL: replaces every match with REPL | ||
* STR $match(STR, REGEX) STR: Source; REGEX: Match; Returns "1" if STR has a match for REGEX, otherwise unwatched and "" | |||
* STR $uc/lc(STR) Convert string to uppercase/lowercase | |||
* NUM $add/sub/mul/div(NUM, NUM) Add/Substract/Multiply/Divide two numerical strings | |||
* STR $substr(STR, NUM[, NUM]) Returns the substring beginning from seconds param index to end or optionally to the third param index | |||
* NUM $[l]indexof(STR, STR) Returns the first/last index of the substring specified in the second param in the first param string, -1 if there are no occurrences. | |||
More predefined functions will be added on request. | More predefined functions will be added on request. | ||
Line 268: | Line 287: | ||
Depr := {%Depr% ? "[Depr]" : ""} | Depr := {%Depr% ? "[Depr]" : ""} | ||
Here the predefined variables are overwritten with formatted ones: | Here the predefined variables are overwritten with formatted ones: | ||
<tt>Ver</tt> is <tt>""</tt> when it is version 1 otherwise <tt>"v"%Ver%</tt> | <tt>Ver</tt> is <tt>""</tt> when it is version 1 otherwise <tt>"v"%Ver%</tt><br /> | ||
<tt>Cen</tt> is <tt>""</tt> if it is not censored otherwise <tt>"[Cen]"</tt> | <tt>Cen</tt> is <tt>""</tt> if it is not censored otherwise <tt>"[Cen]"</tt><br /> | ||
<tt>Depr</tt> is <tt>""</tt> if it is not deprecated otherwise <tt>"[Depr]"</tt> | <tt>Depr</tt> is <tt>""</tt> if it is not deprecated otherwise <tt>"[Depr]"</tt> | ||
=== Replacing invalid characters === | === Replacing invalid characters === | ||
Line 302: | Line 320: | ||
== Presets == | == Presets == | ||
Original preset with few tweaks. Filename as [group] [title] <epno><version> [uppercase CRC] [source][resolution][video codec].ext | |||
Episode number isn't used only for normal episodes in animes with only 1 of those, but always used is special eps regardless of total eps. | |||
AT:=[%ATr%,%ATe%,%ATk%] | |||
ET:=[%ETe%,%ETr%,%ETk%] | |||
GT:="[" [%GTs%,%GTl%] "]" | |||
EpNoPad:=$pad(%EpNo%,$max($len(%EpHiNo%),$len(%EpCount%)),"0") | |||
Src:="["$repl(%Source%,"B-R","BluRay")"]" | |||
Ver:={%Ver%="1"?"":"v"%Ver%} | |||
Res:="["%FVideoRes%"]" | |||
CRC:="["$uc(%FCrc%)"]" | |||
Codec:="["$repl(%FVCodec%,"H264/AVC","h264")"]" | |||
IsNotNormal:=$match($repl(%EpNo%,"[1234567890]",""),'[SCTPO]') | |||
EpNoV:={%IsNotNormal%="1"?"- "%EpNoPad%:{%EpCount%="1"?:"- "%EpNoPad%}} | |||
FileName:=$repl(%GT%" "%AT%" "%EpNoV%%Ver%" "%CRC%" "%Src% %Res% %Codec%," "," ") | |||
PathName:="F:\" $repl(%AT%,'[\\\":/*|<>?]',"") |