Deleting Empty Folders (yeah, I know, I know...)
Deleting Empty Folders (yeah, I know, I know...)
Apparently whenever someone mentions they're having troubles with leftover empty folders (after deleting/moving albums) there ensues a litany of the usual "Are you sure they're really empty?" to the obvious "Tick Delete This-folder/Delete That-folder Box", or my personal favourite "Didn't they fix that? I haven't had that problem since they shot General Anwar Sadat."
Ok, let's just say I'm not having this problem. Really, don't worry about it. Oh look, pretty birds. (Distraction technique.)
Now, were someone to offer me directions to a script that would happily "Clean" my library of all empty folders (or even 'nearly' empty folders with only album-art remaining) I would leave the gun and take the cannoli, as it were. No questions asked, no thanks given (so men can men, and unknown tough guys can ride into sunsets anew).
I think this would be a nice solution to a most notorious problem that doesn't really exist.
Nothing fancy, just a recursive snooper nip and tuck for \Music\
Cheers.
Ok, let's just say I'm not having this problem. Really, don't worry about it. Oh look, pretty birds. (Distraction technique.)
Now, were someone to offer me directions to a script that would happily "Clean" my library of all empty folders (or even 'nearly' empty folders with only album-art remaining) I would leave the gun and take the cannoli, as it were. No questions asked, no thanks given (so men can men, and unknown tough guys can ride into sunsets anew).
I think this would be a nice solution to a most notorious problem that doesn't really exist.
Nothing fancy, just a recursive snooper nip and tuck for \Music\
Cheers.
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
backup tracks has some code to delete empty directories which should be easy enough to extract and modify
as for "nearly" empty directories its a tad more difficult but I might give it a go in a week or 2.
as for "nearly" empty directories its a tad more difficult but I might give it a go in a week or 2.
-
- Posts: 48
- Joined: Mon Jan 07, 2008 2:06 pm
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Couple of points...
1) A progress bar would be lovely!
2) It is marking any folder which does not contain files, but which does contain a folder which contains files, as "nearly empty". These are not nearly empty, it just means I don't have any non-album tracks by this artist.
Nice script though!
1) A progress bar would be lovely!
2) It is marking any folder which does not contain files, but which does contain a folder which contains files, as "nearly empty". These are not nearly empty, it just means I don't have any non-album tracks by this artist.
Nice script though!
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
New I forgot something.
Nearly Empty Folders must have at least 1 file in them
If they only have folders it does nothing.
But I think there might be a problem / error if you have this situation
C:\My Music\aaa
C:\My Music\aaa\bbb.jpg
C:\My Music\aaa\ccc
C:\My Music\aaa\ccc\ddd.mp3
Folder C:\My Music\aaa will be seen as a Nearly Empty Folder
But I don't think it can be deleted because of C:\My Music\aaa\ccc is still there
Can't check it till tomorrow now though
Nearly Empty Folders must have at least 1 file in them
If they only have folders it does nothing.
But I think there might be a problem / error if you have this situation
C:\My Music\aaa
C:\My Music\aaa\bbb.jpg
C:\My Music\aaa\ccc
C:\My Music\aaa\ccc\ddd.mp3
Folder C:\My Music\aaa will be seen as a Nearly Empty Folder
But I don't think it can be deleted because of C:\My Music\aaa\ccc is still there
Can't check it till tomorrow now though
-
- Posts: 11
- Joined: Wed May 21, 2008 9:05 pm
whenever i try to run the script i get error message #76. i dont know what's wrong, i copied the script and added the necessary things to the scripts.ini file and i created the folder the script says to create. btw it's line 29 column 2 and it says that the path can not be found...
do i need to change the D:\My Music to my drive letter?
do i need to change the D:\My Music to my drive letter?
Yes, your driver letter, and music folder (say, in Vista "C:\Users\...\Music", in lieu of "\My Music").Retribution wrote:do i need to change the D:\My Music to my drive letter?
Be aware there's no message as to when the script is done, so just wait a bit and check your NearlyEmptyCrap folder for the log.
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
-
- Posts: 11
- Joined: Wed May 21, 2008 9:05 pm
MoDementia wrote:Updated the code a little.
Progress bar and the tricky Nearly Empty scenario.
@Retribution
Unless you can read and understand this script enough to make it work for you specific requirements DON'T USE IT.
Yes you need to change lines 26, 27 and 62 to suit.
while i dont understand the script, i have a pretty good knowledge of computers. obviously i had an idea on what needed to be done by asking if i needed to change the drive letter. you could've just helped me instead of being an ***
You've gotta love how Aussies live in the future. Your "tomorrow" is still my today. Convenient, that. Lotto numbers next, please.MoDementia wrote:And a Finished message
While we're on the subject of silly little suggestions, perhaps some sort of line-by-line "Kill Folder <x> Yes/No" might be nice, for semi-automation, but I understand why that part's not developed just yet.
I would play with these things myself, but I never learned VB... it hadn't been invented yet, so I learned C, Pascal and even Ada (:o) instead. Take me a little while to adjust, but the "gist" is clear. Did have a slight bit of difficulty getting 'Call MoveDeleteFolders(EmptyFolderList,MoveToFolder, Progress)' to work though... kept waffling about permissions. (I was experimenting in a quarantined milieux, in case you think me rash.)