Page 1 of 1

Help Adding (.) to folder spaces

Posted: 23 May 2018, 14:58
by cyberdoggy
I am using GUI interface with build FileBot 4.8.1 (r5375) on Windows 10.
I would like to make just the movie folder have (.) between spaces NOT the collection folder section. Here is the code I am using...

Code: Select all

{
   norm = {
      it.colon(' - ')
      .tr('*?|', ' !-')
      .asciiQuotes()
      .replaceAll(/\b(?i)[IVX]+\b/, { it.upper() })
      .replaceAll(/\b[0-9](?i:st|nd|rd|th)\b/, { it.lower() })
      .replaceAll(/(Collection) of the (.+)/, /$2 $1/)
      .replaceAll(/(Saga) Collection/, /$1/)
      .replaceAll(/^(?i)(The|A|An|Der|Die|Das) (.+)/, /$2, $1/)
   };
   path = allOf{ norm(collection) }{ norm(n) }.join('/');
   path[0].replaceAll(/\W|\d/, '#') + '/' + path
}{
   norm(n) != norm(primaryTitle) ? ' (' + primaryTitle + ')' : null
}{
   fn =~ /3D|3-D/ ? ' 3D' : null
} ({y})/{
   allOf
      {n.asciiQuotes().removeAll(/[,!]/)}
      {fn =~ /3D|3-D/ ? '3D' : null}
      {'(' + tags.join(', ') + ')'}
      {y}{'Part'+pi}
      {vf}{vc}{ac}{af}
   .join('.').space('.')
}
And I would like to ADD {vf}{HD}{vc}{source}{'-'+group} to the end of the folder too!
so it would be simialr to this: H:/M/Man From Earth Collection/The.Man.From.Earth.2007.1080p.HD.x265.Bluray-ALLiANCE/The.Man.From.Earth.2007.mkv

Re: Help Adding (.) to folder spaces

Posted: 24 May 2018, 07:03
by rednoah
Your format is quite complex. Did you write it? Do you understand how it works?

A simple solution to you problem might look like this, but how to integrate it into your existing format is the real challenge:

Code: Select all

{ny.space('.')}

Re: Help Adding (.) to folder spaces

Posted: 24 May 2018, 11:01
by cyberdoggy
LOL rednoah you wrote it! I copied it from viewtopic.php?f=5&t=4041&p=22695&hilit= ... ons#p22695 It's the second post on this Thread. I understand a little of it Like things in {Brackets} but I don't understand the (.) stuff

Re: Help Adding (.) to folder spaces

Posted: 24 May 2018, 15:55
by rednoah
The format expression is custom made for this particular user with dozens of special cases, which makes it tricky to modify, which means starting from scratch with something simple is usually the easiest solution.


e.g. let's write a format for this kind of path:

Code: Select all

H:/M/Man From Earth Collection/The.Man.From.Earth.2007.1080p.HD.x265.Bluray-ALLiANCE/The.Man.From.Earth.2007.mkv
:arrow: and replace everything with expressions:

Code: Select all

H:/{az}/{collection}/{n.space('.')}.{y}.{vf}.{hd}.{vf}{'.'+source}{'-'+group}/{n.space('.')}.{y}

Re: Help Adding (.) to folder spaces

Posted: 24 May 2018, 23:53
by cyberdoggy
Wow, that's pretty good and fast reply Thanks. I will play with it from there, the only two other things I seem to notice I would like is if you could change {az} to use a # sign instead of 0-9 and move things like (The) and (A) and stuff to the end of the folder name.

Re: Help Adding (.) to folder spaces

Posted: 25 May 2018, 07:41
by rednoah
Yes, you can do those things of course. You'll find various threads in that you can integrate with your format.

Look into the sort name and replace functions. Let know if you have trouble.