Page 1 of 1
None of these work: replace('AC-3','DD') or replace('AC3','DD') or replace('Dolby Digital','DD')
Posted: 22 Dec 2024, 21:07
by CaptainKen
Original FileName: NCIS s22e08 - Out of Control (HDTV-720p x265 AC3 5.1).mkv
When I use either of these expressions or remove them all: aco.replace('AC-3','DD') or aco.replace('AC3','DD') or aco.replace('Dolby Digital','DD')
I get this: NCIS s22e08 - Out of Control (HDTV 720p x265 Dolby Digital 5.1).mkv
So, unlike the other aco.replace expressions the "Dolby Digital" is being ignored.
Desired FileName" NCIS s22e08 - Out of Control (HDTV 720p x265 DD 5.1).mkv
LOGS:
# C:\Users\capta\AppData\Roaming\FileBot\logs\error.log
Dec 19, 2024 12:16:21 PM net.filebot.DiskStore acquireDiskStore
WARNING: Initialize new disk cache: C:\Users\capta\AppData\Roaming\FileBot\cache\0
Dec 19, 2024 1:05:47 PM net.filebot.License lambda$verifyLicense$2
WARNING: Activate License [PX67913137] on [Thu Dec 19 13:05:47 MST 2024]
https://pastebin.com/5VmdvB7Q
As you can see in this screen shot, all the other replace expressions work.
https://imgur.com/a/iPtINTP
Re: None of these work: replace('AC-3','DD') or replace('AC3','DD') or replace('Dolby Digital','DD')
Posted: 23 Dec 2024, 09:06
by rednoah
{aco} may be based on one of the following audio stream properties:
{aco} gives you
Dolby Digital for the file at hand because that's what
Format_Commercial says:
Properties: Select all
Format_Commercial : Dolby Digital

Your code takes the value of
{aco} and then replaces various values. The code notably does not replace
Dolby Digital so
Dolby Digital is what you get
Dolby Digital:
Groovy: Select all
aco.replace('AC3','DD').replace('Dolby Digital Plus with Dolby Atmos','DDP Atmos').replace('Dolby Digital Plus','DDP')

If you want to replace
Dolby Digital with
DD for example, then your code would have to specify that:
Groovy: Select all
aco.replace('Dolby Digital','DD')

You can specify multiple replacement operations like so:
Groovy: Select all
aco.replace(
'Dolby Digital Plus with Dolby Atmos' : 'DDP Atmos',
'Dolby Digital Plus' : 'DDP',
'Dolby Digital' : 'DD',
'AC3' : 'DD'
)
EDIT:
If you get different results, please post the code that gives you different results. The code in your OP above notably does not include a
Dolby Digital replacement.
Re: None of these work: replace('AC-3','DD') or replace('AC3','DD') or replace('Dolby Digital','DD')
Posted: 23 Dec 2024, 22:27
by CaptainKen
Thank you for the reply and all the many details!
I was able to get it working by changing the order of the aco expressions as shown here:
I took your advise and used better formatting (Is there an even better way?):
Really loving the power of your program as well as your support. Don't know how you manage to do it all, but thank you.
Re: None of these work: replace('AC-3','DD') or replace('AC3','DD') or replace('Dolby Digital','DD')
Posted: 24 Dec 2024, 02:12
by rednoah
CaptainKen wrote: ↑23 Dec 2024, 22:27
Is there an even better way?
The code looks readable and manageable now. That's what matters. Good job.