View Single Post
Old 10-04-2014, 04:30 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You probably don't need a list of plugins, just to check if one you want to use is installed. The following is what I use to add a book to the a reading list. I probably stole this from the FanFictionDownloader plugin as it uses several other plugins.

Code:
    def update_reading_lists(self, book_ids):
        rl_plugin = self.gui.iactions['Reading List']

        reading_lists = []
        for list_name in rl_plugin.get_list_names():
            reading_lists.extend(rl_plugin.get_book_list(list_name))
        debug_print("update_reading_lists - reading_lists", reading_lists)
        toread_book_ids = []
        for book_id in book_ids:
            if not book_id in reading_lists:
                toread_book_ids.append(book_id)
        debug_print("update_reading_lists - toread_book_ids", toread_book_ids)

        send_on_connect_list = "Send on connect"
        rl_plugin.add_books_to_list(send_on_connect_list, book_ids, display_warnings=False)

        toread_list = "To Read"
        rl_plugin.add_books_to_list(toread_list, toread_book_ids, display_warnings=False)
davidfor is offline   Reply With Quote