3
edits
(3 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
==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 40: | 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 80: | Line 86: | ||
// Episode number and prefix | // Episode number and prefix | ||
if(E.TypeId=1 | 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 136: | Line 141: | ||
set('atitle', replace(atitle, '\', ' ')) | set('atitle', replace(atitle, '\', ' ')) | ||
set('version', if(F.Version>1, 'v'+F.Version, '')) | set('version', if(F.Version>1, 'v'+F.Version, '')) | ||
set('mepno', max(A.TotalEpisodeCount, E.EpisodeTypeCount)) | 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 159: | Line 164: | ||
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