diff options
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -2913,9 +2913,22 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, } else if (*fmt == 'a') { meta = pl_find_meta_raw (it, "artist"); - if (!meta) { + const char *custom = pl_find_meta_raw (it, "DDB:CUSTOM_TITLE"); + if (!meta && !custom) { meta = "Unknown artist"; } + + if (custom) { + if (!meta) { + meta = custom; + } + else { + int l = strlen (custom) + strlen (meta) + 4; + char *out = alloca (l); + snprintf (out, l, "[%s] %s", custom, meta); + meta = out; + } + } } else if (*fmt == 't') { meta = pl_find_meta_raw (it, "title"); @@ -2963,6 +2976,19 @@ pl_format_title_int (const char *escape_chars, playItem_t *it, int idx, char *s, } } } + + const char *custom = pl_find_meta_raw (it, "DDB:CUSTOM_TITLE"); + if (custom) { + if (!meta) { + meta = custom; + } + else { + int l = strlen (custom) + strlen (meta) + 4; + char *out = alloca (l); + snprintf (out, l, "[%s] %s", custom, meta); + meta = out; + } + } } else if (*fmt == 'C') { meta = pl_find_meta_raw (it, "composer"); |