[Xfce4-commits] [apps/parole] 01/01: Show the filename if no ID3 is available

noreply at xfce.org noreply at xfce.org
Mon Jan 11 04:53:19 CET 2016


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository apps/parole.

commit cddb72a9e7a2ae7c2d892f34b9534458208f5123
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Jan 10 22:53:13 2016 -0500

    Show the filename if no ID3 is available
---
 src/parole-player.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/parole-player.c b/src/parole-player.c
index db1750b..102971b 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -1842,6 +1842,9 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
     gchar *album;
     gchar *artist;
     gchar *year;
+    gchar *uri;
+    gchar *filename;
+    gchar *decoded;
     GdkPixbuf *image = NULL;
 
     if ( player->priv->row )
@@ -1851,6 +1854,7 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
                       "album", &album,
                       "artist", &artist,
                       "year", &year,
+                      "uri", &uri,
                       NULL);
 
         if ( title )
@@ -1861,7 +1865,15 @@ parole_player_media_tag_cb (ParoleGst *gst, const ParoleStream *stream, ParolePl
             g_free (title);
         }
         else
-            gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title), g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>", _("Unknown Song")));
+        {
+            /* No ID3, no problem! Show the filename instead */
+            decoded = g_filename_from_uri(uri, NULL, NULL);
+            filename = g_path_get_basename(decoded);
+            gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title), g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>", filename));
+            g_free (filename);
+            g_free (decoded);
+        }
+        g_free(uri);
 
         if ( album )
         {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list