Mercurial > audlegacy-plugins
diff src/tta/libtta.c @ 1166:4bd7e72a6605 trunk
[svn] - handle metadata in better way.
author | yaz |
---|---|
date | Wed, 06 Jun 2007 22:58:18 -0700 |
parents | 5f3b30860b48 |
children | ed2d7787779e |
line wrap: on
line diff
--- a/src/tta/libtta.c Wed Jun 06 22:34:54 2007 -0700 +++ b/src/tta/libtta.c Wed Jun 06 22:58:18 2007 -0700 @@ -178,12 +178,7 @@ static gchar * get_song_title(TitleInput *tuple) { - gchar *title = xmms_get_titlestring(xmms_get_gentitle_format(), tuple); - if(!title || !strcmp(title, "")) { - g_free(title); - title = g_strdup(tuple->file_name); - } - return title; + return xmms_get_titlestring(xmms_get_gentitle_format(), tuple); } static void @@ -581,13 +576,26 @@ tuple->length = ttainfo->LENGTH * 1000; if (ttainfo->ID3.id3has) { - if(ttainfo->ID3.artist) tuple->performer = g_strdup(ttainfo->ID3.artist); - if(ttainfo->ID3.album) tuple->album_name = g_strdup(ttainfo->ID3.album); - if(ttainfo->ID3.title) tuple->track_name = g_strdup(ttainfo->ID3.title); - if(ttainfo->ID3.year) tuple->year = atoi(ttainfo->ID3.year); - if(ttainfo->ID3.track) tuple->track_number = atoi(ttainfo->ID3.track); - if(ttainfo->ID3.genre) tuple->genre = g_strdup(ttainfo->ID3.genre); - if(ttainfo->ID3.comment) tuple->comment = g_strdup(ttainfo->ID3.comment); + if(ttainfo->ID3.artist && strlen(ttainfo->ID3.artist)) + tuple->performer = g_strdup(ttainfo->ID3.artist); + + if(ttainfo->ID3.album && strlen(ttainfo->ID3.album)) + tuple->album_name = g_strdup(ttainfo->ID3.album); + + if(ttainfo->ID3.title && strlen(ttainfo->ID3.title)) + tuple->track_name = g_strdup(ttainfo->ID3.title); + + if(ttainfo->ID3.year && strlen(ttainfo->ID3.year)) + tuple->year = atoi(ttainfo->ID3.year); + + if(ttainfo->ID3.track && strlen(ttainfo->ID3.track)) + tuple->track_number = atoi(ttainfo->ID3.track); + + if(ttainfo->ID3.genre && strlen(ttainfo->ID3.genre)) + tuple->genre = g_strdup(ttainfo->ID3.genre); + + if(ttainfo->ID3.comment && strlen(ttainfo->ID3.comment)) + tuple->comment = g_strdup(ttainfo->ID3.comment); } close_tta_file (ttainfo); }