Video format from old filename

All about user-defined episode / movie / file name format expressions
Post Reply
thingomy
Posts: 2
Joined: 01 Jun 2014, 21:03

Video format from old filename

Post by thingomy »

I would like a way to autodetect the video format (720p, 1080i etc) from the existing file name, falling back on the media method if it isn't given there.

I am going to be processing files before they complete downloading (using hard links), so the media method won't work all the time. Most of my files have the format in the file name, but not all do.

If no format is found, I'd like it to fall back on leaving the format out.

I'm fairly sure that this is only a moderatly complex task in Groovy, but as I've only been at this for less than a day, it's way beyond me. Any pointers or assistance would be greatly appriciated.

On a side note, is there any good documentation anywhere on how to work this stuff out for myself? I've looked up the Groovy project, and the learning curve seems pretty steep as it's unclear what is relevent here and what isn't, eg pretty much all the stuff on there seems to be multi line examples, there we are compressing everything into a single expression here. I have some background in java, but it's very rusty.

Thanks in advance.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Video format from old filename

Post by rednoah »

In the filebot expression format you can do this:

{any{fn.match(/1080i|720p/)}{vf}}
:idea: Please read the FAQ and How to Request Help.
Post Reply