AniDB O'Matic - Documentation: Local file renaming
File renaming patterns
AoM contains a comprehensive number of patterns to fully customize file names and paths. In order for the pattern to allow very complex rules it essentially allows light scripting. The path can be a complete path or a partial path, in case of a partial path the current file manager is used to place the file based on a known root or from the root folder of the file manager, see file managers below for more details. File extensions are automatically added to the end of the pattern.
Here's a few sample patterns:
- "?a - ?ep - ?e [?g]" ->
"Anime - 02 - Episode name [Group name]" - "?a - ?epv?v - ?e?if(lg<>'', ' ['+lg+']', '')" ->
With group: "Anime - 02v1 - Episode name [Group name]"
Without group:"Anime - 02v1 - Episode name" - "?if(wltw, 'To watch\', '')?a?if(isMovie, if(moviePartCount>1, ' - Part '+partno+if(v>1, 'v'+v, ''), if(v>1, ' - v'+v, '')), ep+if(v>1, v, '')+'- ?e') ?if(lg<>'', lg+' ', ''){?crc32}" ->
For a movie: "Anime name - v2 [Group name]{crc32}"
For a movie with 2 parts: "Anime name - Part 2v2 [Group name]{crc32}
For a normal anime, marked as "to watch in wishlist": "To watch\Anime name - 02v2 - Episode name [Group name]{crc32}
Custom tags
AOM still supports custom tags to simplify rules. Custom tags works as follows:
- Specified like a normal tag but in all uppercase, for example "?G".
- If any subpart of the tag is empty, the whole tag is skipped, except:
- If the tag contains ?if statements, these are not checked if they're empty.
With this you could simplify the group rule, for example you could write it:
- Using ?if: "?if(lg<>'', '['+lg+']', '')" -> "%G"
- Simplest form: "[?lg]" -> "%G"
- More advanced example: "?if(lg<>'', '['+lg']', if(sg<>'', '['+sg']', '[RAW]'))" -> "%G"