summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1495e7b)
raw | patch | inline | side by side (parent: 1495e7b)
author | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 17:40:39 +0000 (19:40 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 17:40:39 +0000 (19:40 +0200) |
Use mpd_song_get_tag(). This guarantees that the tags are encoded in
UTF-8.
UTF-8.
src/screen_lyrics.c | patch | blob | history |
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 62d5b13c6d64c9ddda8a3c1958885c9604cd5904..054ac6281df2c5dbaa5fca794d77bbdb4a27aab8 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
#include "mpdclient.h"
#include "command.h"
#include "screen.h"
-#include "strfsong.h"
#include "lyrics.h"
#include "screen_text.h"
static void
screen_lyrics_load(const struct mpd_song *song)
{
- char buffer[MAX_SONGNAME_LENGTH];
+ const char *artist, *title;
assert(song != NULL);
screen_lyrics_abort();
screen_text_clear(&text);
- current.song = mpd_song_dup(song);
-
- strfsong(buffer, sizeof(buffer), "%artist%", song);
- current.artist = g_strdup(buffer);
+ artist = mpd_song_get_tag(song, MPD_TAG_ARTIST, 0);
+ title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0);
- strfsong(buffer, sizeof(buffer), "%title%", song);
- current.title = g_strdup(buffer);
+ current.song = mpd_song_dup(song);
+ current.artist = g_strdup(artist);
+ current.title = g_strdup(title);
current.loader = lyrics_load(current.artist, current.title,
screen_lyrics_callback, NULL);