Page 1 of 1

Retaining folder names for Genres

Posted: 24 Oct 2013, 16:41
by g3rman
Greetings experts :)

My TV shows arrive in the following format:

C:\TV\Drama\Show Name.s01e01.xyz\Show Name.s01e01.xyz.avi
C:\TV\Drama\Show Name.s01e02.xyz\Show Name.s01e02.xyz.avi

C:\TV\Comedy\Show Name.s01e01.xyz\Show Name.s01e01.xyz.avi
C:\TV\Comedy\Show Name.s01e02.xyz\Show Name.s01e02.xyz.avi

The first folder after TV is a genre label, the next folder is the name of the show and episode, which in turn contains the video file.
Finding shows works like a champ. However I'm having a hard time figuring out how to retain the "genre" label, e.g. Drama or Comedy.
Ideally I'd like the above to be sorted as:

C:\TV\Drama\Show Name\Show Name - S01E01.avi
C:\TV\Drama\Show Name\Show Name - S01E02.avi

etc


Any help would be much appreciated!!

Re: Retaining folder names for Genres

Posted: 24 Oct 2013, 17:02
by rednoah
Option 1: Grab name of the folder 2 steps up:

Code: Select all

{file.parentFile.parentFile.name}
Option 2: Grab tokens from the path:

Code: Select all

{folder.path.match(/Drama|Comedy/)}

Re: Retaining folder names for Genres

Posted: 24 Oct 2013, 17:06
by g3rman
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Incoming donation!! :)