def handle(self):
     item_dict = self.parent.to_dict()
     self.params = self.argv[0]
     movieInfo = self.get_movie_info(self.params['page_url'])
     item_dict['cover'] = movieInfo['cover']
     item_dict['title'] = self.params['file']
     folder = self.params['folder']
     resolution = self.params['resolution']
     if (len(movieInfo['movies']) > 0):
         for movies in movieInfo['movies']:
             for q in movies['movies']:
                 if (q == resolution):
                     if (movies['folder_title'] == folder or folder == ''):
                         for episode in movies['movies'][q]:
                             if episode[0].find(self.params['file']) != -1:
                                 movie_id = self.get_movie_id(
                                     movieInfo['page_url'])
                                 if movie_id != 0 and xbmcup.app.setting[
                                         'watched_db'] == 'true' and xbmcup.app.setting[
                                             'strm_url'] == 'true':
                                     Watched().set_watched(
                                         movie_id,
                                         season=episode[1],
                                         episode=episode[2])
                                 return episode[0]
     return None
Exemplo n.º 2
0
 def add_episodes_to_watched_db(self, params):
     movieInfo = self.get_movie_info(params['movie']['url'])
     if Watched().set_watched_all_episodes(int(params['movie']['id']),
                                           movieInfo):
         xbmcup.gui.message(xbmcup.app.lang[30172].encode('utf-8'))
     else:
         xbmcup.gui.message(xbmcup.app.lang[30171].encode('utf-8'))
Exemplo n.º 3
0
    def get_info_strm(self, movie):
        info = {
                'Genre'     : self.movieInfo['genres'],
                'year'      : self.movieInfo['year'],
                # 'rating'    : self.movieInfo['ratingValue'],
                # 'userrating'    : int(self.movieInfo['ratingValue']),
                'duration'  : self.movieInfo['durarion'],
                # 'votes'     : self.movieInfo['ratingCount'],
                'director'  : self.movieInfo['director'],
                # 'title'     : self.movieInfo['title'],
                'plot'      : self.movieInfo['description'][:350]+u'...'
                }

        if xbmcup.app.setting['watched_db'] == 'true' and xbmcup.app.setting['strm_url'] == 'true':
            try:
                movie_id = self.movieInfo['movie_id']
            except:
                movie_id = self.get_movie_id( self.movieInfo['page_url'] )
            
            if Watched().is_watched( movie_id, movie[1], movie[2] ):
                info['playcount'] = 1

        return info