AniDB O'Matic - Documentation: Local file renaming: Difference between revisions

Jump to navigation Jump to search
Line 6: Line 6:
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.
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.
File extensions are automatically added to the end of the pattern.
Here's a few sample patterns:
* "?a - ?ep - ?e [?g]" -> <br>"Anime - 02 - Episode name [Group name]"
* "?a - ?epv?v - ?e?if(lg<><nowiki>''</nowiki>, ' ['+lg+']', <nowiki>''</nowiki>)" -> <br>With group: "Anime - 02v1 - Episode name [Group name]"<br>Without group:"Anime - 02v1 - Episode name"
* "?if(wltw, 'To watch\', <nowiki>''</nowiki>)?a?if(isMovie, if(epps>1, ' - Part '+epp+if(v>1, 'v'+v, <nowiki>''</nowiki>), if(v>1, ' - v'+v, <nowiki>''</nowiki>)), ep+if(v>1, v, <nowiki>''</nowiki>)+'- ?e') ?if(lg<><nowiki>''</nowiki>, lg+' ', <nowiki>''</nowiki>){?crc32}" -> <br>For a movie: "Anime name - v2 [Group name]{crc32}"<br>For a movie with 2 parts: "Anime name - Part 2v2 [Group name]{crc32}<br>For a normal anime, marked as "to watch in wishlist": "To watch\Anime name - 02v2 - Episode name [Group name]{crc32}
===Default pattern===
Split into multiple lines for easier viewing. ;)<br>
<code><pre>?set('V', if(v>1, 'v'+v, ''))
?set('A', a)
?set('E', if(isMovie and (eps=1), if(epps>1, if(length(V)>0, V+' - ', '')+'Part '+epp, if(length(V)>0, V, '')), if(eps>1, ep+V+' - '+e, if(length(V)>0, V+' - '+e, e))))
?set('LANG', la2+if((length(la2)>0) and (length(ls2)>0), '-')+ls2)
?set('LANG', if(length(LANG)>0, '('+LANG+')'))
?set('G', if(gid>0, g, if((lac<=1) and (lsc=0) and ((la='ja') or (la='')), '[RAW]')))
?set('CRC', if(length(crc)>0, '{'+crc+'}', ''))
?set('TAIL', join(' ', LANG, G, CRC))
?set('TAIL', if(length(TAIL)>0, ' '+TAIL))
?set('TOTLEN', length(A)+length(E)+length(TAIL))
?if(TOTLEN>240, if(length(E)>50, set(E, limit(E, max(50, 240-length(A)-length(TAIL))))))
?set('TOTLEN', length(A)+length(E)+length(TAIL))
?if(TOTLEN>240, if(length(A)>50, set(A, limit(A, max(50, 240-length(E)-length(TAIL))))))
?out(A+if(length(E)>0, ' - '+E)+TAIL)</pre></code>
The end result is all lines merged with the line feeds removed.


==Sample patters==
==Sample patters==
254

edits

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.