After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723149 - tmdb: Reduce number of network calls
tmdb: Reduce number of network calls
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other All
: Normal enhancement
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-28 08:21 UTC by Bastien Nocera
Modified: 2014-02-07 09:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tmdb: Add support for creating combined requests (5.81 KB, patch)
2014-01-28 08:21 UTC, Bastien Nocera
committed Details | Review
tmdb: Combine detail request calls (22.76 KB, patch)
2014-01-28 08:21 UTC, Bastien Nocera
none Details | Review
tmdb: Bug fix on top of request aggregation (7.11 KB, patch)
2014-02-03 14:50 UTC, Bastien Nocera
none Details | Review
tmdb: Combine detail request calls (24.73 KB, patch)
2014-02-06 13:19 UTC, Bastien Nocera
committed Details | Review
tmdb: Fix tests (33.29 KB, patch)
2014-02-07 08:56 UTC, Juan A. Suarez Romero
none Details | Review
tmdb: Fix tests (33.32 KB, patch)
2014-02-07 09:01 UTC, Juan A. Suarez Romero
committed Details | Review

Description Bastien Nocera 2014-01-28 08:21:13 UTC
See "Appending responses" at http://docs.themoviedb.apiary.io/
Comment 1 Bastien Nocera 2014-01-28 08:21:16 UTC
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.
Comment 2 Bastien Nocera 2014-01-28 08:21:26 UTC
Created attachment 267383 [details] [review]
tmdb: Combine detail request calls

Reducing the typical "everything" request from 5 calls to just 1.
Comment 3 Juan A. Suarez Romero 2014-01-31 10:27:45 UTC
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....
Comment 4 Bastien Nocera 2014-02-03 14:50:57 UTC
Created attachment 267957 [details] [review]
tmdb: Bug fix on top of request aggregation

XXX To be merged with the other patch, attached for clarity
Comment 5 Bastien Nocera 2014-02-03 14:52:59 UTC
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.
Comment 6 Bastien Nocera 2014-02-06 13:19:16 UTC
Created attachment 268290 [details] [review]
tmdb: Combine detail request calls

Reducing the typical "everything" request from 5 calls to just 1.
Comment 7 Juan A. Suarez Romero 2014-02-06 14:43:24 UTC
Which patches should be tried? The second one doesn't apply cleanly over the former.
Comment 8 Bastien Nocera 2014-02-06 14:53:07 UTC
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.
Comment 9 Juan A. Suarez Romero 2014-02-07 08:56:14 UTC
Created attachment 268385 [details] [review]
tmdb: Fix tests
Comment 10 Juan A. Suarez Romero 2014-02-07 09:01:59 UTC
Created attachment 268386 [details] [review]
tmdb: Fix tests
Comment 11 Juan A. Suarez Romero 2014-02-07 09:04:40 UTC
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(-)