Supporto The Movie Database

Hi,

Having my first play with the API and have found a problem that I can't see mentioned in the documentation anywhere.

I am trying to use the API to retrieve the latest movie a user rated, but the problem is that the rated movies aren't coming back in the same order each time. I was hoping they would come back in the order they were rated, but it doesn't seem to be, and nor does there appear to be any logic in how they are ordered as when you refresh it, it can be different.

For example with the request http://api.themoviedb.org/3/account/LevysFace/rated_movies?api_key=XXXX&session_id=YYY&sort_by=created_at

On first attempt I got the following:

{"page":1,"results":[{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":457,"rating":9.5},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1987,"rating":10.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":782,"rating":5.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1644,"rating":6.5},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0}],"total_pages":1,"total_results":9}

It then returned the same thing for half a dozen refreshed, but then on the next refresh, it returned the following, which is in a totally different order:

{"page":1,"results":[{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1644,"rating":6.5},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":457,"rating":9.5},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1987,"rating":10.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":782,"rating":5.5}],"total_pages":1,"total_results":9}

Is there any way to get a more consistent result from this?

Cheers

Pete

4 risposte (nella pagina 1 di 1)

Jump to last post

Are you setting a sort_order param? It doesn't look like it, try this:

http://api.themoviedb.org/3/account/LevysFace/rated_movies?api_key=###&session_id=###&sort_by=created_at&sort_order=desc

I'm seeing consistent results with this.

Thanks for the reply. I wasn't using that parameter, but I am now. Unfortunately it doesn't seem to have helped though, I'm still getting inconsistent results.

For example, for my first 28 refreshes I got the following (which I think is the correct order):

{"page":1,"results":[{"adult":false,"backdrop_path":"/5bKy4O0WQTa3MG2wPWViUNUTIEG.jpg","id":82992,"original_title":"Fast & Furious 6","release_date":"2013-05-24","poster_path":"/3Izae8UATwSHizQiEVZEWf53wjM.jpg","popularity":26.8458140459715,"title":"Fast & Furious 6","vote_average":6.4,"vote_count":930,"rating":6.5},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1648,"rating":6.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":785,"rating":5.5},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1989,"rating":10.0},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":458,"rating":9.5}],"total_pages":1,"total_results":10}

Then on the 29th refresh I got this, which is not the order the films were rated in:

{"page":1,"results":[{"adult":false,"backdrop_path":"/5bKy4O0WQTa3MG2wPWViUNUTIEG.jpg","id":82992,"original_title":"Fast & Furious 6","release_date":"2013-05-24","poster_path":"/3Izae8UATwSHizQiEVZEWf53wjM.jpg","popularity":26.8458140459715,"title":"Fast & Furious 6","vote_average":6.4,"vote_count":930,"rating":6.5},{"adult":false,"backdrop_path":"/qUcmEqnzIwlwZxSyTf3WliSfAjJ.jpg","id":68718,"original_title":"Django Unchained","release_date":"2012-12-25","poster_path":"/5WJnxuw41sddupf8cwOxYftuvJG.jpg","popularity":13.6069589768497,"title":"Django Unchained","vote_average":7.3,"vote_count":1837,"rating":9.0},{"adult":false,"backdrop_path":"/txNuyfTR6wr9j3aCpDRucW0E7pB.jpg","id":72710,"original_title":"The Host","release_date":"2013-03-26","poster_path":"/jnPOLAPQLhqMeDLV2BsQfrd6R11.jpg","popularity":24.6898054740569,"title":"The Host","vote_average":6.2,"vote_count":114,"rating":4.0},{"adult":false,"backdrop_path":"/rRhoMIqgdX9wEtRUOLsqXKkH9I0.jpg","id":70981,"original_title":"Prometheus","release_date":"2012-06-07","poster_path":"/idXq7NctkwoH59DRAIQlHEPtn95.jpg","popularity":12.962345374753,"title":"Prometheus","vote_average":6.1,"vote_count":785,"rating":5.5},{"adult":false,"backdrop_path":"/hbn46fQaRmlpBuUrEiFqv0GDL6Y.jpg","id":24428,"original_title":"The Avengers","release_date":"2012-05-04","poster_path":"/cezWGskPY5x7GaglTTRN4Fugfb8.jpg","popularity":14.4544686726208,"title":"The Avengers","vote_average":7.1,"vote_count":1989,"rating":10.0},{"adult":false,"backdrop_path":"/22DQWwjaam1LHTAEapxO2Wg7s2H.jpg","id":47964,"original_title":"A Good Day to Die Hard","release_date":"2013-02-14","poster_path":"/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg","popularity":25.4288388673309,"title":"A Good Day to Die Hard","vote_average":5.2,"vote_count":949,"rating":2.0},{"adult":false,"backdrop_path":"/mbiOyoOhVVgQ8nqIbMDwklqvvuW.jpg","id":329,"original_title":"Jurassic Park","release_date":"1993-06-08","poster_path":"/jdS21ipvYzLHqeVuLZrMxSUZsZ9.jpg","popularity":5.52003842235647,"title":"Jurassic Park","vote_average":7.0,"vote_count":458,"rating":9.5},{"adult":false,"backdrop_path":"/jjAq3tCezdlQduusgtMhpY2XzW0.jpg","id":49051,"original_title":"The Hobbit: An Unexpected Journey","release_date":"2012-12-12","poster_path":"/h1XjBJoWdOh8aegBoVYKgABQZSL.jpg","popularity":39.1547146455406,"title":"The Hobbit: An Unexpected Journey","vote_average":6.6,"vote_count":1648,"rating":6.5},{"adult":false,"backdrop_path":"/7NhgUfvLRkE7rWWaAbeqihiQTQs.jpg","id":72190,"original_title":"World War Z","release_date":"2013-06-21","poster_path":"/nVfFmQEjf7i0bkxFg3py4bwQmry.jpg","popularity":47.3452768895967,"title":"World War Z","vote_average":6.2,"vote_count":187,"rating":7.5},{"adult":false,"backdrop_path":"/5XPPB44RQGfkBrbJxmtdndKz05n.jpg","id":19995,"original_title":"Avatar","release_date":"2009-12-15","poster_path":"/8Ic8rRVoVrDJJlXzVzGxAesufUV.jpg","popularity":12.2318794497128,"title":"Avatar","vote_average":7.1,"vote_count":2255,"rating":0.5}],"total_pages":1,"total_results":10}

Cheers

Pete

Hey Pete,

Not sure then. I've created a new ticket for this here but I'm in the middle of some fairly large features and won't likely find time for this in the next few weeks.

Thanks for spotting the issue.

No worries, thanks for looking into it Travis.

Non riesci a trovare un film o una serie Tv? Accedi per crearlo.

Globale

s focalizza la barra di ricerca
p apri menu profilo
esc chiudi una finestra aperta
? apri finestra scorciatoia tastiera

Su tutte le pagine di media

b torna indietro (o al precedente quando applicabile)
e vai alla pagina di modifica

Nelle pagine delle stagioni TV

(freccia destra) vai alla stagione successiva
(freccia sinistra) vai alla stagione precedente

Nelle pagine degli episodi TV

(freccia destra) vai all'episodio successivo
(freccia sinistra) vai all'episodio precedente

Su tutte le pagine di immagini

a apri finestra aggiungi immagine

Su tutte le pagine di modifica

t apri selettore traduzione
ctrl+ s invia modulo

Sulle pagine di discussione

n crea nuova discussione
w segna come visto/non visto
p cambia publico/privato
c cambia chiuso/aperto
a apri attivita
r rispondi alla discussione
l vai all'ultima risposta
ctrl+ enter invia il tuo messaggio
(freccia destra) pagina successiva
(freccia sinistra) pagina precedente

Impostazioni

Vuoi valutare o aggiungere quest'elemento a una lista?

Accedi