summaryrefslogtreecommitdiff
path: root/plugins/m3u/m3u.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 21:29:03 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 21:29:03 +0100
commit43285f4cb5208234934202f006cdca22d66d35f8 (patch)
tree5662d0b7c851cc5ca8628a82800fbfb41edf0a00 /plugins/m3u/m3u.c
parentaa6defa1369a069e56e432847a2554f7079b047c (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.c6
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);