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 733287 - thetvdb: fetch show in cache with case insensitive
thetvdb: fetch show in cache with case insensitive
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-17 02:46 UTC by Victor Toso
Modified: 2014-07-30 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
thetvdb: fetch show in cache with case insensitive (1.13 KB, patch)
2014-07-17 02:46 UTC, Victor Toso
committed Details | Review
thetvdb: call the callback with episode cache miss (1.67 KB, patch)
2014-07-17 02:47 UTC, Victor Toso
needs-work Details | Review
thetvdb: callback from resolve always return media (1.92 KB, patch)
2014-07-29 00:55 UTC, Victor Toso
none Details | Review
thetvdb: call the callback with episode cache miss (1.67 KB, patch)
2014-07-29 01:02 UTC, Victor Toso
none Details | Review
thetvdb: callback from resolve always return media (4.57 KB, patch)
2014-07-29 09:20 UTC, Bastien Nocera
committed Details | Review
thetvdb: call the callback with episode cache miss (1.40 KB, patch)
2014-07-29 09:20 UTC, Bastien Nocera
committed Details | Review

Description Victor Toso 2014-07-17 02:46:21 UTC
Fix query case sensitive with show name
Comment 1 Victor Toso 2014-07-17 02:46:23 UTC
Created attachment 280899 [details] [review]
thetvdb: fetch show in cache with case insensitive
Comment 2 Victor Toso 2014-07-17 02:47:55 UTC
Created attachment 280900 [details] [review]
thetvdb: call the callback with episode cache miss

If the cache is up-to-date and we hit a cache miss, call the callback.
Comment 3 Bastien Nocera 2014-07-17 09:07:30 UTC
Review of attachment 280899 [details] [review]:

Looks good.
Comment 4 Bastien Nocera 2014-07-17 09:08:35 UTC
Review of attachment 280900 [details] [review]:

Looks good.
Comment 5 Bastien Nocera 2014-07-17 09:35:54 UTC
Review of attachment 280900 [details] [review]:

::: src/thetvdb/grl-thetvdb.c
@@ +1326,3 @@
+
+episode_done_end:
+  os->callback (os->source, os->operation_id, media, os->user_data, NULL);

Actually, that will pass a NULL media on failure.

using media ? media : os->media worked, but the thetvdb_update_media_from_resources() call should probably just add the metadata to the existing media and return os->media.
Comment 6 Victor Toso 2014-07-18 03:08:45 UTC
Comment on attachment 280899 [details] [review]
thetvdb: fetch show in cache with case insensitive

Attachment 280899 [details] pushed as 8eec50c - thetvdb: fetch show in cache with case insensitive
Comment 7 Victor Toso 2014-07-18 03:20:54 UTC
(In reply to comment #5)
> Review of attachment 280900 [details] [review]:
> 
> ::: src/thetvdb/grl-thetvdb.c
> @@ +1326,3 @@
> +
> +episode_done_end:
> +  os->callback (os->source, os->operation_id, media, os->user_data, NULL);
> 
> Actually, that will pass a NULL media on failure.
> 
> using media ? media : os->media worked, but the
> thetvdb_update_media_from_resources() call should probably just add the
> metadata to the existing media and return os->media.

Hmmm. On failure shouldn't we pass NULL in the callback? If not, there are a few more callbacks at grlt-thetvdb that use NULL on failure...

thetvdb_update_media_from_resources only return NULL if none of the requested keys were resolved... I did this way while thinking that we should pass NULL on failure in the callback.
Comment 8 Juan A. Suarez Romero 2014-07-22 06:54:01 UTC
You should return NULL for the browse/search case, because you can't create the elements on error.

In the case of resolve(), you return the same media back, because it is a way of telling "look, can't resolve any requested key for this media because this error, so I return the media back".
Comment 9 Victor Toso 2014-07-29 00:55:59 UTC
Created attachment 281893 [details] [review]
thetvdb: callback from resolve always return media
Comment 10 Victor Toso 2014-07-29 01:02:45 UTC
Created attachment 281895 [details] [review]
thetvdb: call the callback with episode cache miss

If the cache is up-to-date and we hit a cache miss, call the callback.
(rebased)
Comment 11 Bastien Nocera 2014-07-29 09:20:06 UTC
Created attachment 281926 [details] [review]
thetvdb: callback from resolve always return media
Comment 12 Bastien Nocera 2014-07-29 09:20:11 UTC
Created attachment 281927 [details] [review]
thetvdb: call the callback with episode cache miss

If the cache is up-to-date and we hit a cache miss, call the callback.
Comment 13 Bastien Nocera 2014-07-30 16:27:53 UTC
Attachment 281926 [details] pushed as 2286f36 - thetvdb: callback from resolve always return media
Attachment 281927 [details] pushed as a1cd1fe - thetvdb: call the callback with episode cache miss