"Add to CouchPotato" integration for your add-ons
#1
Hi,

because some users were asking for an "Add to CouchPotato"-Feature I developed the CouchPotato Manager Add-on - which is present in the official xbmc.org add-on repository for frodo now.
This add-on provides also a simple interface for other add-ons to add movies to the users CouchPotato Wanted-Movies-List.

If you like, you can simply also add integration to your add-ons. I guess it makes only sense with Trailer add-ons.
The integration is very simple, in most cases you just need to add two lines to your code:
PHP Code:
CP_ADD_URL 'XBMC.RunPlugin(plugin://plugin.video.couchpotato_manager/movies/add?title=%s)'
liz.addContextMenuItems([('Add Movie to CouchPotato'CP_ADD_URL movie_title)]) 
You can also add movies by their IMDB_ID by using the following URL. In that case no "choose movie" select dialog is needed.
PHP Code:
CP_ADD_VIA_IMDB 'XBMC.RunPlugin(plugin://plugin.video.couchpotato_manager/movies/add?imdb_id=%s)' 

In the above example I would suggest adding "CP_ADD_URL" anywhere global in your code. Then you only need to call the "addContextMenuItems"-method on your "xbmcgui.ListItem"-instance (most name it "liz" or "li"). This method requires a list of two-items-tuples where the first item is the caption of the context menu and the second is the XBMC special-protocol url. You only need to add the movie-title of this list-item.

Here is the commit which adds the integration into my xbmcswift2 based HD-Trailers.net Add-on.

You also don't need to add this add-on to your addon.xml requirements: On Frodo the user will be asked to install this add-on when needed.

If you have any comments, feel free :-)
regards,

sphere
My GitHub. My Add-ons:
Image
Reply


Messages In This Thread
"Add to CouchPotato" integration for your add-ons - by sphere - 2013-03-24, 19:54
Logout Mark Read Team Forum Stats Members Help
"Add to CouchPotato" integration for your add-ons1