GNOME Bugzilla – Bug 723149
tmdb: Reduce number of network calls
Last modified: 2014-02-07 09:11:01 UTC
See "Appending responses" at http://docs.themoviedb.apiary.io/
Created attachment 267382 [details] [review] tmdb: Add support for creating combined requests Using the append_to_response parameter. This allows cutting down on the number of network requests.
Created attachment 267383 [details] [review] tmdb: Combine detail request calls Reducing the typical "everything" request from 5 calls to just 1.
I was comparing the results obtained with the current code and this proposed patch. And seems that with the new proposal there are several fields that are not shown, like author, certificate, performer....
Created attachment 267957 [details] [review] tmdb: Bug fix on top of request aggregation XXX To be merged with the other patch, attached for clarity
The responses look slightly different when requests are aggregated, this patch is the simplest I could find with my knowledge of JsonPath. I would merge it in the patch from comment 2, I just attached it here for you to read the differences more easily.
Created attachment 268290 [details] [review] tmdb: Combine detail request calls Reducing the typical "everything" request from 5 calls to just 1.
Which patches should be tried? The second one doesn't apply cleanly over the former.
patch from comment 6 is the patch from comment 2 + the patch from comment 4. The patch from comment 4 is just an intermediate patch to show what changed to fix your bug in comment 3. Mark the patch from comment 4 as obsolete once you've read it.
Created attachment 268385 [details] [review] tmdb: Fix tests
Created attachment 268386 [details] [review] tmdb: Fix tests
commit 9213ddb3f8a8c4717d526d17234546cf4eb67fed Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 08:54:53 2014 +0000 tmdb: Fix tests https://bugzilla.gnome.org/show_bug.cgi?id=723149 tests/tmdb/Makefile.am | 5 +---- tests/tmdb/data/casts.txt | 1 - tests/tmdb/data/images.txt | 1 - tests/tmdb/data/keywords.txt | 1 - tests/tmdb/data/multiple.txt | 1 + tests/tmdb/data/releases.txt | 1 - tests/tmdb/data/sherlock.ini | 36 ++++++------------------------------ tests/tmdb/test_tmdb_full_resolution.c | 12 ++++++------ 8 files changed, 14 insertions(+), 44 deletions(-) commit e015df016cb6a3ecfdd38aca3fc72ff7bf82d090 Author: Bastien Nocera <hadess@hadess.net> Date: Tue Jan 28 09:19:11 2014 +0100 tmdb: Combine detail request calls Reducing the typical "everything" request from 5 calls to just 1. https://bugzilla.gnome.org/show_bug.cgi?id=723149 src/tmdb/grl-tmdb.c | 540 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------ 1 file changed, 291 insertions(+), 249 deletions(-) commit cbf784d5aab9b7ed229b8ff234d66c4407a571a8 Author: Bastien Nocera <hadess@hadess.net> Date: Tue Jan 28 09:11:13 2014 +0100 tmdb: Add support for creating combined requests Using the append_to_response parameter. This allows cutting down on the number of network requests. https://bugzilla.gnome.org/show_bug.cgi?id=723149 src/tmdb/grl-tmdb-request.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/tmdb/grl-tmdb-request.h | 5 +++++ 2 files changed, 106 insertions(+), 1 deletion(-)