• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by roolku - 2006-11-07
Last edited by kugel. - 2011-06-05

FS#6301 - new tags for WPS and tagcache

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. :)

Closed by  kugel.
2011-06-05 11:37
Reason for closing:  Out of Date
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

There doesn't seem to be interest in this anymore. Open a new task if this is wrong.

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?

Yes, that's correct.


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.

Synched to current svn (removed code related to comment, as this is in SVN now). Also a few small bug fixes.

- 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

Only lyrics, albumart and relplay left now.

adapted to wps tokenizer

synced after metadata.c split

synced after discnumber addition

synced after changes to get_metadata


Available keyboard shortcuts


Task Details

Task Editing