Execute plugin not working

Suggest, post, or discuss plugins for Deluge
Post Reply
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Execute plugin not working

Post by iconoclasthero »

I've looked at all the simple things and I haven't been able to find out why this isn't working:

Code: Select all

$ deluged --version
deluged 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.9
OS: Linux 5.3.0-28-generic

$ deluge-gtk --version
deluge-gtk 2.0.3-2-201906121747-ubuntu18.04.1
libtorrent: 1.1.5.0
Python: 3.6.9
OS: Linux 5.3.0-28-generic

$ which torrent-complete 
/usr/local/bin/torrent-complete

$ ll /usr/local/bin/torrent-complete 
-rwxr-xr-x 1 root root 1092 Feb  2 11:35 /usr/local/bin/torrent-complete*

$ pwd
/library/music/00-incoming/deluged-incoming

$ cat /usr/local/bin/torrent-complete
#!/bin/bash
export DISPLAY=:0
# Input Parameters
torrentid="$1"
torrentname="$2"
torrentpath="$3"
torrentfilepath="$3/$2"

echo "Torrent Details: " "$torrentname" "$torrentpath" "$torrentid" >> /dev/shm/cache/torrent-complete.log

notify-send "Deluge:"  "A trrent has completed, proceeding to execute script."

if [[ $torrentpath == "/library/music/00-incoming/deluged-incoming" ]] ; then
	notify-send "Deluge:"  "A music torrent has completed.  Attempting to launch picard."
	picard /library/music/00-incoming/deluge-incoming
else
    :
fi

$ torrent-complete id name path

$ cat /dev/shm/cache/torrent-complete.log 
Torrent Details:  name path id
Image

The three lines are respectively:

Code: Select all

/usr/local/bin/torrent-complete
/usr/bin/notify-send "torrent completed" "$2"
/usr/bin/notify-send "Torrent added:" "$2"
Nothing happens when I add a torrent or upon torrent completion. Nothing is added to the log and notify-send doesn't pop a notification on my desktop (but it does when I manually test it as above).

What am I missing?
ScottC
Member
Member
Posts: 12
Joined: Fri Jul 22, 2016 3:44 pm

Re: Execute plugin not working

Post by ScottC »

Just checking, Did you restart deluge after enabling the execute plugin. I was having the same issue, nothing happening on torrent complete. Once I restarted deluge, it started working.
iconoclasthero
Member
Member
Posts: 46
Joined: Tue Aug 28, 2018 12:39 am

Re: Execute plugin not working

Post by iconoclasthero »

Many many times...rebooted, upgraded the kernel a couple of times...
idic
New User
New User
Posts: 7
Joined: Wed Jul 11, 2018 6:28 pm

Re: Execute plugin not working

Post by idic »

Did you ever get this working?

I just rebuilt a new VM with v2.0.3 and reused the logic from my previous version 1 script. It works manually but I'm not even seeing the variables getting passed to new the script.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not working

Post by mhertz »

[...] but I'm not even seeing the variables getting passed to new the script

Did you test this from a script, e.g echoing $1-3 into text file for verification? There was a commit fixing windows support after deluge 2.0.3 released, but I see you're using Linux from your profile - you could try that updated newest version of plugin, from deluge develop branch, if verifying that it doesn't output vars correctly, just in case(place in your deluge profile dir and restart deluged):

https://paste.c-net.org/BrittanyMargate

(When searching back in my posts to find that link, saw a user stating it fixed his issue on raspbian and deluge 2.0.3 btw, so seemingly not 100% only windows related)
idic
New User
New User
Posts: 7
Joined: Wed Jul 11, 2018 6:28 pm

Re: Execute plugin not working

Post by idic »

Thanks mhertz.

Yes, when i tested from my script and run it as

Code: Select all

./move.sh 5153 "Raspberry_pie_recipe.rar" /opt/deluge/Downloads
it showed the variables in my log file. However, straight from the plugin it didn't.

I've grabbed v1.4 (thanks again) and will give that a go on my linux machine.
idic
New User
New User
Posts: 7
Joined: Wed Jul 11, 2018 6:28 pm

Re: Execute plugin not working

Post by idic »

That did the trick for me mhertz. Thanks. You rock!
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Execute plugin not working

Post by mhertz »

I appreciate your kind post mate, thanks likewise :) and for reporting back.
Post Reply