Page 1 of 1

Replace / not working

Posted: 16 Jun 2020, 23:27
by cuneglas
I was organizing my music library and I used this script.

Code: Select all

sudo filebot -rename "/volume/Media/Library/_BackOffice/Music/" -r --output "/volume/Media/Library/Music/" --format "{n.upperInitial()}/{album.upperInitial()} ({y})/{media.PartPosition!=null ? media.PartPosition+'.' : ''}{pi.pad(2)!=null ? pi.pad(2)+'.' : ''} {t.upperInitial()}" --log-file "/volume/Media/Library/_Logs/log_music.txt" --db ID3

Some of my files are songs from multiple artists and in the ID3 in the artists field, the artists are separated by /. This results in an artist's folder without any separation in the names.

I changed the script to have the names separated by a comma in the artist folder of the album, but in the two alternatives I tried, nothing happened, the result was the same as before.

In one I used

Code: Select all

sudo filebot -rename "/volume/Media/Library/_BackOffice/Music/" -r --output "/volume/Media/Library/Music/" --format "{n.upperInitial().slash(', ')}/{album.upperInitial()} ({y})/{media.PartPosition!=null ? media.PartPosition+'.' : ''}{pi.pad(2)!=null ? pi.pad(2)+'.' : ''} {t.upperInitial()}" --log-file "/volume/Media/Library/_Logs/log_music.txt" --db ID3

and in another I used

Code: Select all

sudo filebot -rename "/volume/Media/Library/_BackOffice/Music/" -r --output "/volume/Media/Library/Music/" --format "{n.upperInitial().replaceAll(' / ', ', ')}/{album.upperInitial()} ({y})/{media.PartPosition!=null ? media.PartPosition+'.' : ''}{pi.pad(2)!=null ? pi.pad(2)+'.' : ''} {t.upperInitial()}" --log-file "/volume/Media/Library/_Logs/log_music.txt" --db ID3

What am I doing wrong?

Re: Replace / not working

Posted: 17 Jun 2020, 01:14
by kim
so ?

Code: Select all

{'artist 1/.artist 2'.slash(', ')}
try

Code: Select all

{'artist 1/.artist 2'.replaceAll('/.', ', ')}

Re: Replace / not working

Posted: 17 Jun 2020, 04:32
by rednoah
Note that top-level bindings such as {n} or {artist} will be implicitly stripped of / and \ to make sure you can't accidentally build a folder structure.


If you want the raw ID3 tag value, then you can access that via the MediaInfo bindings:
viewtopic.php?t=4285

Re: Replace / not working

Posted: 17 Jun 2020, 14:06
by cuneglas
Thanks for your reply.
I've tried what you said using

Code: Select all

{general.albumperformer}
But I'm getting

Code: Select all

groovy.lang.MissingPropertyException: No such property: general for class: Script172
I've tried another property, like bpm, and I got the same error. When I try audio properties like

Code: Select all

{audio.bitrate}
The return value is [320000], as expected. So the problem is on the general properties.

What I'm doing wrong? What should I do?

Re: Replace / not working

Posted: 17 Jun 2020, 15:47
by rednoah
I think you're looking for {media} which will give you the general MediaInfo properties.

Re: Replace / not working

Posted: 17 Jun 2020, 16:20
by cuneglas
that does the trick
Thanks