I’m taking out playing now info from Foobar2000, and the info is unformatted sometimes like this:
p1_dk10_aac_h - foobar2000
Other times it’s like this, and that’s what I want:
Studio 2: Suksessromanen "Heroin chic" blir opera - foobar2000
I always want to remove the space and “- foobar2000”, and if the part with the aac is there I want to remove it all, so the sensor shows empty. I can remove the foobar2000 part easy:
{{ value.replace(' - foobar2000','') }}
That gives me the line above without that. But if I try to do two replaces, it doesn’t work in any way I have tried so far. I have tried several versions, like
{{ value.replace(' - foobar2000',''),('p1_dk10_aac_h','') }}
What is the correct way? It would of course be best if it was possible not to update the sensor at all if it is the aac line, but keep the previous value until it changes into something useful.