JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
737 stars 156 forks source link

[Feature Request] Action Chains integration #1073

Closed tklimt closed 4 weeks ago

tklimt commented 1 month ago

Hello, it would be really great, if you could add an option to start the calibre plugin "Action Chains" for the downloaded or updated books. This would automate task I perform after downloading

JimmXinu commented 1 month ago

This appears to be possible.

I've started a discussion over on the MobileRead FFF plugin thread about the details. I know there are some Action Chains users over there.

tklimt commented 1 month ago

Thank you very much

On Tue, 28 May 2024, 16:19 Jim Miller, @.***> wrote:

This appears to be possible.

I've started a discussion over on the MobileRead FFF plugin thread https://www.mobileread.com/forums/showthread.php?p=4427304#post4427304 about the details. I know there are some Action Chains users over there.

— Reply to this email directly, view it on GitHub https://github.com/JimmXinu/FanFicFare/issues/1073#issuecomment-2135336945, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIXFLBEUVOHEIZ4R6E4R2YLZESG6RAVCNFSM6AAAAABII4PRJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZVGMZTMOJUGU . You are receiving this because you authored the thread.Message ID: @.***>

JimmXinu commented 1 month ago

I've posted a test version of the plugin in the usual place.

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:

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!'.

tklimt commented 1 month ago

Thx for the quick response. I am currently on holiday, so it will be a week before I can check it out

On Wed, 29 May 2024, 05:01 Jim Miller, @.***> wrote:

I've posted a test version of the plugin in the usual place https://www.mobileread.com/forums/showthread.php?p=3084025&postcount=2.

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:

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!'.

— Reply to this email directly, view it on GitHub https://github.com/JimmXinu/FanFicFare/issues/1073#issuecomment-2136429382, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIXFLBCSTMUFFFVIE72ZNHTZEVAKPAVCNFSM6AAAAABII4PRJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWGQZDSMZYGI . You are receiving this because you authored the thread.Message ID: @.***>

tklimt commented 4 weeks ago

Hi Jim,

I tested it by now and it works fine for me. In addidtion to what you did, you have to make sure, fff marks the books after download.

then you add a selection modifier to the chain at the start (in action chains) with: new search: marked:fff_success and "Select all books in current Library / view"

to test I just added a Single Field Edit to the chain to add a tag.

this results in adding a tag automatically to all successfully downloaded books I normally do a bit more but that was plenty to check the functionality of it

thank you very much for including this

regards Thorsten

On Wed, 29 May 2024 at 05:01, Jim Miller @.***> wrote:

I've posted a test version of the plugin in the usual place https://www.mobileread.com/forums/showthread.php?p=3084025&postcount=2.

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:

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!'.

— Reply to this email directly, view it on GitHub https://github.com/JimmXinu/FanFicFare/issues/1073#issuecomment-2136429382, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIXFLBCSTMUFFFVIE72ZNHTZEVAKPAVCNFSM6AAAAABII4PRJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWGQZDSMZYGI . You are receiving this because you authored the thread.Message ID: @.***>