How do i return a blank EpisodeObject for a future episode

The API i’m working with returns a list of episodes that includes future episodes which haven’t been released yet and that are not available to watch. I want the episodes to be listed with the rest of the content but just not “clickable.” If the user clicks on the episode, i don’t want anything to happen OR i want to have a dialog box popup saying the episode won’t be available until a certain date in the future. The issue i’m running into is that the EpisodeObject won’t do anything other than play the URL it’s given. I tried using the key = callback() feature and setting up a function that returns an objectcontainer with a MessageContainer but it doesn’t actually work. If i change the EpisodeObject to a DirectoryObject, it works perfectly. The issue is that the directoryobject container can’t pass some of the metadata that i have available to me. It’s not the end of the world or anything. I’m just wondering if there’s another way.



My other idea was to handle this in the URL service code. Is it possible to return a popup dialog box (Like a MessageContainer or PopupDirectoryObject) from the service code? Or does it only have the ability to return WebVideoURL, RTMPVideoURL, and the like?



Thanks!

Pretty sure that any video based object would have to return something there … I’d honestly just skip the ones that haven’t aired yet if you can.


+1 for this idea. The only other (ugly) thing I can think of is raising a *MediaNotAvailable* exception for unavailable videos.
Example: https://github.com/plexinc-plugins/Services.bundle/blob/master/Contents/Service%20Sets/com.plexapp.plugins.vimeo/URL/Vimeo/ServiceCode.pys#L145

Yes but this won’t grey out options or disallow users to pick them, they will just raise that error when they try to play them. That sounds like it’s making for a lot of “support” by people saying that episodes won’t play to me :slight_smile:


Very true, that's why I don't really like the option and think your suggestion of leaving them out of the listing is waaaaay better B)

Well, i ended up just using DirectoryObjects that callback a messagecontainer saying “Media Unavailable.” I liked this approach more because i really wanted to keep future episodes listed. I may try the “raise Ex.MediaNotAvailable” option in the future once this plugin is complete.



Thanks for the suggestions!