Some errors in result from find command #272

Closed
trygveaa opened this Issue Dec 11, 2012 · 9 comments

4 participants

@trygveaa
Mopidy member

I have some errors when using the find command, which is issued by ncmpcpp when using the media library.

  • Albums which contains the album string is returned, not only albums named exactly that string.
  • Same goes for Artists.
  • Date field seems to be ignored.

Example:

find Artist "Madrugada" Album "Madrugada" Date "1974"

Returns multiple albums. The albums that shouldn't be returned:

  • "The Best of Madrugada" by "Madrugada"
  • "Sereno da Madrugada" by "Sereno da Madrugada"
  • "Madrugada" by "Madrugada" released in 2007
@jodal
Mopidy member

I assume you're using the Spotify backend?

@trygveaa
Mopidy member

Ah, should have specified that. Yes, Spotify backend and MPD frontend.

@jodal
Mopidy member

In the Spotify backend, library.find_exact() is currently implemented by passing the job on to library.search(). I doesn't look like Spotify search supports exact matches. Thus, we probably need to filter the results to only include exact matches ourselves in library.find_exact().

@jodal jodal added a commit to jodal/mopidy that referenced this issue Dec 20, 2012
@jodal jodal spotify: Spotify wants 'track', not 'title' (#272) cb78dc6
@jodal jodal added a commit that referenced this issue Dec 20, 2012
@jodal jodal mpd: Support search by date (#272) 242df28
@jodal
Mopidy member

With the two above changes, your example command returns exactly what you're looking for.

It still remains to make find_exact only return exact matches from Spotify.

@jodal
Mopidy member

@trygveaa Could you to summarize your suggestions from IRC on how to improve find_exact?

@trygveaa
Mopidy member

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.
@adamcik
Mopidy member

This reminds me of my recent idea to have a library API to allow MPD commands like list to be done more directly than searching if the backend implements it.

@trygveaa trygveaa referenced this issue in mopidy/mopidy-spotify May 16, 2014
Open

Searching for exact matches #11

@txomon
Mopidy member

Would this somehow merged to #45?

@jodal
Mopidy member
@jodal jodal closed this Sep 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment