Пример #1
0
    def onPlayBackStopped(self):
        inWatching = self.currentTime / self.totalTime >= .0020
        setWatched = self.currentTime / self.totalTime >= .90

        if setWatched:
            self.setPlayedOverlay()
            bookmarks.bookmarks().delete(self.name)
        else:
            bookmarks.bookmarks().reset(self.currentTime, self.totalTime,
                                        self.name)
            try:
                self.libraryProgrees(self.content, self.currentTime,
                                     self.totalTime, self.DBID)
            except:
                pass

        try:
            if inprogress_db == 'true':
                if inWatching:
                    if self.content == 'movie':
                        self.add_progress_movies(self.original_meta)
                    # elif self.content == 'episode': self.add_progress_episodes(self.original_meta)
                if setWatched:
                    if self.content == 'movie':
                        self.remove_progress_movies(self.original_meta)
                    # elif self.content == 'episode': self.remove_progress_episodes(self.original_meta)
        except:
            pass
Пример #2
0
    def setProgress(self):
        threads = []
        if self.currentTime == None:
            try:
                self.currentTime = self.getTime()
            except:
                self.currentTime = 0

        if self.totalTime == None:
            try:
                self.totalTime = self.getTotalTime()
            except:
                self.totalTime = 0

        try:
            self.watched = (self.currentTime / self.totalTime >= .90)
        except:
            self.watched = False
        if self.watched == True:  # SET
            threads.append(libThread.Thread(self.setPlayed))
            threads.append(
                libThread.Thread(self.remove_progress_movies,
                                 self.original_meta))
            threads.append(
                libThread.Thread(bookmarks.bookmarks().delete, self.name))
        else:
            threads.append(
                libThread.Thread(bookmarks.bookmarks().reset, self.currentTime,
                                 self.totalTime, self.name))
            threads.append(
                libThread.Thread(self.add_progress_movies, self.original_meta))

        [i.start() for i in threads]
Пример #3
0
    def setProgress(self):
        while True:
			try:
				if not self.isPlayingVideo(): continue 
				try: timeTotal = self.getTotalTime()
				except: timeTotal = 0
				if timeTotal != None and timeTotal != 0: break
				time.sleep(0.5)
			except:continue
        progress = 0

        self.offset = bookmarks.bookmarks().getPlayer(self.name)
        if not self.offset == '0': self.seekTime(float(self.offset))
Пример #4
0
 def resumePlayback(self):
     while True:
         try:  # KODI 18 LEIA CHANGES TO PLAYER NOW REQUIRES isPlayingVideo to make sure Video is Playing
             if not self.isPlayingVideo(): continue
             try:
                 timeTotal = self.getTotalTime()
             except:
                 timeTotal = 0
             if timeTotal != None and timeTotal != 0: break
             time.sleep(0.5)
         except:
             continue
     try:
         self.offset = bookmarks.bookmarks().getPlayer(self.name)
         if self.offset != '0' and self.offset != '':
             self.seekTime(float(self.offset))
     except:
         pass
Пример #5
0
    def onPlayBackStopped(self):
		bookmarks.bookmarks().reset(self.currentTime, self.totalTime, self.name)
Пример #6
0
    def run(self, title, year, season, episode, imdb, tvdb, url, meta):
        try:
            control.sleep(200)

            # try: self.debridHandle = url['handle'].encode('utf-8')
            # except: self.debridHandle = '0'
            # url = url['url'].encode('utf-8')

            self.totalTime = 0
            self.currentTime = 0
            self.original_meta = meta
            self.content = 'movie' if season == None or episode == None else 'episode'

            self.title = title
            self.year = year
            self.name = urllib.quote_plus(title) + urllib.quote_plus(
                ' (%s)' %
                year) if self.content == 'movie' else urllib.quote_plus(
                    title) + urllib.quote_plus(' S%02dE%02d' %
                                               (int(season), int(episode)))
            self.name = urllib.unquote_plus(self.name)
            self.season = '%01d' % int(
                season) if self.content == 'episode' else None
            self.episode = '%01d' % int(
                episode) if self.content == 'episode' else None
            # self.Nextup = None
            self.DBID = None

            self.imdb = imdb if not imdb == None else '0'
            self.tvdb = tvdb if not tvdb == None else '0'

            self.metaID = [self.imdb, self.tvdb]
            self.metaID = [i for i in self.metaID if not str(i) == '0']

            poster, thumb, fanart, meta = self.getMeta(meta)

            self.offset = bookmarks.bookmarks().getPlayer(self.name)

            item = control.item(path=url)
            if self.content == 'episode':
                item.setArt({
                    'icon': thumb,
                    'thumb': fanart,
                    'poster': poster,
                    'fanart': fanart,
                    'tvshow.poster': poster,
                    'season.poster': thumb,
                    'tvshow.landscape': thumb
                })
            else:
                item.setArt({
                    'icon': thumb,
                    'thumb': thumb,
                    'poster': thumb,
                    'fanart': thumb
                })

            item.setInfo(type='Video', infoLabels=meta)

            if 'plugin' in control.infoLabel('Container.PluginName'):
                control.player.play(url, item)

            control.resolve(int(sys.argv[1]), True, item)

            self.keepPlaybackAlive()

        except:
            return