Remove Empty Folders When Moving Original Archive File

So when you use MCE Buddy to remove commericials it moves the file to the archive folder and copies the new file to the new destination (if settings set this way). I use it with plex and have noticed ALOT of empty directories laying around which can be alot of work to parse through and delete being unsure if they are still empty or not.

Typically plex orders them like so,

…/Main Directory/Show Name (Year)/Season x/Episode.ts

I would be nice if it would delte both top two directories if they are empty after moviing the file if a setting is enabled. So it would remove both ShowName (Year) folder along with the Seasons folder.

If you have enabled the delete original file option then MCEBuddy will delete empty directories going up the parent upto the root monitoring folder you’ve configured in the Monitor location.

It currently doesn’t do it when you setup archive folder. You can propose it a feature request in ge feature and bugs request category and based on the votes for it we can implement it.

I’m not sure how many folks think it’s intuitive to delete the empty folder when archiving original files

Okay we decided to give this a try and will see user feedback.

We’ve implemented this feature in today’s 2.4.8 BETA build, try it out (it will be up later tonight)

1 Like

Was this ever implemented? I still have empty folders after deleting the original.

Edit: Quick correction. I actually don’t have empty folders. I’m using Emby to record and it’s adding poster images and nfo files. Can MCEBuddy be set to remove these files too so the folder can be deleted after the video file is transferred?

MCEBuddy can’t (and shouldn’t) delete any external files by itself. However you can always add a PostCustomCommand in your profile which will delete any supporting files and then if the folder is empty MCEBuddy will remove it. MCEBuddy - Advanced Settings, Commands and Tweaking

Here’s an example:

Ok, that seems like it would work for me.

I use Emby for my recordings and it always leaves behind a .jpg and a .nfo. What would my PostCustomCommandParameters be
="/c del “%originalfilepath%*.jpg" "%originalfilepath%*.nfo”

You need to use & to execute multiple commands through a single line for cmd.exe

PostCustomCommandParameters="/c del "%originalfilepath%*.jpg" & del "%originalfilepath%*.nfo""


you could even assign the PostCustomCommand a batch file to execute and pass the parameter %originalfilepath% to the batch file and execute multiple actions through the batch file.

Excellent, thanks. Appreciate your help.