[sound-juicer] Fix getting gvfs (CD-Text) metadata



commit 66dea856fcb90de812057df1c97684f72e099fd3
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 24 16:54:19 2009 +0000

    Fix getting gvfs (CD-Text) metadata
    
    '*' in attributes isn't a regexp, we'd either need to pass
    'xattr::*' or each of the interesting tags. Get everything!

 libjuicer/sj-metadata-gvfs.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libjuicer/sj-metadata-gvfs.c b/libjuicer/sj-metadata-gvfs.c
index 7389d7f..73e337d 100644
--- a/libjuicer/sj-metadata-gvfs.c
+++ b/libjuicer/sj-metadata-gvfs.c
@@ -89,7 +89,7 @@ gvfs_list_albums (SjMetadata *metadata, char **url, GError **error)
 
   file = g_file_new_for_uri (priv->uri);
 
-  info = g_file_query_info (file, "xattr::org.gnome.audio",
+  info = g_file_query_info (file, "xattr::*",
   			    G_FILE_QUERY_INFO_NONE, NULL, &my_error);
   if (info == NULL)
     goto bail;
@@ -112,7 +112,7 @@ gvfs_list_albums (SjMetadata *metadata, char **url, GError **error)
   g_object_unref (info);
 
   /* Get tracks metadata */
-  e = g_file_enumerate_children (file, "xattr::org.gnome.audio",
+  e = g_file_enumerate_children (file, "xattr::*",
   				 G_FILE_QUERY_INFO_NONE, NULL, &my_error);
   if (e == NULL)
     goto bail;
@@ -129,8 +129,12 @@ gvfs_list_albums (SjMetadata *metadata, char **url, GError **error)
     if (track->title == NULL)
       track->title = g_strdup_printf (_("Track %d"), i);
     track->artist = g_strdup (g_file_info_get_attribute_string (info, "xattr::org.gnome.audio.artist"));
-    if (track->artist == NULL)
-      track->artist = g_strdup (_("Unknown Artist"));
+    if (track->artist == NULL || track->artist[0] == '\0') {
+      if (album->artist == NULL)
+        track->artist = g_strdup (_("Unknown Artist"));
+      else
+        track->artist = g_strdup (album->artist);
+    }
     track->duration = g_file_info_get_attribute_uint64 (info, "xattr::org.gnome.audio.duration");
     album->number++;
     g_object_unref (info);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]