Index: apps/tagcache.c
===================================================================
RCS file: /cvsroot/rockbox/apps/tagcache.c,v
retrieving revision 1.75
diff -u -r1.75 tagcache.c
--- apps/tagcache.c	24 Oct 2006 17:39:06 -0000	1.75
+++ apps/tagcache.c	28 Oct 2006 20:15:54 -0000
@@ -98,7 +98,7 @@
 
 /* Numeric tags (we can use these tags with conditional clauses). */
 static const int numeric_tags[] = { tag_year, tag_tracknumber, tag_length, tag_bitrate,
-    tag_playcount, tag_playtime, tag_lastplayed, tag_virt_autoscore };
+    tag_playcount, tag_playtime, tag_lastplayed, tag_virt_autoscore, tag_virt_relplay };
 
 static const char *tags_str[] = { "artist", "album", "genre", "title", 
     "filename", "composer", "year", "tracknumber", "bitrate", "length",
@@ -635,6 +635,7 @@
     
     switch (tag) 
     {
+        case tag_virt_relplay:
         case tag_virt_autoscore:
             if (idx->tag_seek[tag_length] == 0 
                 || idx->tag_seek[tag_playcount] == 0)
@@ -644,8 +645,10 @@
             else
             {
                 data = 100 * idx->tag_seek[tag_playtime]
-                    / idx->tag_seek[tag_length]
-                    / idx->tag_seek[tag_playcount];
+                    / idx->tag_seek[tag_length];
+
+                if(tag == tag_virt_autoscore) 
+                    data /= idx->tag_seek[tag_playcount];
             }
             break;
         
Index: apps/tagcache.h
===================================================================
RCS file: /cvsroot/rockbox/apps/tagcache.h,v
retrieving revision 1.29
diff -u -r1.29 tagcache.h
--- apps/tagcache.h	25 Oct 2006 15:14:15 -0000	1.29
+++ apps/tagcache.h	28 Oct 2006 20:15:54 -0000
@@ -26,7 +26,7 @@
     tag_filename, tag_composer, tag_year, tag_tracknumber,
     tag_bitrate, tag_length, tag_playcount, tag_playtime, tag_lastplayed,
     /* Virtual tags */
-    tag_virt_autoscore };
+    tag_virt_autoscore, tag_virt_relplay };
 
 #define TAG_COUNT 13
 
Index: apps/tagtree.c
===================================================================
RCS file: /cvsroot/rockbox/apps/tagtree.c,v
retrieving revision 1.55
diff -u -r1.55 tagtree.c
--- apps/tagtree.c	25 Oct 2006 15:14:15 -0000	1.55
+++ apps/tagtree.c	28 Oct 2006 20:15:54 -0000
@@ -203,6 +203,7 @@
     MATCH(tag, buf, "playcount", tag_playcount);
     MATCH(tag, buf, "lastplayed", tag_lastplayed);
     MATCH(tag, buf, "autoscore", tag_virt_autoscore);
+    MATCH(tag, buf, "relplay", tag_virt_relplay);
     MATCH(tag, buf, "%sort", var_sorttype);
     MATCH(tag, buf, "%limit", var_limit);
     MATCH(tag, buf, "%strip", var_strip);
