How to prevent CDirectoryProvider getting called for my plugin widgets
#1
Hello all,

I am trying to integrate the Titan Bingie skin with the PlexKodiConnect plugin better, and I am running into some issues. 
understand why CDirectoryProvider (shows in debug logs) gets called for a widget item and how I can prevent it from getting called. 

Basically, the Bingie Home screen has multiple widgets that are populated from a skin helper. Some of the items in the widgets are episodes with filenames associated with a plugin, e.g. plugin://plugin_name/episode_name.mkv. Now the issue is that when I go to another screen and then go back to the Home view, CDirectoryProvider gets called to refresh the widgets (I think?) and for some reason that includes the currently selected ListItem in the selected widget. If the currently selected item is an episode from a plugin, then the CDirectoryProvider call ends up activating the plugin which starts playing the episode. This is obviously undesired. 

For clarification, here is an excerpt from the debug logs when I navigate away from the Home screen and back to it, 

Code:

2019-09-10 15:02:32.611 T:19789   DEBUG: ------ Window Init (Home.xml) ------
2019-09-10 15:02:32.612 T:19789   DEBUG: CDirectoryProvider[plugin://plugin.video.plexkodiconnect.tvshows/357489/?plex_id=507648&plex_type=episode&mode=play&filename=American Dad! - S15E13 - Mean Francine.mkv]: refreshing..
2019-09-10 15:02:32.622 T:19789   DEBUG: CDirectoryProvider[videodb://tvshows/titles/174/-2/]: refreshing..
2019-09-10 15:02:32.754 T:19789   DEBUG: CDirectoryProvider[special://skin/extras/widgetplaylists/recommendedmovies.xsp]: refreshing..
2019-09-10 15:02:32.754 T:19789   DEBUG: CDirectoryProvider[plugin://script.skin.helper.widgets/?action=continuewatching&mediatype=episodes&limit=25&reload=]: refreshing..
2019-09-10 15:02:32.754 T:19789   DEBUG: CDirectoryProvider[plugin://script.skin.helper.widgets/?action=recentshowsandmovies&mediatype=media&limit=25&reload=20190910210215]: refreshing..

You can see how CDirectoryProvider gets called to refresh widgets on entry of the Home view. This is fine for all the widgets such as the calls to plugin://script.skin.helper.widgets since they need to be refreshed, however for the currently focused episode in the widget (plugin://plugin.video...//episode.mkv), the call ends up activating the plugin which plays the video unexpectedly.

This only happens on the Titan Bingie skin (doesn't happen in the Estuary skin), so I tried to search the skin and its script helpers for anything related to CDirectoryProvider but I couldn't find anything. I even looked up the source code for CDirectoryProvider for some insights on how things get added to its queue, but I couldn't find any connection to the skin or external scripts. So my question is if anyone can give me some insights on:
  • How do things get added to the CDirectoryProvider queue (does the skin explicitly do it or does Kodi pick it up from somewhere)?
  • Why does CDirectoryProvider get called when I navigate back to the Home screen? Again, is it the skin doing it or Kodi doing it automatically when it notices a change?
  • Is it possible to prevent CDirectoryProvider from adding my episode (from the currently focused widget on entry of Home.xml) so that they don't unexpectedly play when I navigate back to the home screen?
Thanks a lot for your insights fellow coders.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
How to prevent CDirectoryProvider getting called for my plugin widgets00