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

Searching for exact matches #11

Open
kingosticks opened this issue Jan 7, 2014 · 7 comments
Open

Searching for exact matches #11

kingosticks opened this issue Jan 7, 2014 · 7 comments
Labels
C-enhancement Category: A PR with an enhancement or an issue with an enhancement proposal good first issue Call for participation Help needed Call for participation

Comments

@kingosticks
Copy link
Member

When using MPD's find command the results are supposed to be an exact match of the query but due to limitations in Spotify's searching you actually get partial matches more akin to SQL's LIKE operator.

e.g. Searching for "Opposite of December" gives you results from two albums:

  • "Opposite of December"
  • "The Opposite Of December / Tear From The Red"

This is pretty annoying when you browse an artist's album in MPD clients and get wrong and duplicate tracks entries.

I know of no way to force exact matching in Spotify queries so maybe we could further filter the results returned to us in find_exact()? Similarly, we could also filter by the fields that Spotify queries don't support i.e. track_no. The motivation for this being that much larger amounts of data are returned to the client than are necessary and it just slows things down. This also combines with the first problem and you can get the full track info for loads of unwanted tracks!

@jodal
Copy link
Member

jodal commented Jan 7, 2014

Agree! Should do this differently for the upcoming Mopidy-Spotify 2.0.

@kingosticks
Copy link
Member Author

Do you think there is any merit in doing this in pyspotify 2.0? At least the exact searches bit.

I vaguely remember the mention of an additional higher-level wrapper that did some extra useful stuff (I think this was based around the bug where starred playlists have no name),

@jodal
Copy link
Member

jodal commented Jan 9, 2014

It's worth considering at least. The immediate issue I can think of is how to make an "exact match" overlay over the existing search work nicely with pagination. If you search for "foo" and ask for 20 results, then you're told that "we found 73 results, here's the first 20" and then there's only 18 in the result, since two wasn't exact matches.

@trygveaa
Copy link
Member

mopidy/mopidy#272 seems relevant here. We should consider using artist/albumbrowse instead of or in addition to search for find_exact.

@jodal jodal added this to the v2.x milestone Sep 8, 2014
@jodal
Copy link
Member

jodal commented Sep 8, 2014

To move the entire discussion over here, I'm quoting @trygveaa from mopidy/mopidy#272:

We can first do a search for the query provided. Then traverse either the artist or album results, depending on what the query contained, to find the one that matches exactly (this means that searches will have to be able to return artists and albums, as discussed in #285). At last we do a lookup of the artist or album to retrieve all the tracks.

The benefits of this vs. a normal search:

  • We are able to retrieve all the tracks from the artist or album, not just a matching subset of the max number of tracks returned by searches.
  • We won't have to do any filtering.

The disadvantage:

  • We have to do two queries to Spotify.

@jodal
Copy link
Member

jodal commented Sep 8, 2014

From the discussion in mopidy/mopidy#727 it sounds like making exact searches exact would help on data quality in the ncmpcpp library view as well.

@jodal jodal modified the milestones: v2.x, v2.0 Mar 24, 2015
@jodal jodal modified the milestones: v2.0, v2.x Jun 2, 2015
@jodal jodal removed this from the v3.x milestone Nov 17, 2019
@jodal jodal removed the 1 - Ready label Dec 22, 2019
@kingosticks
Copy link
Member Author

This needs updating, especially given Spotify's latest fiddling to how search works. What does the web API now do and can we do better?

@kingosticks kingosticks added good first issue Call for participation Help needed Call for participation labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A PR with an enhancement or an issue with an enhancement proposal good first issue Call for participation Help needed Call for participation
Projects
None yet
Development

No branches or pull requests

3 participants