<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,6 +34,7 @@
 #include &quot;xmlrpc.h&quot;
 #include &quot;recommend.h&quot;
 #include &quot;util.h&quot;
+#include &quot;tag.h&quot;
 
 #include &quot;globals.h&quot;
 
@@ -322,76 +323,111 @@ const char * meta(const char * fmt, int flags, struct hash * track) {
 				string[length++] = fmt[x++];
 			}
 			else {
-				const char * keys [] = {
-					&quot;acreator&quot;,
-					&quot;ttitle&quot;,
-					&quot;lalbum&quot;,
-					&quot;Aartistpage&quot;,
-					&quot;Ttrackpage&quot;,
-					&quot;Lalbumpage&quot;,
-					&quot;dduration&quot;,
-					&quot;sstation&quot;,
-					&quot;SstationURL&quot;,
-					&quot;Rremain&quot;,
-					&quot;Iimage&quot;
-				};
-
-				register unsigned i = sizeof(keys) / sizeof(char *);
-
-				/* Look for a track value with that format flag. */
-				while(i--) {
-					if(fmt[x] == keys[i][0]) {
-						char * val = strdup(value(track, keys[i] + 1));
-						const char * color = NULL;
-
-						if(flags &amp; M_COLORED) {
-							char colorkey[64] = { 0 };
-							snprintf(colorkey, sizeof(colorkey), &quot;%c-color&quot;, keys[i][0]);
-							color = value(&amp; rc, colorkey);
-
-							if(color) {
-								/* Strip leading spaces from end of color (Author: Ondrej Novy) */
-								char * color_st = strdup(color);
-								size_t len = strlen(color_st) - 1;
-
-								assert(color_st != NULL);
-
-								while(isspace(color_st[len]) &amp;&amp; len &gt; 0) {
-									color_st[len] = 0;
-									len--;
-								}
-								length += snprintf(string + length, remn, &quot;\x1B[%sm&quot;, color_st);
-								free(color_st);
-							}
-						}
-
-						if((flags &amp; M_RELAXPATH) &amp;&amp; val) {
-							unsigned n;
-							size_t l = strlen(val);
+				char * val = NULL;
+				const char * trackKey = NULL;
+				char taggingItem = 0;
+				const char * color = NULL;
+
+				switch(fmt[x]) {
+					case 'a':
+						trackKey = &quot;creator&quot;;
+						break;
+					case 't':
+						trackKey = &quot;title&quot;;
+						break;
+					case 'l':
+						trackKey = &quot;album&quot;;
+						break;
+					case 'A':
+						trackKey = &quot;artistpage&quot;;
+						break;
+					case 'T':
+						trackKey = &quot;trackpage&quot;;
+						break;
+					case 'L':
+						trackKey = &quot;albumpage&quot;;
+						break;
+					case 'd':
+						trackKey = &quot;duration&quot;;
+						break;
+					case 's':
+						trackKey = &quot;station&quot;;
+						break;
+					case 'S':
+						trackKey = &quot;stationURL&quot;;
+						break;
+					case 'R':
+						trackKey = &quot;remain&quot;;
+						break;
+					case 'I':
+						trackKey = &quot;image&quot;;
+						break;
+					case 'Z':
+						// artist tags
+						taggingItem = 'a';
+						break;
+					case 'D':
+						// album tags
+						taggingItem = 'l';
+						break;
+					case 'z':
+						// track tags
+						taggingItem = 't';
+						break;
+				}
+				if(trackKey) {
+					val = strdup(value(track, trackKey));
+				} else if(taggingItem) {
+					val = oldtags(taggingItem, * track);
+					if(!val) {
+						val = strdup(&quot;&quot;);
+					}
+				}
 
-							for(n = 0; n &lt; l; ++n) {
-								if(val[n] == '/')
-									val[n] = '|';
-							}
-						}
+				if(flags &amp; M_COLORED) {
+					char colorkey[64] = { 0 };
+					snprintf(colorkey, sizeof(colorkey), &quot;%c-color&quot;, fmt[x]);
+					color = value(&amp; rc, colorkey);
 
-						if(flags &amp; M_SHELLESC) {
-							char * escaped = shellescape(val);
-							free(val);
-							val = escaped;
-						}
+					if(color) {
+						/* Strip leading spaces from end of color (Author: Ondrej Novy) */
+						char * color_st = strdup(color);
+						size_t len = strlen(color_st) - 1;
 
-						length = strlen(strncat(string, val ? val : &quot;(unknown)&quot;, remn));
+						assert(color_st != NULL);
 
-						free(val);
+						while(isspace(color_st[len]) &amp;&amp; len &gt; 0) {
+							color_st[len] = 0;
+							len--;
+						}
+						length += snprintf(string + length, remn, &quot;\x1B[%sm&quot;, color_st);
+						free(color_st);
+					}
+				}
 
-						if(color)
-							length = strlen(strncat(string, &quot;\x1B[0m&quot;, remn));
+				if((flags &amp; M_RELAXPATH) &amp;&amp; val) {
+					unsigned n;
+					size_t l = strlen(val);
 
-						break;
+					for(n = 0; n &lt; l; ++n) {
+						if(val[n] == '/')
+							val[n] = '|';
 					}
 				}
 
+				if(flags &amp; M_SHELLESC) {
+					char * escaped = shellescape(val);
+					free(val);
+					val = escaped;
+				}
+
+				length = strlen(strncat(string, val ? val : &quot;(unknown)&quot;, remn));
+
+				free(val);
+
+				if(color)
+					length = strlen(strncat(string, &quot;\x1B[0m&quot;, remn));
+
 				++x;
 			}
 		}</diff>
      <filename>source/interface.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bafea74c0395db9888a77fbe20198eb143670c01</id>
    </parent>
  </parents>
  <author>
    <name>Jan Zerebecki</name>
    <email>jan.foss@zerebecki.de</email>
  </author>
  <url>http://github.com/jkramer/shell-fm/commit/5eb4571cb8f9e86a7183f69171c54f8dbb51e93d</url>
  <id>5eb4571cb8f9e86a7183f69171c54f8dbb51e93d</id>
  <committed-date>2009-11-07T04:54:30-08:00</committed-date>
  <authored-date>2009-11-07T02:53:02-08:00</authored-date>
  <message>Support tags in the status format.</message>
  <tree>f408b54e58dbddd80711d21b3f6fbd1bda473fec</tree>
  <committer>
    <name>Jonas Kramer</name>
    <email>jkramer@nex.scrapping.cc</email>
  </committer>
</commit>
