INTERACT FORUM

More => Old Versions => JRiver Media Center 25 for Windows => Topic started by: AlanDistro on September 28, 2019, 08:05:52 am

Title: Help with a Rename, Move, Copy expression
Post by: AlanDistro on September 28, 2019, 08:05:52 am
Hi all, not sure if this is possible, but if it is, could someone help me with an expression in the Rename, Move, Copy tool that would put movie files in a subfolder based on the first letter of the movie's Name?

For example, if the movie's Name is "Terminator 2: Judgement Day", I would like to Rename and Move from
.../_Ripped_/Terminator 2.mkv
to
.../Media/Movies/T/Terminator 2.mkv

It's that "T" folder I need to be dynamic but I don't know how to accomplish that. That way the next movie, say for example, "Halloween" would then go to
.../Media/Movies/H/Halloween.mkv

I don't want to throw a thousand movie files into one folder, using the subfolders should help make browsing and folder load times a bit easier for me. Thanks in advance!
Title: Re: Help with a Rename, Move, Copy expression
Post by: glynor on September 28, 2019, 08:54:59 am
I have exactly this.

Make a new Library Field called [Name Letters] (or whatever you want) with the following expression:
Code: [Select]
If(IsEmpty([Series],0),Regex([Name], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1]),Regex([Series], /#^(?:(?:the|an|a) +)?(.)#/,-1)if(Compare(1[R1], >=, 10), 0 - 9, [R1]))
Then, use that in your RMCF. It consolidates numbers into an item called "0-9" and ignores articles. If you need additional articles to be ignored, add them onto the (?:the|an|a) sections.

If you don't use [Series] for your Movies at all, then you can simplify that to remove the [Series] logic (though it won't hurt really). If the movie is tagged with a [Series] it will spit out the first letter of the Series title, if [Series] is blank, it spits it out for [Name].
Title: Re: Help with a Rename, Move, Copy expression
Post by: AlanDistro on September 28, 2019, 10:56:13 am
Thank you, that worked perfectly!