Page 1 of 1

Get info either from Filename or Foldername or Both?

Posted: 24 Jan 2015, 03:48
by DevXen
So My movies some have the info in the filename, and some in the foldername and some have the info in both.
how would I pull movie from the foldername, if it's not there pull it from the filename. but not pull it twice if it's in both?

I know: {folder.name} {fn.contains('x')} to access them. but if i use them both it'll pull the info twice, when the info is both in the filename and the foldername.

Example:
1. Thor (3D HSBS)\Thor.mkv
2. Thor\Thor (3D HSBS) (HSBS).mkv
3. Thor (3D HSBS)\Thor (3D HSBS).mkv

I would want to add (3D) and (HSBS) to the renamed file. in each of these cases, but I don't want it added twice in the last example.

Re: Get info either from Filename or Foldername or Both?

Posted: 24 Jan 2015, 10:18
by rednoah
I'd just pull it from the whole path:

Code: Select all

{file.path.match(/3D.HSBS/)}

Re: Get info either from Filename or Foldername or Both?

Posted: 24 Jan 2015, 10:43
by DevXen
Perfect, i did'nt know there was a file.path.match, i'll mess with that and see if I can get it working. thank you.