INTERACT FORUM

More => Old Versions => JRiver Media Center 22 for Windows => Topic started by: Antoine. on April 24, 2018, 06:27:49 am

Title: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?
Post by: Antoine. on April 24, 2018, 06:27:49 am
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
Title: Re: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?
Post by: RD James on April 24, 2018, 07:43:23 am
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. (https://wiki.jriver.com/index.php/Function_Index#Delimit.28.E2.80.A6.29)
Title: Re: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?
Post by: Antoine. on April 24, 2018, 10:31:48 am
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
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?
Title: Re: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?
Post by: RD James on April 24, 2018, 11:12:32 am
Code: [Select]
ListBuild(1, / -/ , [Name], RatingStars())
Alternatively:
Code: [Select]
ListBuild(1, / -/ , [Name], Delimit([Rating,0], / stars,))
ListBuild() (https://wiki.jriver.com/index.php/Function_Index#ListBuild.28.E2.80.A6.29)
 
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()".
Title: Re: RMCF Tool: How to Write a Directories Rule that Ignores Unpopulated Fields?
Post by: Antoine. on April 24, 2018, 12:31:20 pm
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!