FS#8008 - use artist/album from currently playing track to search Database

Attached to Project: Rockbox
Opened by Robert Kukla (roolku) - Sunday, 21 October 2007, 11:30 GMT
Last edited by Robert Kukla (roolku) - Tuesday, 30 October 2007, 10:07 GMT
Task Type Patches
Category Database
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This was inspired by a forum thread (can't find it now, but the OP asked to play all tracks from the currently playing album at the press of a button IIRC).

While I liked the idea (I often listen to tracks at random and come across a track that I wish to hear in the context of the whole album) the access to the functionality is not generic enough and too limiting (available spare buttons etc).

Instead the presented solution allows the use of two place holders (#album# #artist#) in conditional clauses in the tagnavi*.config. Similar to user input, where the user can enter arbitrary values at runtime, it takes the text string to use in the clause from the currently playing track. If no tack is playing or the relevant tag is empty/does not exist, it will prompt for user input.

This gives the full power of the database to the formatting and sorting of the track listing. As with all database results the tracks can be inserted, queued, inserted randomly etc.

Entries in the tagnavi*.config can look like for example

%menu_start "same" "Same as current"
"Artist" -> artist ? artist = "#artist#" -> album -> title = fmt_title"
"Album" -> album ? album = "#album#" -> title = "fmt_title"

but more sophisticated searches are possible. It would be easy to extent the patch to other tags, but I can't see a use (perhaps #title# to find all cover versions?).
This task depends upon

Closed by  Robert Kukla (roolku)
Tuesday, 30 October 2007, 10:07 GMT
Reason for closing:  Accepted
Additional comments about closing:  committed
Comment by Robert Kukla (roolku) - Sunday, 21 October 2007, 16:28 GMT
Small tweak to tagnavi.config to remove extra menu level.
Comment by Robert Kukla (roolku) - Tuesday, 30 October 2007, 01:32 GMT
- reserve buffer for search_string dynamically, so one can have more than one runtime search clause
- merge the "user prompt" and "#directory#" as special cases of "runtime" into the search mapping
- small optimisation
- don't prompt (proved to be irritating) if tags are missing, but use empty string for empty result instead
- in tagnavi.config:
* use "start-with" directory rather than "contains" (note: the implementation will also include subdirs)
* check for albumartist in addition to album to avoid getting same album name from different artist
* add searches for title & composer