A console application for automatically downloading and managing media files for Formula 1 races. The application is designed to be run as a Windows service in order to be as lightweight and reliable as possible. The console interface is mainly used for setup and customization.
Formula 1 torrent files are notoriously unreliable in their naming convention and quality, making PVR software such as Sonarr largely unusable for this purpose.
This application is not completely reliable as of yet, but works better than the alternatives I've found so far. It was initially meant to be used in conjunction with Plex, but can also be used as a standalone application.
The application periodically checks if any races are missing and if so, searches and downloads the torrent through the qBittorrent WebUI API.
After that the application renames and imports the downloaded files to the specified media folder and removes any remnant torrent files. Renaming is done using the season and episode metadata from TheTVDB.
Finding the correct match can be tricky, so I implemented several checks to determine whether the torrent is a match. For example, one of those checks involves the use of the Levenshtein distance algorithm, which measures the edit distance between two strings.