Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artist-Title parsing fails under certain circumstances #14

Open
SlashQuit opened this issue Dec 19, 2011 · 0 comments
Open

Artist-Title parsing fails under certain circumstances #14

SlashQuit opened this issue Dec 19, 2011 · 0 comments

Comments

@SlashQuit
Copy link

Using the "DISC-TRACK - ARTIST - TITLE" structure, the following will parse correctly;
/cdg/CB/CB3xxxx/CB30055/CB30055-15 - Switchfoot - Stars.zip
Title: Stars
Artist: Switchfoot

However, the following examples do not parse;
/cdg/PH/PHM - Pop/PHM0512/PHM0512-08 - Switchfoot - Stars.zip
I assume this is due to the "-" character as part of the path.

SC3448-03 - All-American Rejects - Dirty Little Secret.zip
(Again I assume to the "-" in the artist name.)

CB5056-03-06 - Al Green - Let's Stay Together.zip
(Probably due to their being a "-" in the disc code CB5056-03.)

I understand that the format follows the correct specs of 'optional spaces', and this makes things tricky (near impossible) to parse certain valid filenames.

The problems here could be solved by adding an additional parsing option of
"DISC-TRACK-ARTIST-TITLE" - This is what exists, and allows the optional spaces.
"DISC-TRACK - ARTIST - TITLE" - This is what could be added, where the spaces are required.

  • First delimiter " " (or " - " if you want to be more strict) separates the DISC-TRACK from the rest of the string. If the next character is "-" or "- " (dash space), trim that too.
  • In the obtained DISC-TRACK, the LAST delimiter "-" separates the disc ID and the track. This would allow DISC ID's to contain dashes.
  • In the remaining artist-title string, use the first found delimiter " - ". Any further delimiter counts as the title (or artist, if the format is "title - artist".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant