This project has moved. For the latest updates, please go here.

Queue Delete of Locked Files

Sep 4, 2016 at 5:31 PM
If MCEBuddy tries to delete a file but cannot because it is locked (opened by another program), I would like for it to queue a task to delete it when it becomes unlocked. Consider this scenario:
1) Plex DVR records the show
2) When done recording it is streamed to a client and the Plex transcoder has it open (locked)
3) MCEBuddy begins processing the video
4) When done, MCEBuddy goes to delete the originally monitored file but cannot it is locked
5) The content in Plex now has two files, the original unprocessed and processed one.
What I would like to happen is for MCEBuddy to monitor that locked file until it becomes unlocked and then delete it. Is there a way to get MCEBuddy to do that?
Sep 4, 2016 at 11:59 PM
I understand but that's isn't feasable. What if the lock is never released?

Sep 5, 2016 at 11:44 PM
Given its my server and I control the workflow, I am willing to make the risk that the lock will never be released. Because I know it will be released when Plex is done playing.

However, I found that though I cannot delete files which Plex is currently streaming to another client, I can rename them. So I configured MCEBuddy to archive the original files to a pre-processed directory and can put the post-processed files in its place. This only works because I am going from MKV to MP4. If I stayed with MKV to MKV MCEBuddy was getting really confused and would neither archive nor move the new files into place.

When I do this, after several minutes the client which is playing the moved file would stop playing and Plex reports the file is no longer available. So in the client I have to go back to the Home and find the content again to start playing. This is completely acceptable to me because it is rare that I start watching which the content is still being processed.

Now I have an end-to-end solution, and an archive directory with the preprocessed content I can refer back to if I want. However now I would like MCEBuddy to delete the archived content after X period (1 week?). So I added the archive directory on the monitor and set it to always rescan, then created a new conversion task which would delete the files after X period. However the problem I have with this approach is I cannot figure out a way to have the conversion tasks (first is MKV->MP4, an second is Delete From Archive) distinguish from one another. I added directories on the file name filters but it didn't seem to work, i.e.: C:\Library\TV*.mkv and C:\Archive*.mkv. Any ideas on how I can get the conversion tasks to select only files from a specific directory?

I am finding using Plex DVR with MCEBuddy is difficult because metadata is lost on the post-processed file. Plex does a full scan on the new file with the agent and usually cannot find a match (i.e. NFL Football) and matches to something completely crazy. Where on the pre-processed file Plex has all the metadata associated with the recording, including image, etc. -- all the stuff which originated from EPG. This is really frustrating because it prevents me from using MCEBuddy in any efficient way.

Side note: All of this could be avoided if Plex just supported EDL files. Then I could just have MCEBuddy create an EDL file and no video processing would be needed. I suppose an alternative to all of this would be to create a hidden Plex library to DVR to and move the files into the published library after processing with MCEBuddy. But this would also suffer from the metadata issue, perhaps worse.
Sep 7, 2016 at 3:18 AM
Where is Plex storing this metadata?

There is no confusion, MCEBuddy will replace the destination file if the destination file is unlocked so MKV to MKV in same location does work.

Also if your source file is locked then I would suggest use the delay option that will allow MCEBuddy to start after x hours and the recording is complete.