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

Don't include reviews without text into the popular list #147

Merged
merged 1 commit into from Aug 17, 2017

Conversation

breakbuidl
Copy link
Contributor

Modified the criteria for popular_reviews.
Consider only those reviews with text for popular_reviews. lt doesn't seem right to display reviews with only rating on the index page.

@breakbuidl
Copy link
Contributor Author

I am not quite sure how to change this part of code. Need some help here. https://github.com/ps2611/critiquebrainz/blob/3a8f407426f10cee173de47ee34d700c632b497c/critiquebrainz/db/review.py#L507

@gentlecat
Copy link
Contributor

I am not quite sure how to change this part of code. Need some help here. https://github.com/ps2611/critiquebrainz/blob/3a8f407426f10cee173de47ee34d700c632b497c/critiquebrainz/db/review.py#L507

Can't you check if latest revision of each review has any text?

@gentlecat gentlecat self-requested a review August 11, 2017 23:01
@breakbuidl
Copy link
Contributor Author

breakbuidl commented Aug 13, 2017

I don't know how the cache works but its possible that reviews might not contain any review with text or the number falls short of the limit. So, we need a loop which runs till the number of reviews with text is equal to the limit but again I don't know how cache.get() works.
Also, I don't understand how the popularity factor is accounted here.

@gentlecat
Copy link
Contributor

Oh, I misunderstood. You linked the line with the code related to cache key generation, not the whole function. I'm not sure what the problem is then. Cache only stores data that you give it.

The docstring of the get_popular function provides an overview for how it works. I think the only change that needs to be done with regards to this is to include only reviews that contain text. Now that I'm thinking about it, it doesn't actually make sense to vote on usefulness of star-only review.

@breakbuidl
Copy link
Contributor Author

Understood. So, this PR is complete unless I am missing something.
And, yes, voting on rating-only review doesn't make any sense. Working on it now.

@gentlecat
Copy link
Contributor

I strongly suggest that you finish UI work that you started and get to the API if you want to finish the project in time. There are always be things to improve, but you barely have enough time to finish what was planned.

@gentlecat gentlecat changed the title CB-244: Rating system (Popular reviews) Don't include reviews without text into the popular list Aug 17, 2017
@gentlecat gentlecat merged commit fda0a45 into metabrainz:master Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants