From AniDB
Jump to navigation Jump to search

New Anime Page Patterns and Usage

The new anime page can use patterns to format your ed2k link praticaly any way you like, just use the 30 odd currently available formats to that end.

Preferences for ed2k links

Some settings to control general aspect of ed2k links.

Episode number style

Convert episode number to maximum number of digits of the anime padding with 0's or leave as is.

Replace spaces in file name

Convert spaces in file name.

Replace character

If you choose to replace spaces in file name, you can enter the replace character here.

Preferences for ed2k Custom Link

If you want you can specify your own ed2k link format for links.

Patterns available

Anime Title (uses default language definitions)
Anime Alternative Title
Episode Title (uses default language definitions)
Episode Alternative title
Episode number
Part name ("EP" if anime.type != 4 || "PA" otherwise)
Full part name ("Episode" if anime.type != 4 || "Part" otherwise)
if file is raw (no subtitles outputs RAW)
Crc sum or INVALID if crc invalid
Crc sum (in caps) or INVALID if crc invalid
Version string (only if version > 1)
Censored string (cen)
Uncensored string (cen)
Dub languages (ALL OF THEM, comma separated)
Sub languages (ALL OF THEM, comma separated)
%lang (current db format)
dub.sub_jp,de,,en (extended format)
Group short name
Group full name
Video codec (first video stream)
Audio codec (first audio stream)
Audio channels (first audio stream)
Total number of episodes
[unknown, TV, OVA, Movie, Other, web]
File ID
Anime ID
Episode ID
Group ID
file size (bytes, dot separated)
file size (auto)
file size
file extension
ed2k hash

*If* like cases

Currently there's a way to make something like if cases, imagine that you want to show that a file is raw you could do something like this:

[%raw] %ann - %enr - %epn

But that would show for files that weren't raw some thing like this: "[] Full Metal Panic! - 01 - The guy I kinda Like is a Sergeant".

What you can use is '<' and '>' pairs, if a pattern inside of '<' and '>' returns "" the entire text inside of the '<' and '>' would simply not be shown, so if you changed your tag to be something like this:

<[%raw] >%ann - %enr - %epn

For non raw files it would simply output this: "Full Metal Panic! - 01 - The guy I kinda Like is a Sergeant"

Default formats

Currently anidb uses something like this format:

%ann - %enr%ver - %epn - <[%grp]><(%crc)><(%cen)><(%lang)><(%raw)>

This format for file 182271 returns the following ed2k links:

anidb current page 
new anime page 

note: the last link gets encoded to pass in browsers, the actual output is:


Custom filters for files

The new anime page supports custom filters for files. Currently there are 4 types of filters:

this filter marks files as deprecated
this one checks which files don't get filtered
checks to see which files even if marked as to be hidden should be displayed
hides files based on user preferences

The default rules for each filter follow the Deprecated files rules currently implemented in AniDB except for the Hidden filter that also hides files based on user profile language preferences.

Syntax and some rules

Filter Syntax: Except for element "0", that states how many rules there are, elements follow this format:
where RULE SUBJECT can be one of the following:

File add date
Total number of users for this episode
Total number of users for this file
File CRC status (valid, invalid, unknown)
File quality
File Group Id
File version
File is in mylist
Total number of files
Any of the file audio languages is one of the preferred langs (if using obj.filterAudLang) or given lang
Any of the file audio languages is one of the preferred langs (if using obj.filterSubLang) or given lang
File type (generic)
Is file deprecated

NOTE0: When RULE SUBJECT is prefixed with "c_sf_", there will be test of comparison for all files of the episode and the results of this comparison will be stored in processing Files
NOTE1: When RULE SUBJECT is prefixed with "c_rf_", there will be test of comparison for all files stored in processing Files, and the list will be updated with the results
NOTE2: No RULE SUBJECT prefixed with "c_" imply that you are testing an attribute, think of it as a SQL select where OPERATION can be one of the following:

greater than
lesser than
greater or equal than
lesser or equal than
Equal to
Not equal to

where TEST is the value to test, there are special cases:

will test against the same RULE SUBJECT (only used in "c" prefixed RULE SUBJECTS)

NOTE1: for each RULE NUMBER the RULE SUBJECTS are tested using AND
NOTE2: Will only test RULES until end or a failed test

Default Unfiltered

filterObj.defaultUnfiltered = {0:2,


Default Deprecated

filterObj.defaultDeprecated = {0:5,


Default Visible

filterObj.defaultVisible = {0:5,


Default Hidden

filterObj.defaultHidden = {0:2,


Example of usage

Imagine you had a fcen that would return true if a file is marked as censored, funcen that would return true if a file is marked as uncensored and a acen that would return true if the current anime has been marked as +18. Having this if you wanted to hide all censored files for a +18 anime and only leave uncensored or not marked files you would add this to the hidden filter.

filterObj.hidden = {0:1,


This filter would mark as hidden all censored files for a +18 anime.

Notes: obviously this isn't a very practical way to input file filters, I need to write some interface for it before this can be used.


As part of the anime3 scripts I've developed a kind super file implementation, a bit like of Shadow Files, i call them Pseudo-Files. What they are is simple, whenever there are File Relations involved i create a new file from all the data the relations give me. IE:

File A is a video file with the following attributes: ja audio, en subtitles. File B is a subtitle file which adds de subtitles to File A.

Currently i gave users the option to expand files which have file<->file relations, so the file table for the Episode that holds File A and File B would look like this with all files expanded:

File A .......
\- File B ....
File B .......
\- File A

With pseudo-files i create a new super-file that would have the following attributes ja audio, en and de subtitles, and it's representation is something like this, where File P is the Pseudo-File:

File P .......
|- File A ....
\- File B ....

Pseudo-files are also victim of file filters, so imagine some file would get hidden because it didn't have all the languages you wanted but a pseudo-file which was parent of that file had all the languages, the pseudo-file would not get hidden. In case it did fail the test it would get hidden.

This is the magic of pseudo-files. Another unused feature of show=anime3


As you have noticed, any of the features referred here is ready to be used by normal users, it's like the ground work for future features. So if someone really wants this, bug me until I write an interface for them :P