Advise for developing a server manager

Hi everyone, I'm gonna start to develop a "set of tools" to manage my whole  media server for TV Shows but I'm not sure about all the architecture I should use for those. Let me explain myself:

 

I will define the "set of tools" later, but here is what it need to do:

-Interact with https://www.tvshowtime.com/ API to get a list of all apisode already aired but not in the server.

-For all those episode, it will also download a torrent file corresponding to each episode from the tracker: http://t411.io and then start the download

-When the torrent will be finished, it'll rename it and move it in the correct following plex guidelines. And also download subtitles if needed.

-Every time an episode is marked as watched in plex, it'll make an API call at tvshowtime to mark it watched as well.

 

To do the first 3 point, I thought about an OSX client application checking the toWatch list from tvshowtime every day, for the torrent download part, I already implement it in another application, and the renaming part is not a big deal either.

 

The bigest problem to me, is to handle the plex "watched" events, unless I'm wrong, I'll have to develop a python plug-in in order to do that. So I have three questions:

 

1- I wonder what's the best type of plug-in to develop in my situation, channel plug-in or agent plug-in ? I'm not sure to understand what the agent's one is used to, is it just for giving metadata ? or for all plugin who doesn't need a GUI ?

 

2- Is it possible to do the first three points inside the plug-in itself ? And if it is, should I or it would be better to develop the three first points in an OSX app and the plugin beside for the last one ?

 

3- Have you any other advices to give me for the architecture of this project ? I'm open to any suggestions.

 

Thanks for any help you could bring to me ;) I really hope this project finished ASAP, and will share it with all of you once finished.

1. I would take a look at the Trakt.tv channel for ideas. It does exactly what you want just for trakt.tv. (https://forums.plex.tv/topic/102818-rel-trakt/page-41)

2. I wouldn't advise that. A lot of the work is already done for you: https://github.com/SiCKRAGETV/SickRage, fork this repo and just add what you need.

3. I would stick to Python. Use your custom SickRage and develop the channel for Plex separately.

That'd be my advice.

Thanks for the quick reply, I'm gonna take a look at those project, and their repo. I think I'm gonna use those a lot ;) 

Have a look at flexget too : http://flexget.com/

I wouldn't even use Plex to run a background script. I would use a separate software (for example Sonarr) to manage all this episodes. If Sonarr doesn't fulfill your needs, you can write your own program.