View Single Post
Old 07-01-2024, 03:09 PM   #9706
tkshorty
Member
tkshorty began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
Quote:
Originally Posted by JimmXinu View Post
New Test Version

2024-05-28
- Add download_finished_signal for Action Chains #1073
- New Site: touchfluffytail.org (#1071) thanks dbhmw

The FFF plugin has a signal it will emit after the "proceed with updating your library" dialog.

The code for the Action Chains Module I tested with is:
Code:
from calibre_plugins.action_chains.events import ChainEvent

class SearchChanged(ChainEvent):

    # replace with the name of your event
    name = 'FFF done'

    def get_event_signal(self):
        return self.gui.iactions['FanFicFare'].download_finished_signal
All I've done with it is call a chain that printed 'HERE!'.

Hi JimmXinu,

I was told by the author of ActionChains, that if you add the code above to a file called action_chains.py and save that file to the root directory of your plugin it will automatically add this to the imported events in action chain.

I tried this out while only changing the name in your code and it works fine for me.

would you consider adding such a file in a future version?


also a tip for other users:
if you use this and count pages plugin started from FFF you may run into issues if count pages and some actions of your chain run simultainiously. only your action chain or the count pages may be performed for some books. Guess some actions put a lock on some attributes or the whole book.

To prevent this just disable count pages from the FFF plugin in run it from your action chain and set the checkbox to wait for it to finish
tkshorty is offline   Reply With Quote