Archive or Delete Original for one Conversion Task after converting and renaming

May 8, 2014 at 6:49 PM
Edited May 8, 2014 at 11:19 PM
I want to rename all my TV shows using
%ismovie%<\Movies\%showname% (%airyear%),\TVShows\%showname%\Season %season%##\%showname% - S%season%##E%episode%## - %episodename% - %airyear%-%airmonth%-%airday%>

Then I want to re-encode to MP4 and delete only specific titles. Is this possible?
Coordinator
May 8, 2014 at 8:17 PM
What do you mean by delete any specific titles? Why would you convert and then delete and then delete the originals.

May 8, 2014 at 11:16 PM
Edited May 8, 2014 at 11:19 PM
Because I want to record the Law & Orders and Criminal Intent encode them to smaller size but I do not want to keep the large files. I worded it wrong I corrected it.
Coordinator
May 9, 2014 at 12:17 AM
Please explain with examples. Still does not make sense why you would want to delete the converted file.

See your statement again, rename, convert to mp4 an then delete the file AND delete original. Didn't make sense to me

May 9, 2014 at 1:38 AM
Edited May 9, 2014 at 1:46 AM
Step 1 Rename all my recorded files According to Season episode so I can use MediaBrowser that is not a problem
%ismovie%<\Movies\%showname% (%airyear%),\TVShows\%showname%\Season %season%##\%showname% - S%season%##E%episode%## - %episodename% - %airyear%-%airmonth%-%airday%>

Step 2 I would like to encode all law and Orders to MP4 to a NAS and delete the Original WTV Law and Order files. I do not want to delete any other recordings.
Coordinator
May 9, 2014 at 2:42 AM
Part 1 is easy. Put that in custom rename.

Part 2 cannot be done directly. Mcebuddy will either delete all original recordings (select delete original in settings) or none. You can't selectively delete shows. This is an architecture and logical limitation.

Eg if you have 2 conversion tasks and both process all files. If one says delete and other doesn't, which one should be followed?

The work around for this is to write a simple custom command batch file. Use the PostCustomCommand option and in the batch file delete the original file. The original file can be passed as a parameter to the batch file using the custom command parameters. Refer to the documentation for more details.

May 9, 2014 at 2:42 PM
Edited May 9, 2014 at 3:35 PM
That is a great Idea ... one more question if the encode fails will the post-command execute? I am hoping it won't.

I added checks to make sure the output file exists before deleting original.

PostCustomCommandPath="C:\mcebuddysagerename\delorig.bat"
PostCustomCommandParameters=""%sourcefile%" "%convertedfile%" "%destinationpath%""
PostCustomCommandHangPeriod=
PostCustomCommandCritical=true
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false

del orig.bat
if exist "%~f2" del /F "%~f1"
if not exist "%~f1" del /F /Q "%~d1%~p1%~n1.*"
if not exist "%~f1" exit 0
exit 1
Coordinator
May 9, 2014 at 3:45 PM
No it won't. Please see the documentation.

May 9, 2014 at 4:24 PM
Thank You... Donation sent.
Coordinator
May 9, 2014 at 5:00 PM
Edited May 9, 2014 at 8:16 PM
Okay so make it easier for everyone who want to Delete the original files after conversion for one specific conversion task do this:
  • Create a custom profile that you will use with this conversion task (so that it does not affect other tasks using the stock profile, copy the stock profile into a new one) and add these lines to the end of the profile (note the nested double quotes):
PostCustomCommandPath=C:\mcebuddy\DeleteOriginal.bat
PostCustomCommandParameters=""%sourcefile%""
PostCustomCommandHangPeriod=10
PostCustomCommandCritical=false
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false
  • Create a directory called C:\MCEBuddy
  • In the directory, create a new file called DeleteOriginal.bat
  • Edit the file DeleteOriginal.bat and add the following lines and save it
del /F /Q %1
Now any conversion task using this custom profile will delete the original file after a successful conversion
Coordinator
May 9, 2014 at 8:13 PM
Edited May 9, 2014 at 8:17 PM
Here is one work around for Archiving original files for only a specific conversion task:
  • Create a custom profile that you will use with this conversion task (so that it does not affect other tasks using the stock profile, copy the stock profile into a new one) and add these lines to the end of the profile (note the nested double quotes):
PostCustomCommandPath=C:\mcebuddy\ArchiveOriginal.bat
PostCustomCommandParameters=""%sourcefile%""
PostCustomCommandHangPeriod=10
PostCustomCommandCritical=false
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false
  • Create a directory called C:\MCEBuddy
  • In the directory, create a new file called ArchiveOriginal.bat
  • Edit the file ArchiveOriginal.bat and add the following lines and save it
md "C:\ArchiveFiles"
move /Y %1 "C:\ArchiveFiles"
C:\ArchiveFiles if the directory where you want to archive your files.

Now any conversion task using this custom profile will delete the archive file after a successful conversion
May 9, 2014 at 8:32 PM
Yes Thank You they work as designed. The work you put into MCEBuddy makes its use limitless.
Sep 24, 2014 at 9:42 PM
Hello.

There is another option that tells MCEBuddy to keep targets in sync with originals (I forget the exact wording).
If I use the custom post-command to delete the original just for the conversion and the sync option is on, will my processed target disappear.
Or will MCEBuddy be "smart enough" to remove just the original?

I once, after deleting a bunch of original files by hand, turned on the "sync" option and all my corresponding targets disappeared.

thanks
--vlad
Coordinator
Sep 24, 2014 at 10:43 PM
Sound about right. MCEBuddy uses the history file to sync the original and converted. If there is a success entry in the history file it'll sync them.

The work around for you would be to write a post custom command (after a successful conversion) and fail it (mark critical true). This way it will convert but the final custom will fail this marking the entry in the history file as failed and it will not sync the files.

Nov 5, 2014 at 11:10 AM
Edited Nov 5, 2014 at 11:13 AM
I also have the requirement to remove the original file after conversion for a specific conversion task (with all other tasks keeping the original file). However, apart from the original video file, I also want to clean up any related files.

For example, apart from the original .ts file, my MediaPortal recordings (with the MP comskip plugin enabled) also have related .edl, .log, .txt and .xml files. So instead of a simple 'del /F /Q %1', my DeleteOriginal.cmd file looks like this:
@echo off
REM Delete all files (with any extension) that have the same base file name 
REM as the original recording
del /F /Q "%~dpn1.*"

REM Remove the directory that contained the original recording; useful if 
REM every recording is stored in its own folder. If the folder is not empty 
REM (for example contains other recordings), the rmdir command will 
REM simply fail.
rmdir "%~dp1"

REM Exit with a non-zero exit code, such that MCEBuddy will not try to keep 
REM the original and converted files in sync (if enabled). Otherwise the 
REM converted recording would be removed automatically since we deleted
REM the original recording. This requires the following profile setting:
REM PostCustomCommandCritical=true 
exit /b 1
Coordinator
Nov 5, 2014 at 4:29 PM
MCEBuddy automatically cleans up after itself unless you've checked the Skip copying original file option. Make sure you're using 2.3.15 or later builds.
Coordinator
Nov 6, 2014 at 8:23 PM
Done this features has been implemented in the next build of 2.4.1 (11/06/14 and later). You'll find the options in Monitor Task Expert Settings. The Archive, Archive Path and Delete options will only apply to that Monitor task and will override the General Options settings.
Marked as answer by rboy1 on 11/6/2014 at 12:23 PM