aboutsummaryrefslogtreecommitdiffstats
path: root/src/strfsong.c
diff options
context:
space:
mode:
authorAndreas Obergrusberger <tradiaz@yahoo.de>2006-10-05 18:19:46 +0000
committerAndreas Obergrusberger <tradiaz@yahoo.de>2006-10-05 18:19:46 +0000
commitbff18fcc0031584a43b271eba7bd6d538a1028c9 (patch)
treec61a47253e42f93f11669b44e2a9d7a53b042921 /src/strfsong.c
parent2373f8189ff927dd472f3fd0bf2741ac631a3440 (diff)
downloadmpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.tar.gz
mpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.tar.xz
mpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.zip
you can specify %shortalbum% for playlist song markup, parent directory is shown in the browse screen title
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4871 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/strfsong.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/strfsong.c b/src/strfsong.c
index 3f60875ea..287fcbdce 100644
--- a/src/strfsong.c
+++ b/src/strfsong.c
@@ -170,6 +170,22 @@ _strfsong(gchar *s,
temp = song->title ? utf8_to_locale(song->title) : NULL;
else if (strncmp("%album%", p, n) == 0)
temp = song->album ? utf8_to_locale(song->album) : NULL;
+ else if (strncmp("%shortalbum%", p, n) == 0)
+ {
+ temp = song->album ? utf8_to_locale(song->album) : NULL;
+ if (temp)
+ {
+ gchar *temp2 = g_strndup(temp, 25);
+ if (strlen(temp) > 25)
+ {
+ temp2[24] = '.';
+ temp2[23] = '.';
+ temp2[22] = '.';
+ }
+ g_free(temp);
+ temp = temp2;
+ }
+ }
else if (strncmp("%track%", p, n) == 0)
temp = song->track ? utf8_to_locale(song->track) : NULL;
else if (strncmp("%name%", p, n) == 0)