Mercurial > audlegacy-plugins
changeset 1528:8fddba1d94e4
xspf: When loading playlist, read title from xml if set
author | Kieran Clancy <clancy.kieran+audacious@gmail.com> |
---|---|
date | Sun, 26 Aug 2007 21:12:45 +0930 |
parents | 8a53b54fc081 |
children | f0cbcd84528e |
files | src/xspf/xspf.c |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xspf/xspf.c Sat Aug 25 20:22:42 2007 -0500 +++ b/src/xspf/xspf.c Sun Aug 26 21:12:45 2007 +0930 @@ -322,6 +322,18 @@ } if(nptr2->type == XML_ELEMENT_NODE + && !xmlStrcmp(nptr2->name, (xmlChar *)"title")) { + Playlist *plist = playlist_get_active(); + xmlChar *title = xmlNodeGetContent(nptr2); + if (title && *title) { + gchar *old = plist->title; + plist->title = g_strdup((gchar*)title); + if(old) g_free(old); + } + xmlFree(title); + } + + if(nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, (xmlChar *)"trackList")) { find_track(nptr2, filename, pos); }