Replace / not working

Any questions? Need some help?
Post Reply
cuneglas
Posts: 11
Joined: 10 Jun 2018, 05:54

Replace / not working

Post 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?
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Replace / not working

Post by kim »

so ?

Code: Select all

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

Code: Select all

{'artist 1/.artist 2'.replaceAll('/.', ', ')}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Replace / not working

Post 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
:idea: Please read the FAQ and How to Request Help.
cuneglas
Posts: 11
Joined: 10 Jun 2018, 05:54

Re: Replace / not working

Post 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?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Replace / not working

Post by rednoah »

I think you're looking for {media} which will give you the general MediaInfo properties.
:idea: Please read the FAQ and How to Request Help.
cuneglas
Posts: 11
Joined: 10 Jun 2018, 05:54

Re: Replace / not working

Post by cuneglas »

that does the trick
Thanks
Post Reply