sahib / glyr

Glyr is a music related metadata searchengine, both with commandline interface and C API
GNU Lesser General Public License v3.0
248 stars 24 forks source link

Add [] {} <> to name normalization. #27

Closed meh closed 12 years ago

meh commented 12 years ago

I've got some tracks that use [] instead of () for extra info so I wasn't getting any result, this fixes that and adds some more parenthesis for dumb taggers and/or titles.

sahib commented 12 years ago

Im not to sure about [] - there are quite a few titles like "[untitled]", which are mostly hidden tracks of ripped cds, or are indeed named "untitled". Or "[chali]" from linkin park - I think it would be better to just strip the []s.

Could be done by adding another regex rule:

https://github.com/meh/glyr/blob/c53a18727a4b8319fae2210a0430f3fe1d95c54b/lib/stringlib.c#L116

Im fine with {} or <> - I have none of those although :-) Tell me what you think about this.

meh commented 12 years ago

They shouldn't be stripped, I didn't know about the regexps.

I'm trying to just add [feat.] to the regexp list but I'm being retarded and it's not working. What am I doing wrong?

sahib commented 12 years ago

Sorry, don't have the time right now, but I added a test main in stringlib.c and just compile it via:

gcc lib/stringlib.c $(pkg-config --libs --cflags glib-2.0) -std=c99 -lcurl

so you can test easier via ./a.out Hello [feat. World]"

sahib commented 12 years ago

Hi,

Just FYI: I've released libglyr 1.0.0 today. It should be backward compatible, but I fixed some of the misspelled enums (but provided #defines for old code). There is one new interface:

glyr_opt_normalize(GlyrQuery *, GLYR_NORMALIZATION norm)

.. which is there to tell the query how much artist/album/title shall be normalized. With GLYR_NORMALIZE_AGGRESSIVE everything in (), [] and <> is removed. Just in case you want to update ruby-glyr.

meh commented 12 years ago

Awesome, thank you.