More > JRiver Media Center 30 for Windows
Excluding [Track #] Field in ListBuild Expression
wraith:
Hi
I'm trying to create an expression that will rename my files in the format:
[Album] - [Track #] - [Artist] - [Name]
with any empty fields being excluded from the name [including the " - " between].
The expression I've created so far is:
--- Code: ---listbuild(1, / -/ ,
[Album,0],
[Track #, 0],
[Artist,0],
[Name,0]
)
--- End code ---
The above is, so far, working with the string fields but I'm getting stuck with the [Track #] field. The [Track #] field replaces an empty field with "00", and I would prefer it excluded. I understand, from my web, expression wiki and forum searches, this behaviour is by design. As such, I've played around with FormatNumber, Delimit etc. and can't get it to be excluded.
Would appreciate feedback on how to exclude the [Track #] field [and, I'm presuming, any other numeric fields].
Thanks in advance
zybex:
Hi wraith, there are several ways. Try this one:
--- Code: ---listbuild(1, / -/ ,
[Album],
if([Track #], [Track #],),
[Artist],
[Name]
)
--- End code ---
This works by checking if [track #] is "false" (a zero value is false in the Expression Language).
wraith:
Hi zybex.
Thanks for helping out.
Tried your suggestion and still outputting "00". I'm still hunting. Any other ideas?
zybex:
Strange. The renaming tool does some weird things. Try:
--- Code: ---listbuild(1, / -/ ,
[Album],
if(isempty([Track #]),,[Track #]),
[Artist],
[Name]
)
--- End code ---
Or:
--- Code: ---listbuild(1, / -/ ,
[Album],
if([Track #, 0], [Track #],),
[Artist],
[Name]
)
--- End code ---
wraith:
No luck. Both those options still output "00" :(
Navigation
[0] Message Index
[#] Next page
Go to full version