help with upper() and replace() for text/audio.language
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
help with upper() and replace() for text/audio.language
hi im new in this and tried customize my renaming but coudnt get it to work...
{n} - {s00e00} - {t} DUB-{audio.language} SUB-{text.language}{if (file.issubtitle) fn =~ /[.]eng$/ ? '.eng' : '.ger' }{'.'+fn.match(/forced/)} [{vf}]
i wanted to make the languages in caps but with ".upper()" it didnt work for it... dont know why... seems like this expression works only for this 1-2 letters long expressions....
then i wanted to replace the commas in {text/audio.languages} (originally i had preferred to restructure it completely in [DUB-LANG-LANG] with exact 3 letters) but that is far away from my knowledge to syntax i guess xD
has someone some code already or could someone help please?
ps the last command is obviously coppy and paste, i dont understand this myself even when i searched for fn description i dont get it and the symbols before and after eng eng ger etc dont make any sense to me xD haha
{n} - {s00e00} - {t} DUB-{audio.language} SUB-{text.language}{if (file.issubtitle) fn =~ /[.]eng$/ ? '.eng' : '.ger' }{'.'+fn.match(/forced/)} [{vf}]
i wanted to make the languages in caps but with ".upper()" it didnt work for it... dont know why... seems like this expression works only for this 1-2 letters long expressions....
then i wanted to replace the commas in {text/audio.languages} (originally i had preferred to restructure it completely in [DUB-LANG-LANG] with exact 3 letters) but that is far away from my knowledge to syntax i guess xD
has someone some code already or could someone help please?
ps the last command is obviously coppy and paste, i dont understand this myself even when i searched for fn description i dont get it and the symbols before and after eng eng ger etc dont make any sense to me xD haha
Re: help with upper() and replace() for text/audio.language
1.
{audio} is a List of Audio MediaInfo. Thus {audio.language} is a List of language properties for each audio stream, and you want to call upper() for each of those.
Hence:
If you want to convert List of Text objects to a single Text object then you can call the join() method with your preferred separator character.
2.
All that subtitle logic can probably be replaced with the {subt} binding.
{audio} is a List of Audio MediaInfo. Thus {audio.language} is a List of language properties for each audio stream, and you want to call upper() for each of those.
Hence:
Code: Select all
{audio.language*.upper()}
2.
All that subtitle logic can probably be replaced with the {subt} binding.
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
much appreciated for the help xD
could help me with replace() too?
i tried it with {n}:
i go with replaceall().... the whole name vanished
i go with replace()... and the whole name would be like that Firefly : [F,i,r,e,f,l,y,] or with replacement like "-" :
[-F-,-i-,-r-,-e-,-f-,-l-,-y-]
edit it was because of the "*" but in audio.language i couldnt get it to work though
could help me with replace() too?
i tried it with {n}:
i go with replaceall().... the whole name vanished
i go with replace()... and the whole name would be like that Firefly : [F,i,r,e,f,l,y,] or with replacement like "-" :
[-F-,-i-,-r-,-e-,-f-,-l-,-y-]
edit it was because of the "*" but in audio.language i couldnt get it to work though
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
nevermind read just now that with join()
now its working like a charm thx xD
now its working like a charm thx xD
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
i tried subt already at the end with simply ...{subt}
but it doesnt give me any result
but it doesnt give me any result
Re: help with upper() and replace() for text/audio.language
{subt} will only yield results for subtitle files. People are usually confused by their own text environment (e.g. sample file).
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
i dont get it xD
my subtitles are dedicated subtitles as idx, subs
(ok i guess idx arent real subtitles for itself but they hold format infos or not?)
my subtitles are dedicated subtitles as idx, subs
(ok i guess idx arent real subtitles for itself but they hold format infos or not?)
Re: help with upper() and replace() for text/audio.language
{subt} is based on statistical language detection which doesn't work on bitmap images. The idx/sub pairs are binary files, not text files, so it won't work.
Any self-respecting data hoarder will use srt subtitles which are text based and infinitely better in every aspect. {subt} works for standard subtitles. {subt} does not work for ancient idx/sub bitmap subtitles, but you can always stick to the hard-coded logic you're using in the OP.
Any self-respecting data hoarder will use srt subtitles which are text based and infinitely better in every aspect. {subt} works for standard subtitles. {subt} does not work for ancient idx/sub bitmap subtitles, but you can always stick to the hard-coded logic you're using in the OP.
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
now i get what you mean
didnt know that the difference lies in something like that... thought the whole time that the subtitles would look different to srts because of the idx files
but although you say something like that....are there srts with individual color, display position and fonts?
else i dont get why you would say "any self-respecting data hoarder" and "infinitely better(for what)"?
didnt know that the difference lies in something like that... thought the whole time that the subtitles would look different to srts because of the idx files
but although you say something like that....are there srts with individual color, display position and fonts?
else i dont get why you would say "any self-respecting data hoarder" and "infinitely better(for what)"?
Re: help with upper() and replace() for text/audio.language
SRT is the most popular format because it's simple and without all that fancy crap you don't want anyway. The Anime folks do need something fancy so they use SSA.
IDX/SUB is the equivalent of writing an email, then taking a screenshot of the text, then deleting the text and sending the screenshot instead. It was made for DVD players from pre-2000 that didn't have enough CPU / RAM to render text.
IDX/SUB is the equivalent of writing an email, then taking a screenshot of the text, then deleting the text and sending the screenshot instead. It was made for DVD players from pre-2000 that didn't have enough CPU / RAM to render text.
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
so ssa subs would be text based and would still have this unique kind of displaying?
i searched via google and the result is for me, all have the same opinion like you, they are nearly disgusting fancy and a load of issues in it xD but i like SSAs
i watched now a comparison in quality of vobsubs....i never saw this, but they are realy bad in quality and never noticed it xD haha
thx for this enlightment xD
i searched via google and the result is for me, all have the same opinion like you, they are nearly disgusting fancy and a load of issues in it xD but i like SSAs
i watched now a comparison in quality of vobsubs....i never saw this, but they are realy bad in quality and never noticed it xD haha
thx for this enlightment xD
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
is there a way to make a boolean to fold/unfold?
or could you tell me the syntax of " if(text.language== is not null) "
everytime if i make it a boolean its true because null is a value....
Code: Select all
{text.language*.upper().join("-").replace("DE","DEU").replace("JA","JAP").replace("EN","ENG")}}+"-SUB]"}
or could you tell me the syntax of " if(text.language== is not null) "
everytime if i make it a boolean its true because null is a value....
Re: help with upper() and replace() for text/audio.language
I don't know what you mean. Empty List and null are false according to Groovy Truth. The expression you posted is not valid neither.
I'd do it like this:
I'd do it like this:
Code: Select all
{def x = text.language.findResults{ it.toLocale().ISO3Language.upper() }.join('-'); if (x) "[$x-SUB]"}
-
- Posts: 9
- Joined: 07 Oct 2016, 15:54
Re: help with upper() and replace() for text/audio.language
dont know either i made it at 4am xD
but wow thx would i have known that i can just use this xD
but really thx, im bad in such things when it comes to "x=results *results cached* *if there cached results* *make "x-sub"*" (is that right?)
but wow thx would i have known that i can just use this xD
but really thx, im bad in such things when it comes to "x=results *results cached* *if there cached results* *make "x-sub"*" (is that right?)