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 673935 - local-metadata: Sync calls fetching album art
local-metadata: Sync calls fetching album art
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on: 724879
Blocks:
 
 
Reported: 2012-04-11 18:19 UTC by Bastien Nocera
Modified: 2015-07-15 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2012-04-11 18:19:59 UTC
resolve_album_art() contains a sync call to g_file_test(). It should use g_file_query_exists() instead.
Comment 1 Juan A. Suarez Romero 2012-04-18 07:58:22 UTC
Also present in Filesystem plugin
Comment 2 Juan A. Suarez Romero 2012-04-18 08:06:45 UTC
(In reply to comment #0)
> resolve_album_art() contains a sync call to g_file_test(). It should use
> g_file_query_exists() instead.


Why g_file_query_exists() is preferable over g_file_test()?

Note that for g_file_query_exists(), I need to instantiate a GFile object just to perform the operation, and then free it because I don't need it anymore.
Comment 3 Bastien Nocera 2012-04-18 10:25:39 UTC
Make that g_file_query_info(), which will be async.

And if you start thinking that g_file_new_... is a drag on performance, better stop using GObject altogether ;)
Comment 4 Juan A. Suarez Romero 2012-04-18 14:04:09 UTC
So, your suggestion is replacing g_file_test() (which is sync) by g_file_query_info_async() (which is async), not by g_file_query_exists(), which is a sync function too.

In that case, then it makes sense.
Comment 5 Simon McVittie 2015-07-15 17:00:04 UTC
Appears to have been fixed in eb546cbf "local-metadata: Use libmediaart" somewhere between 0.2.12 and 0.2.14 (Bug #724046).

There's still some g_file_test() in other plugins, but not in local-metadata any more.