FS#9053 - Using Volume Labels as Mount Points

Attached to Project: Rockbox
Opened by Reinhard Enders (rhtm52) - Friday, 30 May 2008, 06:40 GMT
Task Type Patches
Category Operating System/Drivers
Status Unconfirmed
Assigned To No-one
Operating System Sansa e200
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


I'm using several SD-cards with my Sansa. When switching cards
and updating the database the db entries of other cards are lost
(unless saved to the database log).

In order to differentiate between files from different cards the
easiest way is to give them different path names. So instead of
mounting each card to <microSD1> this patch takes the volume label
i.e. 'Classic1' of the filesystem and mounts it to <Classic1>.

The database update is modified in a way that it erases only entries
for files with a filename of a mounted filesystem. So data of other
cards isn't erased.

So far the database search isn't modified to handle nonexisting files,
you still get albums etc. which are currently unavailable.
The patch only makes sure that nonexisting files aren't entered into
the current playlist.

The patch is only activated for Sansa e200, as I couldn't test it for
other players.

This task depends upon

Comment by Reinhard Enders (rhtm52) - Friday, 30 May 2008, 07:45 GMT
the following patch corrects one error
Comment by Reinhard Enders (rhtm52) - Monday, 02 June 2008, 15:11 GMT
Added the condition 'filename is "mounted"' to the database
code and modified tagnavi.config accordingly.
Now when swapping SD-cards the database immediately shows the
current content.
Comment by Jonathan Gordon (jdgordon) - Tuesday, 03 June 2008, 10:34 GMT
NICE! one thing though, can it be made to always make sure the file is mounted if the path starts with "/<" instead of needing to add stuff to the tagnavi.config? I cant see any reason why you would ever want to see files which dont exist

edit: one more thing... can you change it to use the cards serial number (from the ata identify struct) to determine if its mounted instead of the volume name?
Comment by Reinhard Enders (rhtm52) - Tuesday, 03 June 2008, 16:18 GMT
I totally agree!
But the code is still very experimental.
As I don't know the tagtree search code, the modification seemed
to be the easiest and probably least destructive one.
If any one knows the code, it would be probably not too difficult to
add the 'mounted' test at the appropriate locations.

I took the volume name basically because I can easily modify it
and it looks nicer than numbers.
Comment by Reinhard Enders (rhtm52) - Wednesday, 04 June 2008, 11:53 GMT
Integrated the 'mounted' test into the search algorithm.
Now tagnavi.config doesn't need to be modified.
Comment by Jonathan Gordon (jdgordon) - Sunday, 06 June 2010, 12:28 GMT
synced, but doesnt work...