GNOME Bugzilla – Bug 701427
Use filename when title is not available
Last modified: 2013-07-16 10:20:55 UTC
Actually, this one currently half-works: the songs view uses the filename if the track has no title, but doesn't properly escape them, while the albums view will cause a segmentation fault if there is no title. The toolbar uses the filename too, but seems to use code that looks like Vala. Unfortunately, the function for unescaping URI's in GLib is not properly annotated there. I created a bug report for that, but after closing that one we need to wait more for gobject-introspection to update its own copy of the annotations from glib git before the patches could be applied.
In artists view, here's the error: (gnome-music:19835): Gtk-WARNING **: gtkliststore.c:851: Unable to convert from gpointer to gchararray Comment for future reference...
Created attachment 245854 [details] [review] Patch Contains everything. Patch dependent on bgo #700443;
Review of attachment 245854 [details] [review]: Please rebase ontop of master
Created attachment 248306 [details] [review] Use filename of tracks as title if not available
Review of attachment 248306 [details] [review]: ::: src/albumArtCache.js @@ +43,3 @@ + let uri = media.get_url(); + if (!uri) + return "Untitled"; Not sure if this gets translated, maybe _("Untitled") would be berter ::: src/widgets.js @@ +421,3 @@ let songWidget = song.songWidget; + let title = AlbumArtCache.getMediaTitle(song); + let escapedTitle = GLib.markup_escape_text(title, -1); I'd suggest modifying getMediaTitle to pass bool param there, which will return escaped version: getMediaTitle(title, escaped=false)
Created attachment 248368 [details] [review] Use filename of tracks as title if not available
Thanks for reviewing it! (In reply to comment #6) > Review of attachment 248306 [details] [review]: > > ::: src/albumArtCache.js > @@ +43,3 @@ > + let uri = media.get_url(); > + if (!uri) > + return "Untitled"; > > Not sure if this gets translated, maybe _("Untitled") would be berter > Fixed. > ::: src/widgets.js > @@ +421,3 @@ > let songWidget = song.songWidget; > + let title = AlbumArtCache.getMediaTitle(song); > + let escapedTitle = GLib.markup_escape_text(title, -1); > > I'd suggest modifying getMediaTitle to pass bool param there, which will return > escaped version: > getMediaTitle(title, escaped=false) Fixed. Changed some of the callers to use escaped parameter.
Created attachment 248913 [details] [review] Use filename of tracks as title if not available
The following fix has been pushed: fd17bfa Use filename of tracks as title if not available
Created attachment 249263 [details] [review] Use filename of tracks as title if not available