Project PlexRename

By | June 4, 2017

Currently I’m working on two small projects that would help me with design of my new mpconverter. First project is called PlexRename and second project is type of media converter that is based on FFMPEG. I’m planning to reuse some of these ideas in the future.

PlexRename is actually the first application that I wrote in C#. Also, my main concern is to implement Object Oriented Programming paradigm. All my project are available on GitHub

The purpose of this small tool is to rename files and make them compatible with Plex Server. For years I have been using following naming convention

SeriesName\Season Number\01×01 Title.mkv

The problem is that Plex has a problem getting metadata for some of the series episodes. Therefore files need to be renamed to this format

Series Name\Season Number\Series Name – S01E01 – Title.mkv

Also there are additional files related to each episodes. Those are thumb files and nfo files. They need to be renamed too. It is absolutely not possible to rename all files in my collection by hand. Recently Plex Server has some problems retrieving metadata for episodes that are named differently than recommended.

This is an interesting project because we need to somehow isolate index from each file name. In given example index is 01×01. To do this we create a List of indexes and assign related value S01E01. Now we have to iterate through the list of indexes and match it to the one inside a file name. Initially I had some issues with performance. I used Dictionary and replaced later with List of Indexes. We have to remember that List if fairly large. Average series season has no more that fifteen episodes. However, some older series could have even up to twenty five episodes in a season. If we run it against large collection of files of 1,500 + the entire process is potentially time consuming. As a result, we should do our iteration only once and retrieve any possible information from a file name when we are dealing with a string directly at the beginning instead of looping through the List of files, finding indexes and than getting information like Series Name.

You have to remember that this tool will only help you if you have TV Series collection that used naming convention compatible with Kodi as I described in above example.

Application is still in development.

Leave a Reply

Your email address will not be published. Required fields are marked *