-
Notifications
You must be signed in to change notification settings - Fork 10
[Feature Request] Add the possibility to execute after FBT runs #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Next time I add features, I'll look into adding this one in. |
Been thinking of a similar idea, happy to help just need some guidance. |
I see that an |
I was thinking more like the execute plugin not using filebot -exec. Once filebot has finished then execute a script. But i guess it might be hard to know when filebot has finished. |
Also would be great to pass renamed file name arg to script like execute plugin. |
well, it looks like the The last time I looked into this, before the exec flag was implemented, I tried to make the plugin play nice with the execute plugin that comes with deluge. Unfortunately, the execute plugin listens for the same As I see it. There are really just 2 options:
Both solutions would requre a good amount of thought about special cases:
I'll try to think about it over the next few days. I'm open to suggestions, opinions, or pull requests :) |
You make some very good points. My setup is I add a torrent and lable plus check rules to apply the right lable, then when finished filebottool rebames and puts in right location. Now i have to manually update library in kodi. I have written a simple bash script that sends a notification to user and then commands kodi to update library. Think commands really are for auto-move/rename I see there is a updated execute plugin that might be good to use instead of creating a new plugin https://github.com/ultnrg/deluge-execute/blob/master/README.md I haven't done any deluge plugin yet only just moved from windows to linux and only just started learning python but do have some experience in other languages so sort of understand the code. So maybe the easiest way would be to add filebotevent in the updated execute plugin. Edit. Scrap that it won't help. |
Well after some research and trial and error trying to compile latest filebot, looks like this would only work on mac and windows as filebot 4.8 would be needed to use the -exec. I am on linux debian stretch on a arm device (rpi3). So you need to check filebot version and make sure it is above 4.7.9 for it to work that way. |
So, I gather that most of the users of my plugin use the linux version of 4.7.9 (myself included) and despite donating to the patreon it doesn't look like linux support will be coming very soon unless more people sign up. I think an additional plugin may be the way to go with this. It will require a bit more effort on the side of users to find and add an additional plugin, but I figure that most people looking to automate will be savvy enough to figure it out. Unfortunately I've been a bit swamped with real life work. So aside from fixing issues I personally encounter with my plugin, support has been a bit lacking lately. I'll try to pencil in some time to hammer out at least what's needed in this plugin to support it. Namely a Once that's done the work of making the new execute plugin can start. I think most of the work can be mitigated by simply starting with the deluge execute plugin and modifying it. Changing one line should be enough to get it to trigger on the new event, then it's simply a matter of adding UI and maybe some parsing and passing of data that comes with the event. |
Okay, so a bit of an update about this. I'm almost done with a bunch of that outstanding enhancements I've been planning to do. As of 1.1.15 I've added the needed support from within FileBotTool to get a new extension running. There are 2 events that FileBotTool now emits that any plugin can hook into:
Anyone interested in checking out the events can see them here. They both include the torrent_id and the handler name that FileBotTool used if any. This should allow the new plugin to have different actions depending on what handler ran (one for movies, another for shows etc.). The error event also contains a string about the error encountered including a stack trace if any. It should be pretty straight forward to integrate these into a copy of the I'll land the new changes in the 1.2 release when I finish it in the next couple of days. |
Thanks. Yes life has been busy. I will try and have a look at this soon and trying to find time aswell. |
Hello again. I have made some adjustments to the deluge execute plugin. I am just testing now. Nothing special just should pick up the events. If works i will upload to github. |
@rjsachse cool, let me know if you need any help. Keep in mind you'll have to clone and compile FileBotTool 1.1.15 ( |
Yes i already compile 1.1.15. I just cloned deluge execute plugin and have attempted to implement the events. I have not tried it yet. |
ok i have a bit of time this morning and gave it ago bu i get this error
|
It looks like you're trying to catch the event with a function that doesn't have the right number of arguments.
class Core(CorePluginBase):
def enable(self)
event_manager = component.get("EventManager")
event_manager.register_event_handler("FileBotToolTorrentFinishedEvent",
self.catch_fb_torrent_finished)
def catch_fb_torrent_finished(self, torrent_id, handler_name):
log.debug("Caught FileBotToolTorrentFinishedEvent! for torrent: {0}".format(torrent_id)) Novice how deluge-FileBotTool/filebottool/events.py Line 12 in b3b097c
|
@Laharah Thank you so much. i have only started learning python at the start of the year. GOOD NEWS! FBTExecute now works... i havent passed the give it a go |
Looks good! Now you just need special handling and UI. maybe something similar to the auto-execute UI in filebottool. You could get the saved handlers from FileBotTool and have commands that execute based on the handler name with special ones that handle Any or All or None. If you've got a feature you want help with let me know and I can either give you tips or write up a pull request. It's up to you how much work you want to put into it, but once you think it's good enough for average user to get a handle on I'll take a look at it and link to it from the readme here. |
Would it be possible to add the possibility to execute a script/cmd after FBT does it thing? Sort of how the AMC script from FB has --def exec command
The text was updated successfully, but these errors were encountered: