help with my addon
#1
Im creating an addon to play a youtube video after you watch a tv show, and im a little stuck.

I was wondering if anyone would mind helping my with a few things:



1. Give me ideas on how to clean up my code

2. Pointers on how to include the resources library i downloaded, with this script

3. Stop youtube video from playing more than once, here is what i have:

Code:
self.varVideoTime = xbmc.getInfoLabel("VideoPlayer.Duration")


...


def onPlayBackEnded(self):
        if self.varVideoTime <= '07:00':
            pass
        else:
            xbmc.executebuiltin("XBMC.PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=" + self.varVideoID + ")")

Here is the source to my addon:

GitHub - https://github.com/Karrade/script.tv.promos

Source - http://source.sytes.net/ (script.tv.promos)
Reply
#2
[code]self.varVideoTime <= '07:00'[/quote]

Are you sure about this line? Unless self.varVideoTime overrides the __lte__() operator, I don't think that will work as you expect, it's just a simple string compare.
Reply
#3
i know that wasnt fully right, but before this ive never used python and im learning xbmc also lol.

im trying to find a way to tell the difference between:
a movie
a tv show
and a youtube video (or something as small as that)

also I pushed the source to GitHub
Reply

Logout Mark Read Team Forum Stats Members Help
help with my addon0