Create Subfolder in Current Folder Issue

Support for Windows users
Post Reply
trigmoth5
Posts: 2
Joined: 01 Sep 2024, 13:37

Create Subfolder in Current Folder Issue

Post by trigmoth5 »

I am looking for a way to take a tv episode to create the folder based off the title ie. Chucky/ and put it in the current folder, but what i am finding is this { f[0] }/{ ~plex } creates the folder on the D: drive and not in the current folder of D:/TV Shows.


Example location D:\TV\chucky s02e02.mkv
and i want filebot to create a folder called chucky (in the current TV folder) like this:

D:\TV Shows\Chucky\Season 02\Chucky - S02E02 - The Sinners Are Much More Fun.mkv

Now the tricky thing is i thought the code above worked for 5 shows and kept them in the current folder (TV Shows) and then today it didnt it put them in the D: Folder.

Now i have other folders il go into for filebot so like housemates tv shows etc, so its not always in TV Shows folder.

Any ideas?
User avatar
rednoah
The Source
Posts: 23924
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Create Subfolder in Current Folder Issue

Post by rednoah »

Format: Select all

{ f[0] }/{ ~plex }
will always generate

Code: Select all

D:\Chucky\Season 02\Chucky - S02E02 - The Sinners Are Much More Fun
because { f[0] } (the first path component; i.e. the drive letter) is D: and { ~plex } (i.e. {plex} path but without TV Shows category folder level) is Chucky\Season 02\Chucky - S02E02 - The Sinners Are Much More Fun.



Format: Select all

D:/{plex}
will generate file paths such as this:

Code: Select all

D:\TV Shows\Chucky\Season 02\Chucky - S02E02 - The Sinners Are Much More Fun.mkv



:idea: If you need to use more variables, then {drive} or {f[0]} will give you the drive letter for the file at hand. {folder} or {f.dir} will give you the parent folder of the file at hand. f[0..1] will give you the first 2 folder levels (the first is the drive letter) if you need to copy the D:/TV bit from the file at hand, rather than using TV Shows which {plex} will give you:

Format: Select all

{ drive }/TV/{ ~plex.id }

Format: Select all

{ folder }/{ ~plex.id }

Format: Select all

{ f[0..1] }/{ ~plex.id }
...

:idea: Fewer variables make code easier to understand though, so I'd go with simplicity if complexity is unnecessary for your use case:

Format: Select all

D:/TV/{ ~plex.id }

Format: Select all

D:/{ plex.id }

:idea: If you're organizing files for Plex, then make sure to use {plex.id} to add {tmdb-id} markers to all file paths. See How do I organize files for Plex? for details.
:idea: Please read the FAQ and How to Request Help.
trigmoth5
Posts: 2
Joined: 01 Sep 2024, 13:37

Re: Create Subfolder in Current Folder Issue

Post by trigmoth5 »

thank you for explaining rednoah,

** UPDATE rednoah i think i solved it, but want your thoughts on below **

{ folder }/{ ~plex.year.id }
creates this:
D:\Chucky (2021) {tmdb-90462}\Season 02\Chucky (2021) - S02E02 - The Sinners Are Much More Fun.mkv

Original question i asked was Is there a way to combine {plex.year} with {plex.id} ? ? I like the plex.id to help plex locate it instantly but i also like the year mentioned.

And to create in the current folder the code is { folder }/

And if i want it to create TV Shows i just remove ~ from { ~plex.year.id }

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

Re: Create Subfolder in Current Folder Issue

Post by rednoah »

:idea: The Icon Bindings button will help you find the building blocks you need for your custom format.

Screenshot
:idea: Please read the FAQ and How to Request Help.
Post Reply