Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: Lope on October 04, 2010, 12:42:49 PM

Title: Delete Empty Root Folders Plugin
Post by: Lope on October 04, 2010, 12:42:49 PM
My Sansa Clip+ makes all these empty folders on internal&external storage everytime I boot OF, which is necessary very regularly on Clip+ at this stage of RB Clip+ development.

I would love an autorun option.
Disktidy is too slow and overcomplicated.

PROCEDURE:
Recursive {
Enumerate Folders
If folder contains no files, enumerate subfolders, if folder empty:delete.
}

I get these empty folders every time OF boots

Internal Memory:
##MUSIC#
##MUSIC#\Audiobooks
##MUSIC#\Music
##MUSIC#\Playlists
##MUSIC#\Podcasts
##MUSIC#\Service
##MUSIC#\Service\Rhapsody
##MUSIC#\Service\Rhapsody\Artist
##MUSIC#\Service\Rhapsody\Playlists
##MUSIC#\Service\Rhapsody\radiopc
##PORT#
AUDIBLE
AUDIOBOOKS
MUSIC
Playlists
PODCASTS
RECORD
RECORD\FM
RECORD\VOICE

External Memory:
MUSIC
MUSIC\AUDIOBOOKS
MUSIC\PODCASTS

Its a big problem on Clip+ because Clip+ RB has no USB support, requiring OF boot everytime you want to load music or work as a storage device.
Also, every time I plug power or USB, forgetting to boot RB first, it boots OF making all these folders.
Such a mission deleting it all every time. Esp while driving etc.
I use the MUSIC folders but none of the other folders or default subfolders.
Title: Re: Delete Empty Root Folders Plugin
Post by: Artursk on October 14, 2010, 01:59:24 PM
+

The same problem  :)
Title: Re: Delete Empty Root Folders Plugin
Post by: BdN3504 on October 14, 2010, 04:15:06 PM
See if you can use this:
http://download.rockbox.org/daily/manual/rockbox-sansaclipplus/rockbox-buildch11.html#x14-27600011.4.7
Title: Re: Delete Empty Root Folders Plugin
Post by: Chronon on October 14, 2010, 08:47:37 PM
You should be able to configure the Disk Tidy plugin.  See if you can modify  /.rockbox/rocks/apps/disktidy.config.

(Ah, that's what was linked in the previous comment.)
Title: Re: Delete Empty Root Folders Plugin
Post by: pabouk on October 15, 2010, 12:21:17 PM
Plugin autorun at Rockbox start would be great.
Title: Re: Delete Empty Root Folders Plugin
Post by: mc2739 on October 15, 2010, 05:45:22 PM
Plugin autorun at Rockbox start would be great.

There is  a method to autorun a plugin at startup, but you would need to set up a build environment, modify the source code and compile your modified build.
Title: Re: Delete Empty Root Folders Plugin
Post by: Llorean on October 15, 2010, 06:54:37 PM
Just as a note, it's a very, very trivial change if I recall correctly.
Title: Re: Delete Empty Root Folders Plugin
Post by: Lope on October 19, 2010, 11:40:45 AM
It would be nice to just have an option.
Because its just a few root folders. No need to scan the EVERY folder and file on internal and external storage doing ALL the checks that disktidy does, which will increase boot time a lot.
Just a little setting "delete empty root folders" would be awesome ;)

Edited first post, see complete folder list.
Title: Re: Delete Empty Root Folders Plugin
Post by: torne on October 19, 2010, 02:47:34 PM
We don't generally add features to work around the behaviour of the original firmware if it doesn't otherwise impact Rockbox. This problem will be much less of an issue once Rockbox supports USB.

Instead of deleting the folders, mark them as hidden. This will make them no longer display in Rockbox (unless you set shown file types to All).
Title: Re: Delete Empty Root Folders Plugin
Post by: Lope on October 20, 2010, 01:56:30 PM
Thanks torne. I've most of the folders hidden, now they don't display in RB.
The ##PORT# and ##MUSIC# folders don't appear in the mounted FAT32 volume in windows.
I tried creating them and making them hidden, but the OF still somehow makes these folders, which then display in RB.
If I plug the player in again, I see my hidden ##PORT# and ##MUSIC# folders, still hidden, with no subdirs. Weird.
At least its better.
I can delete them in RB and they don't return till I boot OF.

Where is the OF stored now? Any idea where these ##MUSIC# and ##PORT# folders are?
Title: Re: Delete Empty Root Folders Plugin
Post by: torne on October 20, 2010, 03:56:07 PM
Those folders are some kind of weird magic and they get hidden in a strange way when connected over USB, if I recall correctly, so no, I don't think you'll be able to hide them in the same way. The OF never exposes everything on the player: when it's in MTP mode it only exposes the MTP-specific parts, and when it's in MSC mode it exposes everything *except* the MTP-specific parts (to stop you messing around with stuff you synced via MTP). They're always empty because you aren't using MTP.

Again, the real fix in the long term is for Rockbox USB to be enabled so you don't have to boot the original firmware in the first place. This will happen when the bugs are worked out. :)
Title: Re: Delete Empty Root Folders Plugin
Post by: grums on February 22, 2011, 03:30:59 AM
Quote: 'Just as a note, it's a very, very trivial change if I recall correctly.' - can you hint me to where?

I want to autostart a tidy up of the above files in my Clip+ on reboot - until the proper USB support is there.

Thanks, Ole
Title: Re: Delete Empty Root Folders Plugin
Post by: torne on February 22, 2011, 05:34:14 AM
Search for autorock in the source.
Title: Re: Delete Empty Root Folders Plugin
Post by: grums on February 23, 2011, 08:27:50 AM
Thanks, that gave me something to work with...
After enabling autostart in the code & rebuild, I get this message:

ubuntu@ubuntu-desktop:~/rockbox$ failed to load /.rockbox/rocks/apps/autostart.rock
lc_open(/.rockbox/rocks/apps/autostart.rock): simdisk/.rockbox/rocks/apps/autostart.rock: file too short


In the file I have one line: disktidy.rock - the file is edited on the ubuntu system using vi.

How can the file be too short?

Ole


Post Merge: February 23, 2011, 09:18:37 AM
- forgot yo say that I'm still running the simulator...
Title: Re: Delete Empty Root Folders Plugin
Post by: torne on February 23, 2011, 10:06:44 AM
autorock.rock needs to be *the actual plugin* you want to load, not just contain the name. You need to copy and rename the file.