I have been searching the forum and the docs but have not been able to find the answer and I am hoping that someone here can provide me with an answer.
I am looking for a callback method to clean up an external component when the user exits a channel. Is there such a method or some way of knowing when the user is exiting the channel and trigger a function?
Hmm nothing that I know of. The problem is that the exiting would likely all be handled at the Plex App level and it doesn't notify PMS that an exit has happened, so I don't think you're going to be able to find anything to do this. The only thing I could think of is that you clean up things from a previous session when the channel first initializes (so it starts fresh). But also keep in mind that PMS is multi-user capable so you have to consider that there may be multiple users accessing the channel at the same time.
Are you doing things somehow in a way that you are manually creating/using/updating files outside of the basic channel framework, like in some sort of temp directory?
Thanks for your reply. I suspected that this functionality would not be available.
I have made some modifications to one of the HD HomeRun plugins that someone built and I wanted to send a command to the HD HomeRun on exit so that the device doesn't keep sending traffic onto the LAN while not being used. There is a menu item to trigger it manually, however it's something that my wife or kids will surely forget to do after watching TV :-) so I wanted to make it seamless if possible.