jpschafer / Music-Survival-Kit

Survival Kit/Guide For Managing Music Libraries.
2 stars 0 forks source link

Create RegexRule for Standardizing Featured Artists And Remixed By #1

Open jpschafer opened 6 years ago

jpschafer commented 6 years ago

Rationale: https://www.lifehacker.com.au/2011/09/how-do-you-tag-songs-with-featured-performers/

There are cases where this is organized differently depending on who tagged the music files, what store you retrieved them from, etc. It would also be impossible especially in large libraries to deal with this manually via mp3tag, etc. Since Bliss has a regex rules system, we can fix this automatically.

Some Examples: track title (ft. artist) track title (feat. artist) <-- My Preferred Version (without Remixer) track title feat. artist track title feat. artist (artist_2 remix) track title (feat. artist) (artist_2 remix) track title (ft. artist) [artist_2 remix] track title (feat. artist) [artist_2 remix] <-- My Preferred Version (With Remixer)

This will involve multiple versions most likely, but to start I will write one for my preferred "visual aesthetic" as noted above. Using Parentheses to describe featured artist makes it obvious, and having a different type of closure like braces for remixes will make it obvious their purpose and easier to parse for future unknown reasons.

Regexes To Make:

Above is a draft, may or may not be grammatically correct

jpschafer commented 6 years ago

See The Following links for Regexes being written & Tested: FEATURED_ARTIST_NO_CLOSURE: https://regexr.com/3ju5u FEATURED_ARTIST_CLOSURE: https://regexr.com/3ju8f FEATURED_ARTIST_WRONG_CLOSURE: https://regexr.com/3jvpa

gravelld commented 6 years ago

Added support for the top parentheses:

^([^\[\(\)\]]+)\s*\(?((feat|ft|featuring)\.?\s+([^\[\(\)\]]+))\)?$
jpschafer commented 6 years ago

I was originally writing the one you provided above, but then I realized that the regex would grab the following (Which I just updated my examples to show this is an acceptable format) and mark it as incorrect as it would always see it: track title (feat. artist)

I'm not super familiar with Bliss's way of handling regex rules. What I didn't want it turning into is an infinite loop of it saying there's something wrong with that track, and when it gets fixed it just shows up again on the audit.

This makes me think we may need more than 1 regex rule to be able to handle multiple edge cases, since regex rules can't "go back and correct" themselves when they hit something as they don't remember previous state of what they processed.

If you have any ideas on it feel free to correct me.

gravelld commented 6 years ago

An infinite loop would only occur if the "replace with" clause was basically replacing with the same groups so the same track name is written. I assumed, maybe incorrectly, you'd just be replacing with group 1.

jpschafer commented 6 years ago

I see where the misunderstanding occurred. My intentions were for information like featured artist and remixer to still be in the track title, as I've never seen any music player nor tagged file ever have this information stored elsewhere, even though ID3 and Vorbis Comments both can support storing this information natively.

Maybe that data needs to just be cleaned off the track and put in their appropriate tags (this would be more correct in a data integrity sense I would think and it would definitely clean up track names). Does your regex rule system have a way to transition regex groups from one tag field to another?

gravelld commented 6 years ago

No, it's just a way of rewriting the current field...

jpschafer commented 6 years ago

That's fine, I was just curious what its limitations were and if that was a possible use case. I may be being too pedantic about my music library getting caught up in details that don't matter (it wouldn't be the first time).

I will make another regexrule file in the repo with your regex in case other bliss users find it handy to have the featured artists removed entirely from their song titles. Currently I will make the other regex rules described above for personal use to at least have consistent formatting across track titles, since removing featured artists is a destructive action and I'm not quite sure I want those removed entirely.