With the end of the Subname being the language or if it´s forced or not.
So that it gets automatically recognised by VLC&KODI.
Here is how I check for subs:
Code: Select all
{isSub={if(ext=~ /sub/ || ext=~ /idx/ || ext=~ /srt/ || ext=~ /ssa/ || ext=~ /sup/|| ext=~/ass/) return true;};null}
...
{isSub() ? "Subs/" : null}
Code: Select all
{String result=""; String e=""; String g=""; String f=""; extracted=fn.substring(fn.length()-17,fn.length()); if(isSub()){ if(extracted.toLowerCase().contains("ger") || extracted.toLowerCase().contains("de")) g="-GERMAN"; if(extracted.toLowerCase().contains("eng") ) e="-ENGLISH"; if(extracted.toLowerCase().contains("forced")) f="-FORCED";result=g+e+f; }}{result}
Why are the last two not properly recognised and is there an way to simplify my language detection in the subfiles?