View Single Post
Old 05-15-2020, 12:08 PM   #500
DictatorAlly
Enthusiast
DictatorAlly began at the beginning.
 
Posts: 26
Karma: 10
Join Date: May 2020
Device: None
Sorry I misread your code earlier, I thought it said:

Code:
    def parse_tags(self, root):
        # Goodreads does not have "tags", but it does have Genres (wrapper around popular shelves)
        # We will use those as tags (with a bit of massaging)
        genres_node = root.xpath('//div[@class="stacked"]/div/div/div[contains(@class, "bigBoxContent")]/div/div[@class="left"]')
        #self.log.info("Parsing tags")
        if genres_node:
            #self.log.info("Found genres_node")
            genre_tags = list()
            for genre_node in genres_node:
                sub_genre_nodes = genre_node.xpath('a')
                genre_tags_list = [sgn.text_content().strip() for sgn in sub_genre_nodes]
                #self.log.info("Found genres_tags list:", genre_tags_list)
                if genre_tags_list:
                    genre_tags.append(' > '.join(genre_tags_list))
            if cfg.plugin_prefs[cfg.STORE_NAME][cfg.KEY_GENRE_MAPPINGS]:
                calibre_tags = self._convert_genres_to_calibre_tags(genre_tags)
            else:
                calibre_tags = genre_tags
            if len(calibre_tags) > 0:
                return calibre_tags
Which I have just tested and it works well for removing/or not removing the GR's plugin filter while being backwards compatible.
DictatorAlly is offline   Reply With Quote