I have always been in the habit of copying my dvds electronically and storing them online (and to a server that I use for backups in my garage) so that I would have a backup in case of loss or damage. However since the advent of services like Plex, I now can view those copied dvds on a smart tv or other enabled device. Unfortunately the software I use (Magic DVD Ripper) creates a folder with the dvd name, then the media file in that folder is simply named "title1.mp4" (or what ever title it was on the disk it was copied from). So I wanted to automate the creation of a media library that could be used with services like Plex.
Some design considerations
1) As I mentioned, the file names are generic but the folder name does contain the movie name.
So I need the file to be renamed same as the folder name and moved to the root, then the folder with the movie name can be deleted.
2) I want the movies to be organized by genre so I can choose a certain type of movie. This also makes for less files in a folder.
So I am using a Web API by IMDB where I can pull movie information including genre so that I can sort the movies accordingly. It will also have the release date so if the release date is within a certain time frame, it will go into a folder called "New Releases, regardless of the genre. (In the future I will also take advantage of a link that is supplied for the movie poster which I can use for the icons).
So here is the root folder. The folders contain the movie files named "title1.mp4".
There is also a movie already in the root.
And here is what it should look like after the process runs.
(Yes I understand there isn't a lot of error handling, but I was in a hurry :) )