"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
#2
Baller!

That's all I can say lol

You sir are a gentleman and a scholar.
Reply
#3
And how would you do this if you already know the imdb id? So you directly can add it by the imdb id.
Reply
#4
(2013-03-31, 17:37)tikkiew Wrote: And how would you do this if you already know the imdb id? So you directly can add it by the imdb id.

Hi

This isn't implemented yet. If you need this i will add it.

Anything else missing?
My GitHub. My Add-ons:
Image
Reply
#5
What about a year for movies with the same title, but different years
Reply
#6
(2013-04-01, 03:22)Bstrdsmkr Wrote: What about a year for movies with the same title, but different years

CouchPotato doesn't provide the possibility to search for a movie with a given year explicit. But you can already just do it implicit:
PHP Code:
'XBMC.RunPlugin(plugin://plugin.video.couchpotato_manager/movies/add?title=Avengers+2012)' 
My GitHub. My Add-ons:
Image
Reply
#7
Missing? A similar headphone add-on Wink

Missing? I mean nope. Implement adding by imdb id is the only thing. I will definitely use that.
Reply
#8
I have a test version ready which includes "add via imdb_id"-feature.
You can download it here.

PHP Code:
CP_ADD_VIA_IMDB 'XBMC.RunPlugin(plugin://plugin.video.couchpotato_manager/movies/add?imdb_id=%s)'
# or
CP_ADD_VIA_IMDB 'XBMC.RunPlugin(plugin://plugin.video.couchpotato_manager/movies/add-by-id/%s)' 

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#9
@tikkiew: Could you test the add-by-imdbid feature?
My GitHub. My Add-ons:
Image
Reply
#10
Yeah I have tested both ways and it worked. Thanks .
Reply
#11
Old thread but was wondering if such function (add to CP) can be made global with for example a configuration item to let the users chose for which addon it should function?
Reply
#12
As far as I know it should be doable with context-menu add-ons.
My GitHub. My Add-ons:
Image
Reply
#13
(2015-06-04, 15:13)sphere Wrote: As far as I know it should be doable with context-menu add-ons.

Cool, i'll give it a shot.

Any plans to create a similar addon for Sonarr ? (https://sonarr.tv/)
Reply



Logout Mark Read Team Forum Stats Members Help
"Add to CouchPotato" integration for your add-ons1
This forum uses Lukasz Tkacz MyBB addons.