Help Adding (.) to folder spaces

All about user-defined episode / movie format expressions
Post Reply
cyberdoggy
Posts: 25
Joined: 03 Sep 2016, 21:27

Help Adding (.) to folder spaces

Post by cyberdoggy » 23 May 2018, 14:58

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

User avatar
rednoah
The Source
Posts: 14678
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Adding (.) to folder spaces

Post by rednoah » 24 May 2018, 07:03

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('.')}
:idea: Please read the FAQ and How to Request Help.

cyberdoggy
Posts: 25
Joined: 03 Sep 2016, 21:27

Re: Help Adding (.) to folder spaces

Post by cyberdoggy » 24 May 2018, 11:01

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

User avatar
rednoah
The Source
Posts: 14678
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Adding (.) to folder spaces

Post by rednoah » 24 May 2018, 15:55

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}
:idea: Please read the FAQ and How to Request Help.

cyberdoggy
Posts: 25
Joined: 03 Sep 2016, 21:27

Re: Help Adding (.) to folder spaces

Post by cyberdoggy » 24 May 2018, 23:53

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.

User avatar
rednoah
The Source
Posts: 14678
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help Adding (.) to folder spaces

Post by rednoah » 25 May 2018, 07:41

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.
:idea: Please read the FAQ and How to Request Help.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests