Beispiel #1
0
 def game_to_listitem(game):
     channel_count = i18n('unknown')
     if Keys.CHANNELS in game:
         channel_count = str(game[Keys.CHANNELS])
     viewer_count = i18n('unknown')
     if Keys.VIEWERS in game:
         viewer_count = str(game[Keys.VIEWERS])
     if Keys.GAME in game:
         game = game[Keys.GAME]
     name = game[Keys.NAME].encode('utf-8')
     if not name:
         name = i18n('unknown_game')
     image = Images.BOXART
     if game.get(Keys.BOX):
         image = game[Keys.BOX].get(Keys.LARGE) if game[Keys.BOX].get(Keys.LARGE) else image
     context_menu = list()
     context_menu.extend(menu_items.refresh())
     context_menu.extend(menu_items.edit_follow_game(name))
     context_menu.extend(menu_items.add_blacklist(game[Keys._ID], name, list_type='game'))
     plot = '{name}\r\n{channels}:{channel_count} {viewers}:{viewer_count}' \
         .format(name=name, channels=i18n('channels'), channel_count=channel_count, viewers=i18n('viewers'), viewer_count=viewer_count)
     return {'label': name,
             'path': kodi.get_plugin_url({'mode': MODES.GAMELISTS, 'game': name}),
             'art': the_art({'poster': image, 'thumb': image, 'icon': image}),
             'context_menu': context_menu,
             'info': {u'plot': plot, u'plotoutline': plot, u'tagline': plot}}
Beispiel #2
0
 def game_to_listitem(game):
     name = game[Keys.NAME].encode('utf-8')
     if not name:
         name = i18n('unknown_game')
     image = Images.BOXART
     if game.get(Keys.BOX):
         image = game[Keys.BOX].get(Keys.LARGE) if game[Keys.BOX].get(
             Keys.LARGE) else image
     context_menu = list()
     context_menu.extend(menu_items.refresh())
     context_menu.extend(menu_items.edit_follow_game(name))
     context_menu.extend(
         menu_items.add_blacklist(game[Keys._ID], name, list_type='game'))
     return {
         'label': name,
         'path': kodi.get_plugin_url({
             'mode': MODES.GAMELISTS,
             'game': name
         }),
         'art': the_art({
             'poster': image,
             'thumb': image,
             'icon': image
         }),
         'context_menu': context_menu,
         'info': {
             u'plot': name,
             u'plotoutline': name,
             u'tagline': name
         }
     }