Need help custom renaming files without database use

All about user-defined episode / movie / file name format expressions
Post Reply
FileBotAwesome
Posts: 4
Joined: 12 Apr 2019, 02:37

Need help custom renaming files without database use

Post by FileBotAwesome »

Sometimes I run into problems where files have no database matches. In these scenarios I have to manually rename them. I know that I can press 'f2' to get the renaming tool. I am trying to rename them using the regular expressions, but I am having trouble. I want to be able to just have clean files without groups, or other unnecessary tags.


I have several files like:

Code: Select all

[Forge] Freezing - OVA 01 [Hi10P] [720p] [A5621CF1]
I want to get the filename formatting to look like

Code: Select all

Freezing - S00E01 - OVA
This is what I have tried:

Code: Select all

{n.stripReleaseInfo().space(' ').replaceAll('OVA')} - S00E{i.pad(2)} - OVA
How can I basically take the filename and replace/move the ordering?
I want to be able to
  • delete everything inside '[brackets]' or '(paranthesis)' which usually represents groups/serials/etc

and just have clean files names.

Ex: movies/movie title/ movie title (year) or show/show title/ show title - s00e00 - episode title
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need help custom renaming files without database use

Post by rednoah »

Here's a starting point that'll give you the desired result for this one particular example you posted:

Code: Select all

{fn.removeAll(/\[.*?\]|OVA/).replaceAll(/\d{2}/, /S00E$0/)} - OVA
:idea: More generic code requires more plentiful examples that the code needs to be able to deal with.

:idea: String.removeAll(/\[.*?\]/) will help you remove all the [...]
:idea: Please read the FAQ and How to Request Help.
Post Reply