I managed to complete a semi-functional plugin recently and I had a question about the plugin development process.
Here's how I worked on the plugin on Windows 7:
1. Edit code in Notepad++
2. Stop Plex Server
3. Run Plex Server
4. Run Plex Client
5. Go to Video Channels, select my plugin
6. Wade through my plugin menus til there is an error
7. Stop Plex Client
8. Look at plugin error log
9. Goto step 1.
I found that if I didn't do steps 2. and 3. that sometimes the changes in my plugin would not be recognized and I would be running the old code. That happened enough times that I just did steps 2. and 3. every time.
Is there a way to make this process more efficient? How do you set up your development environment for maximum speed for Plex plugin development?
I don't know if it's a windows thing or not, but you really shouldn't have to stop and start PMS unless you've changed the .plist file for the plugin, all other changes should be picked up. Also you shouldn't have to stop your plex client every time. One thing that I find handy when working on plugins too is that I'll use something different for my plex client, my phone, iPad, another computer, etc, so that I have the logs running in realtime on my dev box. Aside from that the process looks about right.
There is one other thing you can do as well, that's faster than a client (for some things), and that is to look at the XML that PMS outputs directly. Lots of times it will actually give you the traceback if there's a python error and it typically loads a lot faster than a client would, especially if you're trying to test a particular video or section of information over and over again. Grab the URL for it from the channel log after you hit it with a client the first time, then just reload that URL in a browsers and look at the XML output. I don't personally do that all that often, but I know about other channel devs that swear by doing it this way.
Steps 2 - 5 can be removed. I discovered the same thing about half way through the development of my plugin. Was constantly restarting PMS. Then, one day, i made a change that showed up immediately Was amazed that i had wasted so much time restarting PMS and such. One other trick is that sometimes Plex caches certain menus. Just escape or back all the way out of the plugin back to the main Plex screen. Then reopen the plugin. It should pull a fresh copy of the menu.
Another helpful tip is to run PMC in windowed mode (E.g. not fullscreen). This makes it much easier to switch back and forth between Notepad++, logs, and PMC.
Also, logs update in realtime with Notepad++. Just open up the logs and then alt+tab to PMC. Click on something and then alt+tab back. Notepad++ will see the file has changed and prompt to update the file in the editor. Very handy.
I’ve just pushed some changes that greatly improves compatibility. I’m going to start by tying to apply this to my channel, to see what needs to be improved. If you guys have any insight to this, your contributions would be greatly appreciated.
It's probably worth starting a new topic for this so it's not buried within this one only. Then as changes happen and anyone wanting to give feedback can do it in that thread.
It's probably worth starting a new topic for this so it's not buried within this one only. Then as changes happen and anyone wanting to give feedback can do it in that thread.