3
edits
No edit summary |
|||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} | |||
[[Category:AniDB O'Matic]] | |||
==Default pattern== | ==Default pattern== | ||
Output: Transliterated anime name - 01v2 - English episode name [s-gn] (CCRCCRCC).ext | Output: Transliterated anime name - 01v2 - English episode name [s-gn] (CCRCCRCC).ext | ||
'''ATTENTION!''' The default pattern has a bug. See below for instructions to fix it. | |||
<pre> | <pre> | ||
set('atitle', at('x-jat')) | set('atitle', at('x-jat')) | ||
Line 37: | Line 42: | ||
filename | filename | ||
</pre> | </pre> | ||
'''ATTENTION!''' The default pattern has a bug. To fix it, find the following line: | |||
<pre>set('mepno', max(A.TotalEpisodeCount, E.EpisodeTypeCount))</pre> | |||
And replace it with: | |||
<pre>set('mepno', if(E.TypeId=1, max(A.TotalEpisodeCount, E.EpisodeTypeCount), E.EpisodeTypeCount))</pre> | |||
---- | ---- | ||
Line 51: | Line 60: | ||
'''Warning!''' You must specify the "Base folder" in Options -> File manager for this to work. | '''Warning!''' You must specify the "Base folder" in Options -> File manager for this to work. | ||
<pre> | <pre> | ||
// Anime title | |||
set('atitle', at('x-jat')) | set('atitle', at('x-jat')) | ||
if(length(atitle)=0, set('atitle', at('en'))) | if(length(atitle)=0, set('atitle', at('en'))) | ||
Line 62: | Line 72: | ||
set('censored', (F.State and 128) > 1) | set('censored', (F.State and 128) > 1) | ||
// Episode title | |||
set('etitle', et('en')) | set('etitle', et('en')) | ||
if(length(etitle)=0, set('etitle', et('x-jat'))) | if(length(etitle)=0, set('etitle', et('x-jat'))) | ||
Line 70: | Line 81: | ||
set('etitle', trim(etitle)) | set('etitle', trim(etitle)) | ||
// Version | |||
set('version', if(F.Version>1, 'v'+F.Version, '')) | set('version', if(F.Version>1, 'v'+F.Version, '')) | ||
set('v2n', version) | set('v2n', version) | ||
if(E.TypeId=1 | // Episode number and prefix | ||
set('mepno', if(E.TypeId=1, max(A.TotalEpisodeCount, E.EpisodeTypeCount), E.EpisodeTypeCount)) | |||
set('epno', padl(E.EpisodeNo, max(1, length(mepno)), '0') + version) | set('epno', padl(E.EpisodeNo, max(1, length(mepno)), '0') + version) | ||
if(E.TypeId=2, set('epno', 'S'+epno)) | if(E.TypeId=2, set('epno', 'S'+epno)) | ||
Line 82: | Line 94: | ||
if(E.TypeId=6, set('epno', 'O'+epno)) | if(E.TypeId=6, set('epno', 'O'+epno)) | ||
// Group name | |||
set('groupname', if(G, if(length(G.Shortname)>0, G.Shortname, G.Name), 'no group')) | set('groupname', if(G, if(length(G.Shortname)>0, G.Shortname, G.Name), 'no group')) | ||
set('groupname', if(length(groupname)>0, '['+groupname+']')) | set('groupname', if(length(groupname)>0, '['+groupname+']')) | ||
set('groupname', replace(groupname, '\', ' ')) | set('groupname', replace(groupname, '\', ' ')) | ||
// CRC | |||
set('crc', if(H, H.Crc32, F.Crc)) | set('crc', if(H, H.Crc32, F.Crc)) | ||
if(length(crc)>0, set('crc', '('+uc(crc)+')')) | if(length(crc)>0, set('crc', '('+uc(crc)+')')) | ||
// piece together the file name | |||
set('filename', limit(limit(atitle, 70) + ' - ' + epno + ' ' + groupname, 145) + '[' + F.Source + ']' +crc + '.' + F.FileType) | set('filename', limit(limit(atitle, 70) + ' - ' + epno + ' ' + groupname, 145) + '[' + F.Source + ']' +crc + '.' + F.FileType) | ||
// Folder for first letter in anime title | |||
set('head', copy(atitle, 1, 1)) | set('head', copy(atitle, 1, 1)) | ||
if(numeric(head) or (head='.'), set('head', '0-9')) | if(numeric(head) or (head='.'), set('head', '0-9')) | ||
set('head', head+'\') | set('head', head+'\') | ||
// Subfolder for anime if there's more than 2 files | |||
if ((A.MylistCurrentEpisodeCount + A.MylistSpecialEpisodeCount) > 2, set('head', head + limit(atitle, 80) + '\')) | if ((A.MylistCurrentEpisodeCount + A.MylistSpecialEpisodeCount) > 2, set('head', head + limit(atitle, 80) + '\')) | ||
// subfolder for plot | // Prepend a subfolder for plot | ||
set('filename', if(A.Restricted, 'Hentai\') + head + filename) | set('filename', if(A.Restricted, 'Hentai\') + head + filename) | ||
Line 110: | Line 129: | ||
set('filename', replace(filename, ' ', ' ')) | set('filename', replace(filename, ' ', ' ')) | ||
filename | |||
</pre> | |||
---- | |||
==[Group] Anime name - 01v2 [CCRCCRCC].ext== | |||
<pre> | |||
set('atitle', at('x-jat')) | |||
if(length(atitle)=0, set('atitle', at('en'))) | |||
if(length(atitle)=0, set('atitle', A.Name)) | |||
set('atitle', replace(atitle, '\', ' ')) | |||
set('version', if(F.Version>1, 'v'+F.Version, '')) | |||
set('mepno', if(E.TypeId=1, max(A.TotalEpisodeCount, E.EpisodeTypeCount), E.EpisodeTypeCount)) | |||
set('epno', padl(E.EpisodeNo, max(1, length(mepno)), '0') + version) | |||
if(E.TypeId=2, set('epno', 'S'+epno)) | |||
if(E.TypeId=3, set('epno', 'C'+epno)) | |||
if(E.TypeId=4, set('epno', 'T'+epno)) | |||
if(E.TypeId=5, set('epno', 'P'+epno)) | |||
if(E.TypeId=6, set('epno', 'O'+epno)) | |||
set('crc', if(H, H.Crc32, F.Crc)) | |||
if(length(crc)>0, set('crc', '['+uc(crc)+']')) | |||
set('groupname', if(G, if(length(G.Shortname)>0, G.Shortname, G.Name), 'no group')) | |||
set('groupname', if(length(groupname)>0, '['+groupname+']')) | |||
set('groupname', replace(groupname, '\', ' ')) | |||
set('filename', limit(limit(limit(groupname, 90) + ' ' + atitle, 200) + ' - ' + epno, 235) + ' ' + crc + '.' + F.FileType) | |||
set('filename', replace(filename, '*', ' ')) | |||
set('filename', replace(filename, '/', ' ')) | |||
set('filename', replace(filename, '?', ' ')) | |||
set('filename', replace(filename, ':', ' ')) | |||
set('filename', replace(filename, '"', ' ')) | |||
set('filename', replace(filename, '<', ' ')) | |||
set('filename', replace(filename, '>', ' ')) | |||
set('filename', replace(filename, '|', ' ')) | |||
set('filename', replace(filename, ''', "'")) | |||
set('filename', replace(filename, ' ', ' ')) | |||
filename | |||
</pre> | |||
---- | |||
==Main_title_-_01v2_[Group][CCRCCRCC].ext== | |||
<pre> | |||
set('atitle', at('x-jat')) | |||
if(length(atitle)=0, set('atitle', at('95'))) | |||
if(length(atitle)=0, set('atitle', at('87'))) | |||
if(length(atitle)=0, set('atitle', at('en'))) | |||
if(length(atitle)=0, set('atitle', A.Name)) | |||
set('atitle', replace(atitle, '\', '_')) | |||
set('etitle', et('en')) | |||
if(length(etitle)=0, set('etitle', et('x-jat'))) | |||
if(length(etitle)=0, set('etitle', et('en'))) | |||
if(length(etitle)=0, set('etitle', E.Name)) | |||
set('etitle', replace(etitle, '\', '_')) | |||
set('version', if(F.Version>1, 'v'+F.Version, '')) | |||
set('mepno', if(E.TypeId=1, max(A.TotalEpisodeCount, E.EpisodeTypeCount), E.EpisodeTypeCount)) | |||
set('epno', padl(E.EpisodeNo, max(1, length(mepno)), '0') + version) | |||
if(E.TypeId=2, set('epno', 'S'+epno)) | |||
if(E.TypeId=3, set('epno', 'C'+epno)) | |||
if(E.TypeId=4, set('epno', 'T'+epno)) | |||
if(E.TypeId=5, set('epno', 'P'+epno)) | |||
if(E.TypeId=6, set('epno', 'O'+epno)) | |||
set('groupname', if(G, if(length(G.Shortname)>0, G.Shortname, G.Name), 'no group')) | |||
set('groupname', if(length(groupname)>0, '['+groupname+']')) | |||
set('groupname', replace(groupname, '\', '_')) | |||
set('crc', if(H, H.Crc32, F.Crc)) | |||
if(length(crc)>0, set('crc', '['+uc(crc)+']')) | |||
set('filename', limit(limit(limit(atitle, 90) + '_-_' + epno, 200) + '_' + groupname, 235) + crc + '.' + F.FileType) | |||
set('filename', replace(filename, '*', '_')) | |||
set('filename', replace(filename, '/', '_')) | |||
set('filename', replace(filename, '?', '_')) | |||
set('filename', replace(filename, ':', '_')) | |||
set('filename', replace(filename, '"', '_')) | |||
set('filename', replace(filename, '<', '_')) | |||
set('filename', replace(filename, '>', '_')) | |||
set('filename', replace(filename, '|', '_')) | |||
set('filename', replace(filename, '`', '_')) | |||
set('filename', replace(filename, ' ', '_')) | |||
set('filename', replace(filename, ' ', '_')) | |||
set('filename', replace(filename, '__', '_')) | |||
filename | filename | ||
</pre> | </pre> |
edits