Converting my script to plug-in
#1
I have a script that I use to play movie trailers either before I watch a movie, or just playing all the trailers I have. In order for a trailer to play, it must be in the relevant movie folder with the "-trailer" suffix. Currently, when xbmc (I haven't made the switch to Kodi yet) starts up, a script runs that generates a list of all movie trailers. I have about 600 movies and about 500 trailers. This list takes about 30 seconds or so to generate, then the script that creates the list terminates. When the main trailer script is run, it first sees if a movie is selected, if it is, then a prespecified number of trailers are played before the movie is played. If no movie is played, then trailers are played in a random order.

I'd like make my script into a plug-in so I can distribute it. After reviewing the plug-in creation guidelines, I'm a bit uncertain about a couple of things (including if I should even convert it to a plug-in). The first question I have is how to call the main the script if it is a plug-in. Currently, I have mapped a remote (and keyboard) input to invoke the script which entails editing the keymap.xml file. Is this a kosher thing for a plug-in to do? I was planning on having the user determine what keybind or remote command to use.

Secondly, what category should my plug-in be in? I guess it's a video plug-in, but would another category be more appropriate?

Thanks,

Andy
Reply
#2
a plugin is a virtual filesystem entry. you have not written a virtual filesystem entry. you have written a script. which provides videos. that's what you should use. alternatively, it's a service, if there is no ui to the script (apart from settings).

no problem adding stuff to keymap as long as it's not done without user consent.
Reply
#3
Thanks for the reply. I guess I need to figure out how to make a settings screen and package my script so that it can installed automatically. I think the wiki has information about that, all I need now is the time to read it!
Reply

Logout Mark Read Team Forum Stats Members Help
Converting my script to plug-in0