Page 1 of 1

Maximum Legth to a field

Posted: 07 Oct 2014, 21:52
by Eye
Hi, i am new here but i do twiddle with the Program and my naming scheme since a while
I do love the bot!



At the moment i use

Code: Select all

{n} - {s.pad(2)+'x'}{e.pad(2)} - {t} - [{group}] {source} [{resolution}] {video.codecId} [{vc}, {VF}, {af}] [{video.bitdepth} {'Bit'}] {audio.language}
Since today v4.5 Win7 64

What i would like to add:
[*] a limit to the episode title length so it doesn't run into file Sytem limits,
[*] a working "Special" numbering (at the moment, its Giving those without episode number)
[*] The different audio languages If there are several;
[*] flowed by the subtitle languages,

Also i Feel The " [{video.bitdepth} {'Bit'}] " part is a bit less elegant than it could be; sadly i need it because my raspberry pie is not working with "hi10-Bit" Crap and several of the Anime Fansubbers do not give a Flying... erm lot of thought to the Users that are using hardware players

Any tips would be appreciated, as i didn't find Much in the net or the yotoobe clips
i am Not English native; and am not a programmer!

Re: Maximum Legth to a field

Posted: 08 Oct 2014, 05:22
by rednoah
1.
{t} is limited to 150 chars (as of v4.5)

2.
Special numbering is special, so {e} is only proper episode numbers, while {special} would be the special "episode" number for specials. You can assume that only one of the two will be available for any given Episode object.

3. & 4.
See forums. There's a pretty good thread here somewhere, with code ready to copy & paste. If you find it link it here. ;)

Re: Maximum Legth to a field

Posted: 08 Oct 2014, 09:48
by Eye
1) is there a way to limit it More?
i thought so 30 Or so;
With title; Location, and Folder sub folder with the series folder and so on a smaller limit would be helpful?

2) Got it

3/4) I aint shur; But i think I Got it too

Code: Select all


{n} - {s.pad(2)+'x'}{e.pad(2)}{' Special '+special.pad(3)} - {t} - [{group}] {source} [{resolution}] {video.codecId} [{vc}, {VF}, {af}] [{video.bitdepth} {'Bit'}] {audios.language} {'; '+texts.Language_String2}

Needs some more testing Some files do not give audio Language it seems ?

Re: Maximum Legth to a field

Posted: 08 Oct 2014, 10:04
by rednoah
1.

Code: Select all

{t.take(70)}
3/4.
More or less something with the {audios} / {texts} collections. You can use the Binding Dialog to see what MediaInfo is available. So older contains like .avi may not contain metadata like this.

Re: Maximum Legth to a field

Posted: 08 Oct 2014, 10:51
by Eye
Thanks you! :!:

Code: Select all

{n} - {s.pad(2)+'x'}{e.pad(2)}{' Special '+special.pad(2)} - {t.take(50)} - [{group}] {source} [{resolution}] {video.codecId} [{vc}, {VF}, {af}] [{video.bitdepth} {'Bit'}] {audios.language} {'; '+texts.Language_String2}
Works like a charm, and yes;
the problem With if its not filled out, it cant be shown, like with Exotic fansubbers
- thats a pain, but how to fix it except with huge constructs.?


Btw: did IMDB get kiked Out
i dont have it in the menue; and I did not see it in the release note?

Re: Maximum Legth to a field

Posted: 08 Oct 2014, 11:00
by rednoah
1.
Handling undefined values is extremely easy once you understand how expressions work (and fail).

@see http://www.filebot.net/forums/viewtopic.php?f=5&t=1895
@see http://www.filebot.net/forums/viewtopic ... 5&t=2#p783

2.
Yes. IMDb no more! :)

Re: Maximum Legth to a field

Posted: 09 Oct 2014, 09:45
by Eye
Well, i do not seem to get your meaning?
were do i get an information, if its not part of the metadata and not in the net dbs?

i could construct some Fall back "If nothing returned Then" thing, but that would be guesswork or do you mean some other thing?

Re: Maximum Legth to a field

Posted: 09 Oct 2014, 10:15
by rednoah
2 expressions:

Code: Select all

[{vc}, {ac}]
1 expression:

Code: Select all

{"$vc, $ac"}
Also 1 expression:

Code: Select all

{[vc, ac]}
Read and play with the examples here: viewtopic.php?f=5&t=1895


So [{vc}, {vf}, {af}] is bad since it's 3 independent expressions.

Instead you can write {[vc, vf, af]} which is 1 expression which results in 1 array (the String value thereof). Or nothing if any of the bindings are undefined (i.e. an Exception is thrown).

If you want to avoid the "all or nothing" default behavior of expressions you can write {allOf{vc}{vf}{af}}. In this case you have 1 expression, and it'll call 1 function allOf with 3 Closure arguments, and the result will be a list of the results of each Closure, and if a Closure fails it'll be ignored.

The fallback code would follow the same logic: {any{group}{'NOGROUP'}}

Re: Maximum Legth to a field

Posted: 09 Oct 2014, 15:15
by Eye
A now i understand

like

Code: Select all

{n} - {s.pad(2)+'x'}{e.pad(2)}{' Special '+special.pad(2)} - {t.take(70)} - [{any{group}{'NOGROUP'}}] {source} [{resolution}] {video.codecId} {[vc, VF, af]} [{video.bitdepth} {'Bit'}] {audios.language} {'; '+texts.Language_String2}
Is more clean and shorter way to get the same result!


what i was referring, When i dont have an information in the meta data; like no language tag For the audio /subs, I do not know how to get those,

or if i have a release group Thats not recognized; i need to Do some Hand Tweaking and exchange "nogroup" for the Not recognized ones

Re: Maximum Legth to a field

Posted: 09 Oct 2014, 16:29
by rednoah
Request groups to be added:
viewtopic.php?f=5&t=4


You can try media tags from the file. You can try extended information from TheTVDB/TheMovieDB and see if something might work. But if the information is not there, then it's not there, and it's your job to think about where you might be able to get it from.

Re: Maximum Legth to a field

Posted: 09 Oct 2014, 16:47
by Eye
I will post old and exotic anime fannsuber groups there!

And I have the job?

Cool

Does it come with dental? ;)
and yes ill Look for sources, Maybe different tags Or such!