Adding "delete" button to EpisodeObject

Hi developers,

 

I've written a plugin allowing me to watch MythTV recordings through Plex. This works great, although the interface is currently simple: I simply list all recordings (newest first) as EpisodeObjects under a DirectoryObject.

 

The DirectoryObject allows my plugin to specify a title, a summary text, a snapshot from the recording - and it provides a "play" button so I can actually watch the recording. This is great, and works.

 

Now I want to add a "delete" button next to the "play" button, so I can delete recordings after I've watched them.

 

Is this possible somehow? Can I add a PopupDirectoryObject under an EpisodeObject?

 

Or does anyone know of a plugin which has implemented similar functionality in a different way?

 

/thanks

It's not really possible to add funcions to EpisodeObjects in that way. A hack-y work-around is to populate your Directory of episodes with PopupDirectoryObject() and specify the title, summary, and thumb of each episode for the PopupDirectoryObject. Then each popup can return a set of options (Play or Delete). It's not ideal and some clients may not display it as nicely as others but it can work.

I've done something somewhat similar in the Trailers section of the CouchPotato channel. You can see the relevant code on GitHub, here.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.