Page 1 of 1

Replicating a folder structure and renaming file

Posted: 15 Jan 2019, 20:55
by saitoh183
Not long ago i decided to change the format of my entire anime. So I used FB and different presets to convert everything and it was long but i got it done. Now i have a backup of my Anime that is still in the old format and i want to change it to the new format but not have to use TVDB again. I noticed that i could load in the New Names box my current files.

The schemes i was using depending on what needed to be renamed:

Code: Select all

{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {s00e00} - {episodes*.absolute*.pad(3).join(' - ') } - {t} [{group}]

{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {s00e00} - {t}

{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {s00e00} - {t} [{group}]

{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {s00e00} - {episodes*.absolute*.pad(3).join(' - ') } - {t}
A Example of the old and new format:


Code: Select all

/media/gdrive_legit/Videos/Anime/Cardcaptor Sakura [tvdb2-70668-s0]/Cardcaptor Sakura - 01 - Cardcaptor Sakura The Movie [BluDragon].mkv

Code: Select all

/media/gdrive_legit/Videos/Anime/Cardcaptor Sakura/Specials/Cardcaptor Sakura - S00E01 - Cardcaptor Sakura- The Movie [BluDragon].mkv
Here is what i did in FB but i dont know how to make it rename (if it is even possible) to the New name and put it in the Proper path, Right now it doesnt show the right thing.


Re: Replicating a folder structure and renaming file

Posted: 16 Jan 2019, 02:37
by rednoah
How exactly is it wrong? Looks ok to me on quick glance. How did you decide which particular format out of the 4 you want to apply to each particular file?

:idea: Typically, you'd create one single format, which already has all the decision-making if-then-else necessary to work for different files in different ways.

Re: Replicating a folder structure and renaming file

Posted: 16 Jan 2019, 20:37
by saitoh183
What is wrong is the is the New Name. The path is the new File name i want the episode to be renamed to.

what i did to reproduce that screenshot:

- created a new Preset with the format

Code: Select all

{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {s00e00} - {episodes*.absolute*.pad(3).join(' - ') } - {t} [{group}]
- set dataSource to Plain File

- On the Original Files Window, i load up the files to be renamed and on the New File window, i load up the the files that i want it to rename to.

I might not be understanding how Plain File works. Because the result is,.. it wants to rename the file as ...

Code: Select all

/Anime/Cardcaptor Sakura - S00E01 - Cardcaptor Sakura- The Movie [BluDragon]/Cardcaptor Sakura - S00E01 - Cardcaptor Sakura- The Movie - - - [BluDragon].mkv

As for using the different formats. I set them up each as a preset. I probably could have done it all in one single preset but my knowledge of groovy, regex expresions and which variables to use, is very limited. I had to search the forums to build what i needed and i just adapted it for different situations. If you could reduce to one single format, i probably would just use that to rename with TVDB as data source to rename my anime in my backup library so it can match my main library instead of trying to use my main library as renaming source.

Each format was for different situations. For example some anime do have groups in brackets but those where added manually because at the time sonarr didnt add it or the group was set to sonarr because there wasnt any. When i used filebot on those files, they would rename with the group section empty with 2 brackets. So when i encountered those, i would switch to the profile without

Code: Select all

at the end. Same with Specials. Most specials dont come with Abs numbers and some with no Abs and no group...hence the other 2 profiles came into play.

And before saying i should invest my time in learning groovy and regex, i dont use Filebot often enough to spend that kind of time and i dont really like programming in general. So learning a programming language is tough for me. Im more of a IT generalist in the support area. and regex i just cant rap my brain around it no matter how hard i i use FB for simple renaming stuff and i get what i need done, but this task is tedious, so any edge i can get to speed things up, would be appreciated...especially since it is a one time thing.

Thanks in advance

Re: Replicating a folder structure and renaming file

Posted: 17 Jan 2019, 02:23
by rednoah
I see. Plain File indeed means that FileBot will perform no auto-detection or interpretation of input files, so you won't be able to use Episode bindings such as {episode} {s00e00} etc, while other bindings such as {n} will behave differently (i.e. series name for Episode matches, filename for Plain File matches).

If you're processing files that you have processed with FileBot previously, and thus xattr tagged, then you can use Extended Attributes which is offline and instant similar to Plain File but will restore the Episode match from xattr metadata.