Page 1 of 1

Tags and Fansub Question

Posted: 30 Jul 2015, 15:26
by GlassFish
Hello,
I would like to know what´s the difference between n and primaryTitle.
The point is, I am using xxxxxx{norm(n)}{norm(n)!=norm(primaryTitle) ? " ("+norm(primaryTitle) +")" : ''} for Anime Shows.
When I am using that on Nanatsu no Taizai, with anidb it only recognizes Nanatsu no Taizai, although it should name the Directory Nanatsu no Taizai (The Seven deadly Sins).
And when I am using THETVDB it generates the correct Directory "Nanatsu no Taizai (The Seven deadly Sins)".
But since, anidb is better I would like that that pattern also works for anidb. What to do?

It seems that some Fansubgroups are not matched anymore or only partly. [NO] [C-Subs]....
So, how would an pattern look like if I want to match Fansubgroup names, which are at the beginning or at the end of the Filename. And/Or are inside [xx]
I tried it with fn.match(/[(.*?)]/);
I suppose I need some Look -ahead/behind but I have no clue how to write them.

Is there an way to move external Subs or Information about an Series into an separate Folder? E.g.: A TV Show has an Subs Folder + some artwork inside the Mainfolder (where the mkv is) Then I am removing all .mkvs of one Show into one Folder, I would like that the Subs are all in one Folder and the .nfo/artwork too.

How are you detecting Language and Subs?
At the moment I am using that beauty:

Code: Select all

{Set<String> audios = audios.language; String res="";audios.each(){String audio -> audio.equals('en') ? res+="Eng" : '';audio.equals('de') ? res+="Ger" : ''; audio.equals('ja') ? res+="Jap" : ''};"["+res+"-Dub]";}{Set<String> langs = texts.language;String result=""; langs.each(){String language -> language.equals('en') ? result+="Eng" : '';language.equals('de') ? result+="Ger" : ''; language.equals('ja') ? result+="Jap" : ''}; "["+result +"-Sub]"}
I have here many files where the Lang and Sub is in the Filename but Filebot is not recognising anything. Furthermore I had often the issue that there are from the same show Files and from one file everything is recognised and from the other nothing. (Can´t find the appropriate files at the moment)
How could I write "RAW" if it doesn´t find anything?

Re: Tags and Fansub Question

Posted: 30 Jul 2015, 16:11
by rednoah
1.
n ... name according to language preference
primaryTitle ... maybe in any language regardless of language preference

If you use English language preference then n and primaryTitle will usually be the same, expect for non-English movies. With TheTVDB/AniDB data you should get n as English name and primaryTitle as Romanji name.

It depends on what has or hasn't been entered.

For Nanatsu no Taizai no *Official* (synonym/alias doesn't count) English Title has been entered, hence n defaults to the Romanji Main Title:
http://anidb.net/perl-bin/animedb.pl?sh ... &aid=10596


2.
Your regex looks really strange. You'll probably need to learn some regex basics first. Try this:
http://www.regexr.com/3bgb0

String.match() will give you Capturing Group #1 if you use capturing groups in your regular expression. So you don't need look-ahead or look-behind.


3.
Yes. Use the format.

Code: Select all

if (ext =~ /srt/) '/subs'

Re: Tags and Fansub Question

Posted: 09 Aug 2015, 21:53
by GlassFish
So in Nanatsu the Main title will be covered with primarytitle and the offical title with n, but then I will get both Names?

Is there any special reason why in some Files the Dub/Subs are recognized without any problems but at others, of the same Filetype they are not?
And yes, I tried it with Bindings, but I get at the beginning of such thing always Firefly and then ofthe no Language...

Btw.: I believe there is an error.
When I match Episodes and it recognises that there are already files with the same Name it only shows an X at some of the Entries and not at all dupe Names. Furthermore even if I delete that Files I am not able to rename the remaining ones. I just press, Rename, Validate and that´s it. No Message, nothing.

Edit:
Okay, it has nothing todo with the duplicates.
I deleted them, but I still get after the matching and clicking on "validate" no response.

Re: Tags and Fansub Question

Posted: 10 Aug 2015, 07:59
by rednoah
Maybe you can add some screenshots to make the issue more clear?

Re: Tags and Fansub Question

Posted: 16 Aug 2015, 22:33
by GlassFish
Okay, ... I figured it out.

It only was one file. When I deleted it, everything worked.
When I add the file to Filebot I get the error that the filename is too long, but when I had other files in Filebot no error appeared.
Now I am using take()...

Is there anything wrong with: {episode.special ? 'Special/' : 'Season '+s+'/'} {primaryTitle+" "}-{episodelist.size()==1 ? '' : " "+absolute.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)}

I wanted to rename Alphas with that but then I don´t get an episode number nor season number.

Is it possible that Filebot hast problems to work with files which were already renamed by it? I have here files which can´t be recognized although at the start is always the name of the series.

Re: Tags and Fansub Question

Posted: 16 Aug 2015, 23:49
by rednoah
If some file is not being recognised it would help if you posted the full file path.

Re: Tags and Fansub Question

Posted: 24 Aug 2015, 01:33
by GlassFish
Here we go:

Source: E:\Alphas Season 1\Al72S01E01\Alphas - S01E01 - Zeit zu töten
becomes:
F:\Series/Alphas/ Season 1/ Alphas - Zeit zu töten [Ger-Dub][720p_x264_8Bit_AC3]

Pattern:

Code: Select all

F:\Series/{norm={it.replaceAll(/['`´:]/,"'").replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)};
 norm(primaryTitle )}{if(norm(n)!=norm(primaryTitle)){        if(norm(primaryTitle).length()>=26){}else{ " ("+norm(n) +")"}}}/ {episode.special ? 'Special/' : 'Season '+s+'/'} {primaryTitle+" "}-{episodelist.size()==1 ? '' : " "+absolute.pad(episodelist.size() < 99 ? 2 : 3)}{'Special '+special.pad(episodelist.size() < 99 ? 2 : 3)}{" "+(t)}{' {' + fn.matchAll(/extended|uncensored|remastered|unrated|uncen|unc|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, " ") + '}'} {Set<String> audios = audios.language; String res="";audios.each(){String audio -> audio.equals('en') ? res+="Eng" : '';audio.equals('de') ? res+="Ger" : ''; audio.equals('ja') ? res+="Jap" : ''};"["+res+"-Dub]";}{Set<String> langs = texts.language;String result=""; langs.each(){String language -> language.equals('en') ? result+="Eng" : '';language.equals('de') ? result+="Ger" : ''; language.equals('ja') ? result+="Jap" : ''}; "["+result +"-Sub]"}
[{source ? source+'_' : fn.matchAll(/bd|dvd|hdtv|web|BD|tv[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ') +'_'}
{dim[1]==720&dim[0]==1280 ? vf : dim[0]==1920&dim[1]==1080 ? vf : resolution}_{vc}_{video.bitdepth=='8' ? '8Bit' : '10Bit'}_{ac}]{'['+group+']'}
...Well don´t knew how to format that... the important part is in the above post.

Re: Tags and Fansub Question

Posted: 24 Aug 2015, 06:58
by rednoah
Yep, looks like the file is matched to the correct episode data, so that's not a problem.

The rest is in your format, which really only you can debug. ;)

I'd start with just {s00e00} to start with something that works, and then add your logic step by step to see which part of your format breaks things. If I were to guess it's because some bindings like absolute are not available and break the {...} group.

@see viewtopic.php?f=5&t=1895

Re: Tags and Fansub Question

Posted: 31 Aug 2015, 23:34
by GlassFish
Thanks,
I eased the Pattern a little bit up and it´s better working...

Regarding the subs:
If I have in one Folder many Subs. How to properly rename them?

Eg.:
Subs/True BloodS1E01.idx
Subs/True BloodS1E01.sub
Subs/True BloodS1E01-eng.idx
Subs/True BloodS1E01-eng-forced.idx
Subs/True BloodS1E01-ger-forced.sub

Is there an easy way to rename them? At the moment my pattern only names them as the .mkv.
Especially if not all Subs are in that format, but also with underscore or without any detimiers...

Re: Tags and Fansub Question

Posted: 01 Sep 2015, 08:44
by rednoah
Yes, again, your format is the key.

* You may use {ext} to check extension (helpful if you want a subfolder for subtitles)
* You may use {lang} to have filebot detect the language suffix (won't work for non-standard language tags like ger-forced)
* You may use {fn.match(...)} to retain information from the filename (e.g. forced tag)
* You may come up with your own ideas that I haven't even thought of yet (check subtitle content, word frequency, file size, etc) :P

The examples and other threads should be helpful.

Re: Tags and Fansub Question

Posted: 02 Sep 2015, 17:27
by GlassFish
Haha you are right.
For my limited usage it´s easier to write it then to ask for that :D

My last question:
Do you have anywhere an Javadoc or the Classes to check out all the variables?
Because I just found out that there is an file.path Array, which is useful.

Is there anything changed from "normal" programming?

Like when I have {String[] extensions= ["sub","idx","srt","ssa","mp4"];}, with parenthises it´s going to be compiled to the objectreference and without it will show the code, but how to set it up for later use?

Why is

Code: Select all

{String result=""; String e=""; String g=""; String f="";
extracted=fn.substring(fn.length()-10,fn.length());
 if(ext=~ /sub/ || ext=~ /idx/ || ext=~ /srt/ || ext=~ /ssa/ ){
	if(extracted.toLowerCase().contains("ger")) g="-GERMAN";
	if(extracted.toLowerCase().contains("eng")) e="-ENGLISH";
	if(extracted.toLowerCase().contains("forced")) f="-FORCED";
result=g + e +f;
}}
working, but if i don´t use the g,e,f and use instead result +=... it only takes the last String? :O