This is more of a suggestion than a question. But I will take whatever I can get.
I just added a new mini pc to my network just for the purpose of running Plex and MCEBuddy. Along with this, I upgraded MCEBuddy from 2.5 that I’ve used successfully for quite awhile and now have 2.64 installed.
Things were working fine in 2.5 but am now having issues with MCEBuddy adding the recording date to the end of the Movie name and Plex doesn’t like that. I would prefer just the movie name and possibly the year it first came out saved into a folder with the movie name.
Bad: The Bourne Ultimatum - 2024-11-23 2211.mp4 Good: The Bourne Ultimatum - 2007.mp4
I have Plex recording movies in DVR Recordings and shows in DVR TV Recordings on the mini PC. MCEBuddy watches these 2 folders. Once MCEBuddy is done, my final destination is to TV or movie folders on my NAS drive
So I’ve searched MCEBuddy for an example I can use but confusing the hell out of me.
Suggestion: It sure would be great for someone to create a list of descriptions and examples for renaming on a page so users like myself could simply copy & paste them in. The list could include movies & TV shows combined as well as separating them out to a simplified version like I am looking for.
Let’s break it down:
%ismovie%<> This is a logic true/false check. If it’s a movie the first segment up to the comma is used if false use the 2nd segment. I have some nesting of these type of check within all of this as well.
So, if it’s a movie the path is going to be Movies\ then the show name and if there is an airdate include (air date) in the folder name otherwise don’t add anything to folder name. Then the name of the show/movie. End Result: \Movie\The Bourne Ultimatum (2007)\The Bourne Ultimatum.mp4
If it’s not a movie then it’s going to be placed in TV folder. Then a folder for the name and if there is a premieredate put that in (). A sub folder for the Season is created and if there is a season it will put leading zero season number and if there is not season it will do 00. So, it would look like Season 01 if there is a season and if there isn’t it would be Season 00. Then the file is named Show name - S then the same season number logic as folder name, E episode number - episode name. End Results: \TV\Breaking Bad (2008)\Season 01\Breaking Bad - S01E01 - Pilot.mp4
I don’t put the year in the filename and instead in the folder name the file(s) sit under. Plex is able to use this to match without issue. But it could be matching due to metadata as well.
But for a basic include the year for a movie you can use
%showname% (%airdate%)
Great Information! I think I’m actually beginning to understand.
I changed the destination of the completed movie to the main Plex folder on my NAS since your code should recognize it as a movie and place it automatically in the Movies folder.
I copied and pasted what you had and ran a test on “2 Guns”.
I think we are missing some backslashes since the 2 Guns didn’t make it to the Movies folder and got saved in the main Plex folder with no “2 Guns” folder as you can see in the pic below.
You are correct, it looks like the forum post stripped out the backslashes. Try this: \%ismovie%<Movies\%showname%%ifairdate%< (%airyear%),>\%showname%,TV\showname%%ifpremieredate%< (%premiereyear%),>\Season %ifseason%<%season%##,00>\%showname% - S%ifseason%<%season%##,00>E%episode%## - %episodename%>
Also, @Goose fixed my original reply so the slashes show. Thanks Goose.
I just converted a movie and it worked GREAT! Thanks so much. I love how you use the same script for both shows and movies.
Right now, my movies & shows are separated into 2 tasks because I am physically saving my Plex TV shows on a different computer running a 2nd version of Plex server due to storage space issues. I plugged in your entire script into my movie conversion task but am thinking of using only the single task as you are doing. To this purpose, do you know if there’s a way to add an IP address or server name in this script for the TV Shows location?
There isn’t a way to change the root destination within the rename string. So, you’d still need two tasks in your case. But you could use the same rename string. Unless you can map the location on one server to the other.
Thanks so picking this issue up and running with me. I’ll use your idea and look at solving it with mapping.
Do you know of a link where the available commands are located for MCEBuddy? I’ve done some programming in a past life and just curious to learn more in MCEBuddy.
I just thought of a way a couple of ways you might be able to have a single task.
1 - Use PostCustomCommand. (Probably a little more complicated than option 2nd option)
You could write a script that could use parameters to move the file to the other location if it belongs there.
Here are the variables that are available. Running Custom Commands
For example, you could have a postcustomcommand script named something like moveTVShows.ps1. It could have a parameter that would be like isMovie (isTVShow isn’t a variable) and pass the %ismovie% and if it’s false you know to process if not. That would be first logic check in script. The rest would be using a combination of %destinationpath% and %convertedfilename% to determine what to move and what to potentially create at destination.
2 - Have a scheduled task that moves files from the TV location on your movie server to the TV location on your TV server. Something simple using robocopy should work. Below example probably needs tweaks, been awhile since I’ve used robocopy.
Thanks for posting this. I tried using logic with 2.5 version awhile back with conversions and it very much backfired. I then tried to tell mcebuddy to not run comskip on PBS shows, but that ended up preventing any recordings from being converted. If we only had more examples of how to use the logic in the user manual, then it would be so much more accessible to the end user to see the examples in action. I do like the fact that customization is possible, but it seems like it becomes a complex thing once you try setting up more than a handful of conversion or renaming scenarios. You really almost need to go back to programming 101 and do a flow chart and verify everything at the end.
Yeah, it took a lot of trial and error to get this string refined and luckily, I have some basic programming knowledge and do a lot of scripting as part of my job.
I tried breaking this out a little more visually so that the logic checks are more apparent. I excluded the first \ because it wasn’t formatting properly
%ismovie%
If Is a Movie then "Movies\%showname%"
%ifairdate%
If airdate not blank/null then append " (%airyear%)"
If airdate blank/null then no append or ""
"\%showname%"
If Not a Movie then "TV\%showname%"
%ifpremierdate%
If premierdate not blank/null then append " (%prmiereyear%)"
If premierdate blank/null then no append or ""
"\Season "
%ifseason%
If season not blank/null then append "%season%##"
If season blank/null then append "00"
"\%showname% - S"
%ifseason%
If season not blank/null then append "%season%##"
If season blank/null then append "00"
"E%episode%## - %episodename%
Thankyou! This format is much easier to understand. Like you, I’ve had some previous programming but haven’t done any scripting. I may actually try some of my own now that you’ve broken it down and see what else I can do with it. Since I have several computers running as Plex servers on my network (leftovers from previous years), I can isolate 1 to record/save to an isolated folder and have the isolated MCEBuddy run experiments from that drive, not deleting the original file. This would give me a “Sandbox” to play in.
But to be truthful, your original script is doing GREAT! I like the nice clean cut naming and folder with year. Since I switched to your script, Plex has done great finding the correct Metadata.
Just an FYI. Kodi and Plex are really awesome to use with your PVR machines. However, I have noticed that you need to lookup the tvdb or imdb id number for a proper matching of the metadata within various programs. I like tinyMedia manager to pull various add-on information like cast of characters, renaming, and checking for completeness. I think my biggest problem has been matching the premiere year since shows “reboot” every 20-25 years with the same name. I have settled on dividing all fields by a period, then using parenthesis only for the premiere year, and most importantly the Season and Episode (S00E00), followed by episode brief description if all else fails to match. I should put premiere year in folder name, but ultimately I have it on the file so don’t need it for folder.
Here is my naming pattern for **television** **shows**: %showname%\%showname%.(%premiereyear%).S%season%##E%episode%##.%episodename%
If you have a better solution to pulling the correct metadata, please let me know. I also wish Kodi was a client server model so my fire stick did not have to host all the files or maybe read the metadata at the time of use then delete it upon close of file. However, it isn’t meant to be used that way so I gave up and just do the minimum metadata unless using a real computer with Kodi.
Thanks Frank, I’m going to check this script out in my “Sandbox” using Plex and see how it turns out. I use Kodi from time to time but have used Plex for many years where I bought a lifelong subscription. Plex is getting SO much better than in its early years