Пример #1
0
    def select_menu(self):
        ''' Display the select dialog.
            Favorites, Refresh, Delete (opt), Settings.
        '''
        options = []

        if self.item['Type'] not in ('Season'):

            if self.item['UserData'].get('IsFavorite'):
                options.append(OPTIONS['RemoveFav'])
            else:
                options.append(OPTIONS['AddFav'])

        options.append(OPTIONS['Refresh'])

        if settings('enableContextDelete.bool'):
            options.append(OPTIONS['Delete'])

        options.append(OPTIONS['Addon'])

        context_menu = context.ContextMenu("script-emby-context.xml",
                                           *XML_PATH)
        context_menu.set_options(options)
        context_menu.doModal()

        if context_menu.is_selected():
            self._selected_option = context_menu.get_selected()

        return self._selected_option
    def _select_menu(self):
        # Display select dialog
        options = []

        # if self.item_type in ("movie", "episode", "song"):
        #     options.append(OPTIONS['Transcode'])

        # userdata = self.api.getUserData()
        # if userdata['Favorite']:
        #     # Remove from emby favourites
        #     options.append(OPTIONS['RemoveFav'])
        # else:
        #     # Add to emby favourites
        #     options.append(OPTIONS['AddFav'])

        # if self.item_type == "song":
        #     # Set custom song rating
        #     options.append(OPTIONS['RateSong'])

        # Refresh item
        # options.append(OPTIONS['Refresh'])
        # Delete item, only if the Plex Home main user is logged in
        if (window('plex_restricteduser') != 'true' and
                window('plex_allows_mediaDeletion') == 'true'):
            options.append(OPTIONS['Delete'])
        # Addon settings
        options.append(OPTIONS['Addon'])

        addon = xbmcaddon.Addon('plugin.video.plexkodiconnect')
        context_menu = context.ContextMenu("script-emby-context.xml",
                                           addon.getAddonInfo('path'),
                                           "default", "1080i")
        context_menu.set_options(options)
        context_menu.doModal()

        if context_menu.is_selected():
            self._selected_option = context_menu.get_selected()

        return self._selected_option
 def _select_menu(self):
     """
     Display select dialog
     """
     options = []
     # if user uses direct paths, give option to initiate playback via PMS
     if state.DIRECT_PATHS and self.kodi_type in v.KODI_VIDEOTYPES:
         options.append(OPTIONS['PMS_Play'])
     if self.kodi_type in v.KODI_VIDEOTYPES:
         options.append(OPTIONS['Transcode'])
     # userdata = self.api.userdata()
     # if userdata['Favorite']:
     #     # Remove from emby favourites
     #     options.append(OPTIONS['RemoveFav'])
     # else:
     #     # Add to emby favourites
     #     options.append(OPTIONS['AddFav'])
     # if self.kodi_type == "song":
     #     # Set custom song rating
     #     options.append(OPTIONS['RateSong'])
     # Refresh item
     # options.append(OPTIONS['Refresh'])
     # Delete item, only if the Plex Home main user is logged in
     if (window('plex_restricteduser') != 'true' and
             window('plex_allows_mediaDeletion') == 'true'):
         options.append(OPTIONS['Delete'])
     # Addon settings
     options.append(OPTIONS['Addon'])
     context_menu = context.ContextMenu(
         "script-emby-context.xml",
         Addon('plugin.video.plexkodiconnect').getAddonInfo('path'),
         "default",
         "1080i")
     context_menu.set_options(options)
     context_menu.doModal()
     if context_menu.is_selected():
         self._selected_option = context_menu.get_selected()
     return self._selected_option
Пример #4
0
    def _select_menu(self):
        # Display select dialog
        userdata = self.api.get_userdata()
        options = []

        if self.item_type in ("movie", "episode", "song"):
            #options.append(OPTIONS['Transcode'])
            pass

        if userdata['Favorite']:
            # Remove from emby favourites
            options.append(OPTIONS['RemoveFav'])
        else:
            # Add to emby favourites
            options.append(OPTIONS['AddFav'])

        if self.item_type == "song":
            # Set custom song rating
            options.append(OPTIONS['RateSong'])

        # Refresh item
        options.append(OPTIONS['Refresh'])
        # Delete item
        options.append(OPTIONS['Delete'])
        # Addon settings
        options.append(OPTIONS['Addon'])

        addon = xbmcaddon.Addon('plugin.video.emby')
        context_menu = context.ContextMenu("script-emby-context.xml",
                                           addon.getAddonInfo('path'),
                                           "default", "1080i")
        context_menu.set_options(options)
        context_menu.doModal()

        if context_menu.is_selected():
            self._selected_option = context_menu.get_selected()

        return self._selected_option