Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Support querying by exact rating #53

Closed
derat opened this issue Jan 11, 2023 · 2 comments
Closed

Support querying by exact rating #53

derat opened this issue Jan 11, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@derat
Copy link
Owner

derat commented Jan 11, 2023

I'm not sure how I'd expose it in the UI, but it'd be nice if there were some way to query for songs by exact rating instead of just by minimum rating or unrated. Maximum rating might also be useful for finding potentially-misrated songs.

Behind the scenes, a minimum rating of 5 is already mapped to Rating = 5 and unrated is mapped to Rating = 0; it's just 1-4 that are inaccessible.

The server side of this is easy; I can just add a rating parameter to the /query endpoint and update the query package to add the appropriate equality filter.

If I want to add maxRating, that hopefully also wouldn't require a schema change:

  • 0 is Rating = 0
  • 1-3 are RatingAtLeast2 = false, RatingAtLeast3 = false, and RatingAtLeast4 = false
  • 4 is Rating != 5

I'm not sure that I can use the != operator; https://cloud.google.com/datastore/docs/concepts/queries#not-equal says that it's only available in Firestore for Datastore mode (but I think I got migrated).

@derat derat added the enhancement New feature or request label Jan 11, 2023
@derat derat self-assigned this Jan 11, 2023
@derat
Copy link
Owner Author

derat commented Jan 11, 2023

!= doesn't seem to work, at least in dev_appserver, but I should be able to just use Rating < 5 instead.

derat added a commit that referenced this issue Jan 11, 2023
These aren't exposed in the client yet. See #53.
@derat derat closed this as completed in 82f32f0 Jan 12, 2023
@derat
Copy link
Owner Author

derat commented Jan 12, 2023

No immediate plans to expose this in the Android app, since I've only wanted it when looking for misrated songs so far.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant