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 727463 - Ugly warning when using media_art_get_path
Ugly warning when using media_art_get_path
Status: RESOLVED FIXED
Product: libmediaart
Classification: Other
Component: Cache
0.4.x
Other Linux
: Normal normal
: ---
Assigned To: libmediaart maintainer(s)
: 731659 733304 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-04-01 21:44 UTC by Vadim Rutkovsky
Modified: 2014-09-10 08:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Check that file is not NULL (655 bytes, patch)
2014-04-01 21:44 UTC, Vadim Rutkovsky
none Details | Review

Description Vadim Rutkovsky 2014-04-01 21:44:43 UTC
Created attachment 273432 [details] [review]
Check that file is not NULL

In python console:
>> MediaArt.get_path('Sgt Pepper', "Beatles", "album", None)

(process:17843): GLib-GIO-CRITICAL **: g_file_get_parent: assertion 'G_IS_FILE (file)' failed

this happens as in media_art_get_path we pass file = NULL, but in media_art_get_file we try to get its parent.

Attached file solves the problem
Comment 1 Martyn Russell 2014-09-10 08:43:15 UTC
(In reply to comment #0)
> Created an attachment (id=273432) [details] [review]
> Check that file is not NULL
> 
> In python console:
> >> MediaArt.get_path('Sgt Pepper', "Beatles", "album", None)
> 
> (process:17843): GLib-GIO-CRITICAL **: g_file_get_parent: assertion 'G_IS_FILE
> (file)' failed
> 
> this happens as in media_art_get_path we pass file = NULL, but in
> media_art_get_file we try to get its parent.
> 
> Attached file solves the problem

Hi, thanks for the patch, I think this has been fixed already:

commit 009ba5f8b4e538500516048c386d37bde852a9bc
Author: Martyn Russell <martyn@lanedo.com>
Date:   Fri Aug 15 11:27:21 2014 +0100

    cache: Make the documentation for media_art_get_path() and _get_file() clearer
    
    Also added some checks into the API and a return value to know if the function
    was successful.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734837
Comment 2 Martyn Russell 2014-09-10 08:58:10 UTC
*** Bug 733304 has been marked as a duplicate of this bug. ***
Comment 3 Martyn Russell 2014-09-10 08:58:45 UTC
*** Bug 731659 has been marked as a duplicate of this bug. ***