xbmc / metadata.themoviedb.org.python

Other
46 stars 41 forks source link

Sort best matching movie results by popularity #63

Closed malaterre closed 3 years ago

malaterre commented 3 years ago

When searching movies based solely on title and year, there may be multiple hits as seen in commit: 80c27ac

This commit make sure to order those multiple best matching results by popularity. This should make sure user gets the most likely result first.

Results for 'Dragons' + '2010' + fr-FR will be in that order:

  1. https://www.themoviedb.org/movie/10191-how-to-train-your-dragon?language=fr-FR
  2. https://www.themoviedb.org/movie/40911?language=fr-FR

Documentation at:

indicates that 'popularity' (number) is an optional response key, the code defaults to 0 when key is not present.