More > JRiver Media Center 22 for Windows

RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?

(1/1)

Antoine.:
Hi,

I'd like to have one of my preset for RMCF tool to classify and rename a file in a sub-directory based on its [grouping] value. But I also want this value to be ignored if this field is not populated.

Specifically, it looks like this in the RMCF tool (Rename mode) > Directories > Base Path > D:\[series]\[grouping]

I don't want the selected files to end up in an unnamed folder (itself in the [series] folder) if the [grouping] field is not populated. I want this part of the rule to be ignored in this case and the files to end up in the [series] folder.

Not unlike the [album artist (auto)] field, if I'm not mistaken.

How can I do that?

Antoine

RD James:
You can typically add ,0 to the field to ensure that a blank value is output for an empty field - so [Series,0]

There are multiple ways that you can prepend [Series] to [Grouping] only if [Grouping] has a value.
The shortest is probably: Delimit([Grouping,0], ,Delimit([Series,0], /\, /\))
 
Details on the Delimit() function here.

Antoine.:
Adding 0 is already really helpful for a lot of situations, thanks!

I'll need a bit more time to use the Delimit function.

Do you have any idea as to how I could have the following Filename rule :

--- Quote ---[name] - [rating] stars
--- End quote ---
Only difference with this is that I want the whole " - [rating] stars" to disappear if [rating] value is empty...
I could use the "if" function, but is there an easier way to do that?

RD James:

--- Code: ---ListBuild(1, / -/ , [Name], RatingStars())
--- End code ---

Alternatively:

--- Code: ---ListBuild(1, / -/ , [Name], Delimit([Rating,0], / stars,))
--- End code ---

ListBuild()
 
The forward slashes are used to escape the spaces; i.e. force them to be included in the delimiter so that you get "[Name] - RatingStars()" rather than "[Name]-RatingStars()".

Antoine.:
Awesome! Thanks again!

The listbuild function is really helpful because I wanted to rename a ton of files and include lots of values in the filenames (some populated, some not). I started with the if() function: always helpful but way more tiresome!

Navigation

[0] Message Index

Go to full version