diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-14 21:29:03 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-11-14 21:29:03 +0100 |
commit | 43285f4cb5208234934202f006cdca22d66d35f8 (patch) | |
tree | 5662d0b7c851cc5ca8628a82800fbfb41edf0a00 /plugins/m3u/m3u.c | |
parent | aa6defa1369a069e56e432847a2554f7079b047c (diff) |
m3u: don't write artist/title to M3UEXT if the tag doesn't have the appropriate field(s)
Diffstat (limited to 'plugins/m3u/m3u.c')
-rw-r--r-- | plugins/m3u/m3u.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 703c7486..3b0988c3 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -499,10 +499,12 @@ m3uplug_save_m3u (const char *fname, DB_playItem_t *first, DB_playItem_t *last) } int dur = (int)floor(deadbeef->pl_get_item_duration (it)); char s[1000]; - if (deadbeef->pl_meta_exists (it, "artist")) { + int has_artist = deadbeef->pl_meta_exists (it, "artist"); + int has_title = deadbeef->pl_meta_exists (it, "title"); + if (has_artist && has_title) { deadbeef->pl_format_title (it, -1, s, sizeof (s), -1, "%a - %t"); } - else { + else if (has_title) { deadbeef->pl_format_title (it, -1, s, sizeof (s), -1, "%t"); } fprintf (fp, "#EXTINF:%d,%s\n", dur, s); |