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

Quotationmarks in Data Fields not escaped #71

Open
Jnns3001 opened this issue Nov 5, 2024 · 1 comment
Open

Quotationmarks in Data Fields not escaped #71

Jnns3001 opened this issue Nov 5, 2024 · 1 comment

Comments

@Jnns3001
Copy link

Jnns3001 commented Nov 5, 2024

If an "Artist Name(s)" field contains Double quotation marks ("), they will not be escaped. This will corrupt the .csv file.
So far I have only been able to produce this behaviour in "Artist Name(s)", but it is most likely a general problem.

For example
Broken: Royce Da 5'9"

Track ID,Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,				Danceability,Energy,Key,Loudness,Mode,Speechiness,Acousticness,Instrumentalness,Liveness,Valence,Tempo,Time Signature
3CJbxqRQ0JNCqboWDNUUeX,"I Will (feat. KXNG Crooked, Royce Da 5'9 & Joell Ortiz)","Music To Be Murdered By","Eminem,KXNG Crooked,Royce Da 5'9",Joell Ortiz",2020-01-17,303000,48,z6eby17xvrh974c18bxx5fgv0,2024-02-24T16:06:00Z,"detroit hip hop,hip hop,rap,cali rap,gangster rap,hardcore hip hop,battle rap","Shady/Aftermath/Interscope Records",0.635,0.543,8,-5.941,1,0.067,0.0454,0.000678,0.272,0.036,98.743,4

broken.csv

This could be fixed by escaping with another Double Quotation Mark ( "" )

Fixed: Royce Da 5'9""

Track ID,Track Name,Album Name,Artist Name(s),Release Date,Duration (ms),Popularity,Added By,Added At,Genres,Record Label,		Danceability,Energy,Key,Loudness,Mode,Speechiness,Acousticness,Instrumentalness,Liveness,Valence,Tempo,Time Signature
3CJbxqRQ0JNCqboWDNUUeX,"I Will (feat. KXNG Crooked, Royce Da 5'9 & Joell Ortiz)","Music To Be Murdered By","Eminem,KXNG Crooked,Royce Da 5'9"",Joell Ortiz",2020-01-17,303000,48,z6eby17xvrh974c18bxx5fgv0,2024-02-24T16:06:00Z,"detroit hip hop,hip hop,rap,cali rap,gangster rap,hardcore hip hop,battle rap","Shady/Aftermath/Interscope Records",0.635,0.543,8,-5.941,1,0.067,0.0454,0.000678,0.272,0.036,98.743,4

fixed.csv

@Jnns3001 Jnns3001 changed the title Quotation marks in Artist not escaped Quotationmarks in Data Fields not escaped Nov 5, 2024
@pavelkomarov
Copy link
Owner

pavelkomarov commented Nov 5, 2024

Good catch. Not sure how common an issue this is. I'll eventually fix it, but I'm no longer on a coding tear for this repo. I'd accept a PR quicker. I escape characters in several fields, so maybe it's just a matter of applying that same logic to artist names? Not sure whether I was already trying to treat artist names carefully this way; I'll have to look at the code. It'll be deep in the readCsv function.

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

2 participants