Saving presets.

All your suggestions, requests and ideas for future development
Post Reply
callten
Posts: 19
Joined: 17 Feb 2014, 10:48

Saving presets.

Post by callten »

Hi, how about the ability to save presets and easily select them on the Series / Movie Data right-click menu? I know you already have a "preset" for movies and one for TV but I do different things with videos depending on if I have encoded them from source myself or downloaded them. So maybe a menu item called Presets down by Edit Format (or one for TV and one for movies even) which would allow us to quickly switch between presets without having to go into the Edit Format dialog.

It could be a text file with a list of preset names and their respective format strings.

Code: Select all

[TV - Downloaded]
<format string>

[TV - Encoded]
<format string>

[Movies - Downloaded] 
etc...
Just an idea. Keep up the good work! :)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Saving presets.

Post by rednoah »

That would be a step backwards from the point of automation.

Why don't you just make your 1 format more smart enough so it can handle all your content? Just a matter of a few if statements.
:idea: Please read the FAQ and How to Request Help.
callten
Posts: 19
Joined: 17 Feb 2014, 10:48

Re: Saving presets.

Post by callten »

Well, the files get moved to different folders depending on whether I encoded myself (usually but not always Blu-ray remuxes from Blu-ray source) or downloaded the shows. I can't think of a way to differentiate just by looking at the file so I currently have to delve into the edit formats dialog and access different format strings using that drop-down history... Which feels clunky, for want of a better word.

I see your point but I don't think it would be a step back, it wouldn't be compulsory to use it and I would rather have a couple of fine-tuned format strings specific to their task (that I could easily select with no more than 2 clicks from that context menu) than one massive one trying to cater for everything.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Saving presets.

Post by rednoah »

How do you know the difference then? I'm sure it's obvious to you for some reason. Are your "encoded myself" files are certain folder, and your downloads in yet a different folder? Here's your condition. ;)

Since you're so keen on your formats, why don't you post them here? So either they're completely different (Why???) or they're quite similar, in which case code-reuse is good.
:idea: Please read the FAQ and How to Request Help.
callten
Posts: 19
Joined: 17 Feb 2014, 10:48

Re: Saving presets.

Post by callten »

Well yeah, I encode them and then I use your wonderful app to rename and move them to one folder whereas with downloaded stuff they goto a different folder. :)

And ok, the formats are *largely* the same. :P Except for the root folder and I never download anything except x264 so I wouldn't need, for instance {'.'+vc.replace('Microsoft', 'VC-1')} for downloaded stuff. The remux string is *much* more simple but they both extract audio/video codec info and add episode names etc.

These are the two relevant ones:

Code: Select all

Downloaded:
/tank/tv_x264/{n}/{"Season ${s.pad(2)}/"}{n.space('.').replaceAll(/[()]+/)}.{s00e00}.{t.space('.').replacePart('(Part.$1)').replaceAll(/[,]+/)}{'.'+fn.match(/(?i:internal)/).toUpperCase()}{'.'+fn.match(/(?i:proper)/).toUpperCase()}{'.'+fn.match(/(?i:repack)/).toUpperCase()}{'.'+vf.match(/720[pP]|1080[pP]/)}{'.'+source.replaceAll('(?i)BluRay', 'Blu-ray').replaceAll('(?i)WEB.DL', 'WEB-DL')}{'.'+fn.match(/Blu-ray/)}{'.'+ac.match(/DTS/)}{'.'+fn.match(/(?i:dd5.1)/).toUpperCase()}{'.'+fn.match(/(?i:aac2.0)/).toUpperCase()}{'.'+fn.match(/(?i:h.264)/).toUpperCase()}{'.'+fn.match(/(?i:h264)/).replaceAll('(?i)h264', 'H.264')}{'.'+vc.match(/[xX]264/)}{'.'+fn.match(/(?i:xvid)/).upperInitial()}{'.'+fn.match(/(?i:avc)/).toUpperCase()}{"-$group"}

Ripped:
/tank/my_tv_remux/{n}/{"Season ${s.pad(2)}/"}{n.space('.').replaceAll(/[()]+/)}.{s00e00}.{t.space('.').replacePart('(Part.$1)').replaceAll(/[,]+/)}.1080p.Blu-ray{'.'+audios.groupBy{ it.Codec }.collect{ c, a -> [c] + a*.Language }.flatten().join('.')}{'.['+texts.language.flatten().join('.')+']'}{'.'+vc.replace('Microsoft', 'VC-1')}
The downloaded one gets horrendously complicated with all of the possibilities for codecs etc and making it all nice. I *know* with my own rips that they will be ripped/encoded to 1080p and they will be from Blu-ray source.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Saving presets.

Post by rednoah »

Yeah, this is overly complicated, so I won't be able to fix it for you :P

Just encode all your custom encodes to a folder you know, e.g. /My Files/New Encodes/** and then check for that in the format.

It'd start with something like this:

Code: Select all

/tank/{file =~ /New Encodes/ ? 'my_tv_remux' : 'tv_x264' }
:idea: Please read the FAQ and How to Request Help.
callten
Posts: 19
Joined: 17 Feb 2014, 10:48

Re: Saving presets.

Post by callten »

Ok thanks, I guess I know what I'm doing this afternoon then. :)

I didn't realise you could figure out what folder the source file is in with Groovy, that makes it a lot easier.

When you say it's overly complicated, what else am I supposed to do if I'm ridiculously OCD about my filenames and all of these groups use different capitalisation and stuff when they release? It has to be this complicated otherwise it won't catch all the varations.

Quick question (I know this is going off topic) - can you query the source folder name from other parts of the format string too? I don't want audio and subtitle languages to be in downloaded files so I would have to do something like "if folder=encodes then <do language stuff>". Alternatively, is it possible to set a variable at the first stage when it is deciding what the target folder should be ("if folder=encodes then set video_type=encoded else set video_type=downloaded") and then query the variable video_type whenever I want to do something different for files from each folder? I have literally no idea of the scope or what's possible in Groovy, it's constantly surprising me. :)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Saving presets.

Post by rednoah »

It's complicated enough that I can re-engineer it without breaking it. ;)

Here's some tips for simplification:
* match() is always case-insensitive
* matchAll() allows you to match multiple occurrences of a pattern
* you seem to have a lot of toUpperCase(), maybe you can make an array of all the data and than do *.upper().join('.') ... may or may not be applicable in your case. Because {source} already catches everything, but you feel the need to post process everything again individually. I'd just *.upper() everything and be done with it. ;)


Yes:

Code: Select all

{isEnc = (file =~ /New Encodes/); isEnc ? true : false} {isEnc ? true : false}
You could also try building it up from fewer greater expressions, rather then small repeating expressions:

Code: Select all

{(file =~ /New Encodes/ ? allOf{vc}{ac} : allOf{source}{group})*.upper().join('.')}
:idea: Please read the FAQ and How to Request Help.
callten
Posts: 19
Joined: 17 Feb 2014, 10:48

Re: Saving presets.

Post by callten »

Ugh, ok thanks, i think I have some reading/tinkering to do.

I don't "feel the need to post process everything again individually", I just mashed together loads of sample snippets of code until it worked without really digging into the code and figuring it all out. :P
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Saving presets.

Post by rednoah »

r3145 supports presets or macros that can be used to setup "quick" buttons that process stuff with pre-configured settings.
:idea: Please read the FAQ and How to Request Help.
Post Reply