diff options
author | waker <wakeroid@gmail.com> | 2011-01-04 20:59:29 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-01-04 21:00:27 +0100 |
commit | 17f21ea4b79a83e449f626dd6bab2c3a4d946198 (patch) | |
tree | ab08f40c36094d737e9c66ab8901d28a2000f67e /playlist.c | |
parent | 2b1ca23ad9bdeb36747aabc44cafa1d8eca77a1e (diff) |
added %@PROPERTY_NAME@ conversions to pl_format_title
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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 = "<INVALID CONVERSION>"; + } + fmt = e; + } + } else if (*fmt == 'a') { meta = pl_find_meta (it, "artist"); if (!meta) { |