254
edits
 (TOC)  | 
				|||
| Line 54: | Line 54: | ||
'''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 65: | Line 66: | ||
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 73: | Line 75: | ||
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)  | ||
// Episode number and prefix  | |||
if(E.TypeId=1, set('mepno', max(A.TotalEpisodeCount, E.EpisodeTypeCount)))  | if(E.TypeId=1, set('mepno', max(A.TotalEpisodeCount, E.EpisodeTypeCount)))  | ||
if(E.TypeId<>1, set('mepno', E.EpisodeTypeCount))  | if(E.TypeId<>1, set('mepno', E.EpisodeTypeCount))  | ||
| Line 85: | Line 89: | ||
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)  | ||
edits