From 17f21ea4b79a83e449f626dd6bab2c3a4d946198 Mon Sep 17 00:00:00 2001 From: waker Date: Tue, 4 Jan 2011 20:59:29 +0100 Subject: added %@PROPERTY_NAME@ conversions to pl_format_title --- playlist.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'playlist.c') diff --git a/playlist.c b/playlist.c index efd72595..325332f4 100644 --- a/playlist.c +++ b/playlist.c @@ -2677,9 +2677,28 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, if (*fmt == 0) { break; } - else if (!it && !strchr ("V", *fmt)) { + else if (!it && *fmt != 'V') { // only %V (version) works without track pointer } + else if (*fmt == '@') { + const char *e = fmt; + e++; + while (*e && *e != '@') { + e++; + } + if (*e == '@') { + char nm[100]; + int l = e-fmt-1; + l = min (l, sizeof (nm)-1); + strncpy (nm, fmt+1, l); + nm[l] = 0; + meta = pl_find_meta (it, nm); + if (!meta) { + meta = ""; + } + fmt = e; + } + } else if (*fmt == 'a') { meta = pl_find_meta (it, "artist"); if (!meta) { -- cgit v1.2.3