FS#6301 - new tags for WPS and tagcache

Attached to Project: Rockbox
Opened by Robert Kukla (roolku) - Tuesday, 07 November 2006, 14:09 GMT
Last edited by Thomas Martitz (kugel.) - Sunday, 05 June 2011, 11:37 GMT
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Tagcache is great for selecting and ordering tracks according to
specific criteria and has allowed me to (re-)discover the music
in my collection in new and different ways. For example I love
being able to listen to the works of an artist in chronological order.

But for some things I still needed to create off-line playlists using
a number of scripts I wrote which is cumbersome and so I set out to integrate
these features into tagcache. This is the result. Unfortunately it is
impossible to separate the features from each other, as they sometimes
modify the same lines in the source, but I have provided patches for the
different stages (starting with simple changes to more complex) ones.

I don't know if people feel this should go into CVS or not. I have mainly
written it for myself, but if there is interest I can do any required

Anyway. Here it goes:


relative playtime (relplay) is the cumulative actual playtime divided by cumulative
maximum playtime. I prefer the measure to playcount which counts regardless
of how much of a track I have played and score which discards the number of
times a track was played. For example if you play half of a track twice,
these are the values:

playcount = 2
relplay = 100
score = 50

If you play them completely you'll get:

playcount = 2
relplay = 200
score = 100


This adds the comment field from id3 and vorbis tags to WPS (%fC, %FC) and tagcache.
That is where I have stored special version info (live, remix etc)
and it helps me to not have to listen to the same song again and
again in different incarnations.

For example:

"browse" -> genre ? comment !~ "live" & comment !~ "mix" -> artist -> album -> title
"live" -> artist ? comment !~ "live" -> album -> title


I have about 2000 lyrics files of different formats to be used with the
excellent plugin sncviewer:
and it is difficult to remember which tracks have lyrics and which don't.
So this patch creates a WPS tag (use either plain %fl or %?fl<none|txt|snc|lrc|lrc8>)
and a tagcache tag for tracks with lyrics.

For example:

"lyrics" -> lyrics -> genre -> artist -> title
"need timestamps" -> genre ? lyrics = "TXT" -> artist -> title

Similar for album art. The WPS code %fa will indicate if a track has an associated
image file. Since I have a h120, I am only interested in *.jpg files, but it can
be extended to include *.bmp files if so required.

"no album art" -> genre ? albumart = "<Untagged>" -> artist -> title

I use it with patch:


This patch adds the rating (which was replaced by score) back into rockbox as WPS tag %rr
and it can also be used with tagcache:

For example:

%format "fmt_best" "%01 %s" rating title %limit = "100" %sort = "inverse"
"best of" -> genre ? comment !~ "live" & rating > "0" -> title = "fmt_best"


Displaying a rating is not much good if you can't set it, so this patch re-enables the
set rating code that is still included in rockbox.


Personally I find the original settings screen a little clumsy, so I have provided an alternative

To install, pick one of the patches (two for level 4) and patch with -p0 from the root of the rockbox
source tree.

Enjoy. :)
This task depends upon

Closed by  Thomas Martitz (kugel.)
Sunday, 05 June 2011, 11:37 GMT
Reason for closing:  Out of Date
Additional comments about closing:  There doesn't seem to be interest in this anymore. Open a new task if this is wrong.
Comment by Paul Louden (darkkone) - Tuesday, 07 November 2006, 20:23 GMT
So, just to clarify what you're saying: You install 1 OR 2 OR 3 OR (4_rating.patch)+(4_set_rating.patch OR 4_set_rating_alt.patch)?

Each higher number cumulatively includes the prior ones?
Comment by Robert Kukla (roolku) - Tuesday, 07 November 2006, 21:08 GMT
Yes, that's correct.
Comment by Robert Kukla (roolku) - Wednesday, 10 January 2007, 14:47 GMT

lyrics & albumart are now stored as an integer in the database rather than as text. This is computational more efficient, doesn't need the two extra data files but most importantly allows to dynamically update the database. For example when a *.txt lyrics file is synced to a *.lrc file, the wps and database will change to reflect this on the next re-buffer event.

As a disadvantage one needs to specify the numeric value in search conditions. (i.e. 'lyrics = "4"' instead of 'lyrics = "TXT"').


Only useful for targets with RTC (written for my modded h1x0). The patch introduces two new tags: dayssinceplayed and dayssinceadded and can be used in tagnavi_custom.config like for example:

%format "fmt_dsp" "%d %s" dayssinceplayed title

%menu_start "played" "played"
"last n days" -> genre ? dayssinceplayed >= "0" & dayssinceplayed < "" -> artist -> title = "fmt_dsp"
"last week" -> genre ? dayssinceplayed >= "0" & dayssinceplayed < "7" -> artist -> title = "fmt_dsp"
"last month" -> genre ? dayssinceplayed >= "0" & dayssinceplayed < "31" -> artist -> title = "fmt_dsp"
"before last month" -> genre ? dayssinceplayed > "30" -> artist -> title = "fmt_dsp"

Equivalent for dayssinceadded. This should also answer the request in a forum thread which I can't find right now (not much luck with search engines recently) to display recently uploaded tracks (if auto-update is enabled for database).

As usual the higher numbers include the lower numbered patches, but in addition you will need one of the set_rating patches to be able to set the rating.

Comment by Robert Kukla (roolku) - Saturday, 10 February 2007, 16:59 GMT
Synched to current svn (removed code related to comment, as this is in SVN now). Also a few small bug fixes.
Comment by Robert Kukla (roolku) - Monday, 26 February 2007, 18:06 GMT
- removed the RTC related stuff since I wasn't actually using it and the new "entryage" has a similar purpose.
- that leaves: lyrics, albumart, rating and relplay
Comment by Robert Kukla (roolku) - Tuesday, 27 March 2007, 08:52 GMT
Only lyrics, albumart and relplay left now.
Comment by Robert Kukla (roolku) - Saturday, 07 April 2007, 15:24 GMT
adapted to wps tokenizer
Comment by Robert Kukla (roolku) - Sunday, 17 June 2007, 12:03 GMT
synced after metadata.c split
Comment by Robert Kukla (roolku) - Sunday, 05 August 2007, 15:21 GMT
synced after discnumber addition
Comment by Robert Kukla (roolku) - Wednesday, 15 August 2007, 09:41 GMT
synced after changes to get_metadata
Comment by Robert Kukla (roolku) - Tuesday, 06 November 2007, 12:43 GMT