INTERACT FORUM
More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: InflatableMouse on May 09, 2013, 01:45:02 pm
-
Is it possible to use an expression in the rename window to evaluate a field value and rename based on the outcome?
I have an [Album Version] field that I've been using to record the album release version. But the majority of albums don't have anything for that value though, so its empty.
I tried a couple of things, for instance:
[Artist]\/[[Year]/] [Album] if(isempty([Album Version]),,/([Album Version]/))
The preview works fine when [Album Version] has a value, but if its empty it adds (Unknown Album Version). I don't want it to add anything in that case but I can't seem to get it to work that way.
If anyone knows how to fix that I'd appreciate it.
Thanks!
-
Delimit() (http://wiki.jriver.com/index.php/Media_Center_expression_language#Delimit.28....29:_Outputs_a_value_with_head.2Ftail_strings_when_value_is_non-empty) should cover this, though you might have to use [Tag,0] for some values.
[Artist]\/[[Year]/] [Album]Delimit([Album Version,0],/),/ /()
-
That easy huh :D.
Works fine on a few samples I've tried, thank!
-
[Artist]\/[[Year]/] [Album] if(isempty([Album Version,0]),,/([Album Version]/))
Adding the ",0" to [album version] in your original expression would also have worked.
Using ",0" inside the field name tells MC to use the literal field contents. Before we got this, I would use isequal instead of isempty, asking, if the field contains 'unknown', output nothing, otherwise use the field.
-marko