More > JRiver Media Center 21 for Windows
Songs with feat. (featuring) best practices
connersw:
--- Quote from: blgentry on March 11, 2016, 04:58:27 pm ---So play with it, but it's not advertised as being anywhere near perfect.
--- End quote ---
This is a great start. Thank you.
I've been playing a bit with the "feat." Artist expression to add more use cases, and now I have this:
--- Code: ---regex([Name],/#(.+)\s+((feat|ft|featuring)\.*.+$)#/,-1,0)[R2]
--- End code ---
I have pretty much zero experience with Regex or Perl, so I basically just edit from examples. Where I'm getting stuck now is if it is bracketed by parenthesis.
For example: [Name] = Song (feat. TEST)
Suggestions?
Also, as it works right now, if [Name] = Song feat. TEST, the output is feat. TEST. How can I get it to just output TEST? I can clean it up in a second step with Find and Replace, but if I can get the expression to do it in one step, it would be even better.
If I could get help with those two hiccups, I could write up a guide that I think would apply to 99% of the examples I see.
Thanks again.
blgentry:
--- Quote from: connersw on March 12, 2016, 09:34:12 am ---For example: [Name] = Song (feat. TEST)
--- End quote ---
You need to include literal parenthesis as optional matching elements. This is ugly because parenthesis are special characters in regex, so you have to escape them with backslashes first, like:
\(
\)
--- Quote ---Also, as it works right now, if [Name] = Song feat. TEST, the output is feat. TEST. How can I get it to just output TEST?
--- End quote ---
Parenthesis tell regex what to group together. [R2] is the second grouping in your expression of:
--- Code: ---regex([Name],/#(.+)\s+((feat|ft|featuring)\.*.+$)#/,-1,0)[R2]
--- End code ---
That second set surrounds the word "feat", so it's matching on it. Move the parenthesis to after "feat" and it will only get the artist name. I've combined both of your questions and come up with this expression which I think does both things:
--- Code: ---regex([Name],/#(.+)\s+\(*(feat|ft|featuring)\.*\s+([^\)]+)\)*$#/,-1,0)[R3]
--- End code ---
Test it out and let me know how it works.
Brian.
connersw:
Works perfectly. Thank you so much--this will save a ton of time.
Here is a quick guide for those wanting to use these expressions in the future to separate out featured Artists from the Name field:
1) Tools -> Options -> Library & Folders -> Manage Library Fields -> Add New Field Name your new field Featuring and select the Calculated data radio button. Enter the expression:
--- Code: ---replace(replace(replace(replace(replace(regex([Name],/#(.+)\s+\(*(featuring|feat|ft)\.*\s+([^\)]+)\)*$#/,-1,0)[R3],/,,;),&,;),and,;),/ ;,;),/; ,;)
--- End code ---
Click OK
2) Go back into Manage Library Fields -> Add New Field Name your new field Name Cleaned and select the Calculated data radio button. Enter the expression:
--- Code: ---if(regex([Name],/#(.+)\s+\(*(featuring|feat|ft)\.*\s+([^\)]+)\)*$#/,0,0),[R1],[Name])
--- End code ---
Click OK -> OK
3) Go to your Panes, Categories, or File List views or the Tag Window
4) Ensure the Album Artist field is populated with the main Artist you would like responsible for the Album. If it is not, you can correct this by entering =[Artist] or =[Album Artist (Auto)] into the Album Artist field.
5) In the Artist field type =[Artist]; [Featuring]
6) In the Name field type =[Name Cleaned]
A couple notes:
1) As always, when editing tags or using new expressions, start by going to File -> Library -> Back Up Library to back-up your Library before beginning. Also, test on a small set of files first to make sure it is behaving as you expect.
2) The nice part about this system is you can use it to batch rename files once you know it is behaving correctly (ie do all Tracks in an Album at once) since it will just default to the original Name and Artist if no Featuring Artist is in the Name field.
3) If a Featuring Artist has "&" or "and" in their name (Ex Simon & Garfunkel or Jason Isbell and The 400 Unit), this expression will separate that Featuring Artist into two separate Artists (Ex Simon; Garfunkel) so you must be careful in these cases. It assumes that these will be the exception, so you will need to correct them manually.
blgentry:
Glad to hear that the expressions worked well for your use. Nice writeup too. :)
Brian.
JustinChase:
great thread; bookmarked for when I have more time :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version