INTERACT FORUM

More => Old Versions => JRiver Media Center 24 for Windows => Topic started by: Gatherum on July 29, 2018, 01:17:48 am

Title: [24.0.41; Query—Answered] Move leading articles to end of string
Post by: Gatherum on July 29, 2018, 01:17:48 am
Good morning. This specifically concerns the Rename, Move, & Copy feature, and possibly the expression language in general.

How might I use that tool to move any leading articles (a, an, the...) appearing in the [Album Artist (auto)] field to the end? So, in the case of a band like, say, The Chant, MC would create a directory named Chant, The instead. This hypothetical function would ideally reference the list of articles in Tools > Options... > Tree & View > Sorting.

Perusing the wiki with a Ctrl+F to find "articles", I stumbled upon the Clean (https://wiki.jriver.com/index.php/String_Manipulation_Functions#Clean) function which can effect automatic removal but this is not the intent. Perhaps a fifth mode can be added to this function that moves articles instead?
Title: Re: [24.0.41; Query] Move leading articles to end of string
Post by: marko on July 29, 2018, 01:41:42 am
Did you try using the "Swap()" function?

https://wiki.jriver.com/index.php/String_Manipulation_Functions#Swap
Title: Re: [24.0.41; Query] Move leading articles to end of string
Post by: Gatherum on July 29, 2018, 02:12:47 am
Ooh, that's promising!

...But it doesn't appear to be tailored for library fields without semicolon delimiting. What would it do if I used Swap([Album Artist (auto)])?
Title: Re: [24.0.41; Query] Move leading articles to end of string
Post by: lepa on July 29, 2018, 03:09:01 am
MoveArticles(string)

Description: 
Takes The Beatles and reverses it to Beatles, The.

The MoveArticles() function is similar to the Swap() function, except that it operates on strings with prefixed articles (such as "The Beatles" or "A Flock of Seagulls".)

Examples:
    MoveArticles(The Beatles)
        Moves the article to the end of the name Beatles, The.

https://wiki.jriver.com/index.php/String_Manipulation_Functions#MoveArticles.28.E2.80.A6.29
Title: Re: [24.0.41; Query—Answered] Move leading articles to end of string
Post by: Gatherum on July 29, 2018, 04:01:02 am
MoveArticles(string)

Description: 
Takes The Beatles and reverses it to Beatles, The.

The MoveArticles() function is similar to the Swap() function, except that it operates on strings with prefixed articles (such as "The Beatles" or "A Flock of Seagulls".)

Examples:
    MoveArticles(The Beatles)
        Moves the article to the end of the name Beatles, The.

https://wiki.jriver.com/index.php/String_Manipulation_Functions#MoveArticles.28.E2.80.A6.29

Oh, darn! I wonder why that didn't come up in Ctrl+F...

This does precisely what I want. Thank you! ^^