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

Review schema is only used in tests #1

Open
janwillies opened this issue May 10, 2023 · 0 comments
Open

Review schema is only used in tests #1

janwillies opened this issue May 10, 2023 · 0 comments

Comments

@janwillies
Copy link
Owner

janwillies commented May 10, 2023

I have the feeling that this part of the code only works for the tests, but not when querying Plattentests directly:

func (r *ReviewClient) getJson() (*ReviewSchema, error) {
var reviewSchema *ReviewSchema
reviewJSON := r.Doc.Find("script[type='application/ld+json']").Text()
if reviewJSON == "" {
return reviewSchema, &JsonNotFoundError{}
}
decodedReviewJSON := html.UnescapeString(reviewJSON)
err := json.Unmarshal([]byte(decodedReviewJSON), &reviewSchema)
if err != nil {
return reviewSchema, &JsonParseError{Err: err}
}
return reviewSchema, nil
}

That means we always use the fallback to get artist, album etc. Which is very error prone

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