• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Database
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by sideral - 2011-05-28
Last edited by sideral - 2011-08-04

FS#12132 - tagnavi: Support "basename" in formats and conditions; replace <Untagged> in track views

This patch set (in patch 0006) adds support to the tagnavi.config syntax for using a file’s basename (path name without directories) in display formats and conditions.

Patch 0007 changes the database’s default title format to display a file’s basename rather than “<Untagged>” if no title tag is present in the file.

In passing, patch 0001 fixes two bugs introduced with r26192 ( FS#10976  - make the <Untagged> string translatable):

* The translation was done too early: before the tagnavi format clauses were checked. This prevented comparisons against “<Untagged>” when a non-English translation was active.
* The code overwrote the buffer containing the constant string “<Untagged>” with the translation. This is neither safe nor necessary: The result pointer simply can be swapped with a pointer to the translation.

Patches 0002–0005 contain various minor DB cleanups the other patches rely on. (I’ll commit the fixes and cleanups separately from the basename feature after some testing.)

Patches relative to r29928.

Closed by  sideral
2011-08-04 12:38
Reason for closing:  Accepted
MikeS commented on 2011-06-01 02:00

All your basename are belong to us.

I appreciate you taking on the basname/untagged issue (well, one of my peeves as it were).

Committed the untagged-translation fix (patch 0001) as r29941.

Updated patch 0006: Added support for “%{width}.{truncation}s” in tagnavi %formats. String truncation is especially useful when using part of a string tag, filename, or basename for sorting and %strip’ing.

Also renovated the format_str() code a bit (improved structuring, removed code duplication) and increased the maximum length of a printf conversion specification to 20 characters.

Rebased patch to r29975 (required because of r29937 /  FS#12136 ).

Committed patches 0002–0005 as r29978–r29981.

Updated patch 0007 to also provides a sane default format for Database→Tracks.

Committed patches 6 and 7 as r30229–r30231.

The binsize increase struck me as a bit large, so I went and optimized it a bit – see attached patch. Also reduces stack usage quite a bit.

Committed patch 8 as r30248. Sadly, it didn’t yield the binsize decrease I’d envisioned across the board, but I think the stack-usage decrease was worth it, as was the buffer-bounds check fix.


Available keyboard shortcuts


Task Details

Task Editing