Ejemplo n.º 1
0
    def remove_favourite(self):
        """ Remove the selected favourite and then refresh the favourite list. """

        # remove the item
        item = self.media_item
        Logger.debug("Removing favourite: %s", item)
        f = Favourites(Config.favouriteDir)
        f.remove(item)

        # refresh the list
        self.refresh()
Ejemplo n.º 2
0
    def remove_favourite(self):
        """ Remove the selected favourite and then refresh the favourite list. """

        # remove the item
        item = self._pickler.de_pickle_media_item(
            self.params[self.keywordPickle])
        Logger.debug("Removing favourite: %s", item)
        f = Favourites(Config.favouriteDir)
        f.remove(item)

        # refresh the list
        self.refresh()
Ejemplo n.º 3
0
    def show_favourites(self, channel):
        """ Show the favourites (for a channel).

        :param ChannelInfo|None channel:    The channel to show favourites for.
                                            Might be None to show all.

        """

        Logger.debug("Plugin::show_favourites")

        if channel is None:
            Logger.info("Showing all favourites")
        else:
            Logger.info("Showing favourites for: %s", channel)

        # Local import for performance
        from resources.lib.favourites import Favourites
        f = Favourites(Config.favouriteDir)
        favs = f.list(channel)
        self.process_folder_list(favs)
Ejemplo n.º 4
0
    def execute(self):
        """ Show the favourites (for a channel). """

        Logger.debug("Plugin::show_favourites")

        if self.__channel is None:
            Logger.info("Showing all favourites")
        else:
            Logger.info("Showing favourites for: %s", self.__channel)

        # Local import for performance
        from resources.lib.favourites import Favourites
        f = Favourites(Config.favouriteDir)
        favs = f.list(self.__channel)

        # Execute the process folder action
        sub_action = FolderAction(parameter_parser=self.parameter_parser,
                                  channel=self.__channel,
                                  favorites=favs)
        sub_action.execute()
Ejemplo n.º 5
0
    def add_favourite(self):
        """ Adds the selected item to the favourites. The opens the favourite list. """

        # remove the item
        item = self._pickler.de_pickle_media_item(
            self.params[self.keywordPickle])
        # no need for dates in the favourites
        # item.clear_date()
        Logger.debug("Adding favourite: %s", item)

        f = Favourites(Config.favouriteDir)
        if item.is_playable():
            action = self.actionPlayVideo
        else:
            action = self.actionListFolder

        # add the favourite
        f.add(self.channelObject, item,
              self._create_action_url(self.channelObject, action, item))

        # we are finished, so just open the Favorites
        self.favourites()
Ejemplo n.º 6
0
    def add_favourite(self):
        """ Adds the selected item to the favourites. The opens the favourite list. """

        # remove the item
        item = self.media_item

        # no need for dates in the favourites
        # item.clear_date()
        Logger.debug("Adding favourite: %s", item)

        f = Favourites(Config.favouriteDir)
        if item.is_playable():
            action_value = action.PLAY_VIDEO
        else:
            action_value = action.LIST_FOLDER

        # add the favourite
        f.add(self.channelObject, item,
              self.create_action_url(self.channelObject, action_value, item))

        # we are finished, so just open the Favorites
        self.favourites()