Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

LB-331: Case insensitive messybrainz #32

Closed

Conversation

paramsingh
Copy link
Collaborator

Lowercase everything before working with the database.

We should probably hold off on deploying this until the data we already have is fixed?

if isinstance(value, str):
result[key] = value.lower()
elif isinstace(value, dict):
result[key] = lower(value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're doing these list/dict checks then it'd be good to extend the test to include these things too

@@ -144,11 +144,11 @@ def submit_recording(connection, data):
Returns:
the Recording MessyBrainz ID of the data
"""
data_json = json.dumps(data, sort_keys=True, separators=(',', ':'))
data_json = _convert_to_messybrainz_json(data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should only convert the data to lower-case while computing the sha.

In this example, data_json is now lower-case and we insert it into the database like that. This means that

  1. it's different from what the user submitted
  2. if we want to use it to show metadata on the website it's now all lower-case and ugly

as we get the artist name and release data from data, the artist and release data will be original case, but the data in the recording table will be lower-cased

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 !!

@paramsingh
Copy link
Collaborator Author

Closing in favor of #56

@paramsingh paramsingh closed this Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants