I use Banshee on Linux and I automatically organize my music collection in folder hierarchies. When I add a new album to my Music folder, Banshee automatically moves (and renames) mp3s and puts them in the correct Artist folder. If there is no other file in the folder, the folder will also be deleted, but if other files are present, only mp3 files will be moved and the folder will remain. Because of this, I have several folders inside my music folder that do not have mp3 files, only an image file or a similar auxiliary file.
How can I delete any folder (inside the "Music" folder) in which there is no mp3 file inside?
For example, suppose I have the following:
/home/user/Music/
and I add the folder "Album 1 (2010)", which has mp3, as well as the cover. Banshee will pull out the mp3 and put them in the appropriate folder of the artist, say:
/home/user/Music/Artist
but then the folder
/home/user/Music/Album 1 (2010)
still exists. How can I check if there is mp3 in this folder, and if not, delete it?
I believe the answer will be a command line, but I am open to any suggestion. In addition, it may be useful to require confirmation ... just in case.
source share