GNOME Bugzilla – Bug 733287
thetvdb: fetch show in cache with case insensitive
Last modified: 2014-07-30 16:28:02 UTC
Fix query case sensitive with show name
Created attachment 280899 [details] [review] thetvdb: fetch show in cache with case insensitive
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.
Review of attachment 280899 [details] [review]: Looks good.
Review of attachment 280900 [details] [review]: Looks good.
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 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
(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.
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".
Created attachment 281893 [details] [review] thetvdb: callback from resolve always return media
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)
Created attachment 281926 [details] [review] thetvdb: callback from resolve always return media
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.
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