script-torrent-done-filename on OS X?

Ask for help and report issues with the Mac OS X version of Transmission
anville
Posts: 16
Joined: Thu Apr 16, 2009 2:41 am

script-torrent-done-filename on OS X?

Post by anville » Tue Oct 05, 2010 7:09 am

I have been trying to get a script to run after torrent is complete by setting "script-torrent-done-enabled" and "script-torrent-done-filename" on my 10.6 Mac, but no luck so far.

Here are my settings:

Code: Select all

$ defaults read org.m0k.transmission |grep script-torrent
    "script-torrent-done-enabled" = 1;
    "script-torrent-done-filename" = "/Users/anville/bin/post_process_torrents.sh";
Is this feature functional on Mac?

Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: script-torrent-done-filename on OS X?

Post by Rolcol » Wed Oct 06, 2010 12:41 pm

No... Transmission on Mac doesn't use settings.json so you can't add or change preferences just like you can on GTK+/Qt/Daemon.

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Thu Oct 07, 2010 1:59 am

The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: script-torrent-done-filename on OS X?

Post by Rolcol » Thu Oct 07, 2010 2:51 am

Just because you add it to the config file doesn't mean Transmission will honor it like the config files of the other platforms. I just did

Code: Select all

defaults write org.m0k.transmission upload-slots-per-torrent 2
and nothing changed from the default of 14 set in the source code.

anville
Posts: 16
Joined: Thu Apr 16, 2009 2:41 am

Re: script-torrent-done-filename on OS X?

Post by anville » Thu Oct 07, 2010 4:03 am

So, I tried this:

Code: Select all

transmission-remote localhost  --torrent-done-script "/Users/anville/bin/post_process_torrents.sh"
and the script would run upon completion, which is cool, sort of, but it's not persistent. I suppose I could set up a cron job to "remind" the client every so often!

Is this a bug that the Mac client doesn't honor the entries in the plist file? Or is something that just hasn't been implemented yet?

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Thu Oct 07, 2010 6:44 am

Rolcol wrote:
Just because you add it to the config file doesn't mean Transmission will honor it like the config files of the other platforms. I just did

Code: Select all

defaults write org.m0k.transmission upload-slots-per-torrent 2
and nothing changed from the default of 14 set in the source code.

Not saying you['re] wrong, but did you quit Transmission before making the edit. Also, I believe, according to Longinuus this script thing should work.
Last edited by x190 on Thu Oct 07, 2010 6:17 pm, edited 1 time in total.
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: script-torrent-done-filename on OS X?

Post by Rolcol » Thu Oct 07, 2010 10:25 am

x190 wrote: Not saying you're wrong, but did you quit Transmission before making the edit. Also, I believe, according to Longinuus this script thing should work.
Yep. I quit Transmission, made the change, and restarted. What kind of tester do you think I am ;)

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Thu Oct 07, 2010 6:14 pm

Rolcol wrote:
x190 wrote: Not saying you're wrong, but did you quit Transmission before making the edit. Also, I believe, according to Longinuus this script thing should work.
Yep. I quit Transmission, made the change, and restarted. What kind of tester do you think I am ;)
Thanks for correcting my grammar, Sir! :) I'm dying to test this script possibility on delete .part files. How does one refer to the torrent name--$TORRENT_ID?

Also since T on OS X uses no less than 3 .plist files, I wonder if one needs to be more specific when doing the defaults write bit.

~/Library/Preferences/org.m0k.transmission.LSSharedFileList.plist
~/Library/Preferences/org.m0k.transmission.plist
~/Library/Application Support/Transmission/Transfers.plist
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

Rolcol
Posts: 337
Joined: Sun Aug 10, 2008 8:00 am

Re: script-torrent-done-filename on OS X?

Post by Rolcol » Thu Oct 07, 2010 11:08 pm

x190 wrote:Thanks for correcting my grammar, Sir! :) I'm dying to test this script possibility on delete .part files. How does one refer to the torrent name--$TORRENT_ID?

Also since T on OS X uses no less than 3 .plist files, I wonder if one needs to be more specific when doing the defaults write bit.

~/Library/Preferences/org.m0k.transmission.LSSharedFileList.plist
~/Library/Preferences/org.m0k.transmission.plist
~/Library/Application Support/Transmission/Transfers.plist
I currently don't see #1 anywhere in my ~/Library folder. I'm thinking that is created by the OS.
#2 is the preferences file that I made the change to. That is the one that regulates the settings.
#3 just lists the added torrents, their location, infohash, group number, and activity status. That info is written into the .resume files, too, and .resume is the default for other systems. #3 looks like it was created to support those other features that libtransmission doesn't.

("You're" and "Your" are one of my biggest spelling pet peeves. You weren't supposed to notice that :p)

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Fri Oct 08, 2010 8:29 am

anville wrote:I have been trying to get a script to run after torrent is complete by setting "script-torrent-done-enabled" and "script-torrent-done-filename" on my 10.6 Mac, but no luck so far.

Here are my settings:

Code: Select all

$ defaults read org.m0k.transmission |grep script-torrent
    "script-torrent-done-enabled" = 1;
    "script-torrent-done-filename" = "/Users/anville/bin/post_process_torrents.sh";
Is this feature functional on Mac?
Path should be /bin/post_process_torrents.sh, right?

Can someone provide a decent script to test on OS X! :?
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Fri Oct 08, 2010 9:15 am

Forget about it! Doesn't work. I guess us OS Xers are second class operators.

:x :evil: :twisted:

!/bin/bash
echo This is a test!
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

anville
Posts: 16
Joined: Thu Apr 16, 2009 2:41 am

Re: script-torrent-done-filename on OS X?

Post by anville » Fri Oct 08, 2010 3:28 pm

Path should be /bin/post_process_torrents.sh, right?
x190, as the long as the path is correct, it shouldn't matter where your script goes!

Like I mentioned above, I was able to set this using the remote client CLI:

Code: Select all

transmission-remote localhost  --torrent-done-script "/Users/anville/bin/post_process_torrents.sh"
It does work, but it's not persistent (meaning it won't be set again if I restart transmission). I had to build the client from source, as it doesn't seem to be distributed with the app bundle (but I could be wrong?).

I was able to set up a cron job to set the script every hour.

I do notice that sometimes it runs before the files have been moved from the incomplete folder to the complete folder.... Weird.

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Fri Oct 08, 2010 5:14 pm

Sorry, didn't mean to hijack your thread. Regarding script persistence did you stop (quit) the daemon (or client) before doing

Code: Select all

    transmission-remote localhost  --torrent-done-script "/Users/anville/bin/post_process_torrents.sh"
?
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

anville
Posts: 16
Joined: Thu Apr 16, 2009 2:41 am

Re: script-torrent-done-filename on OS X?

Post by anville » Fri Oct 08, 2010 5:27 pm

x190 wrote:Regarding script persistence did you stop (quit) the daemon (or client)
No. Since "transmission-remote" talks to the torrent daemon directly, it won't work unless the daemon is running. That's why I had to make a cron hack to keep "reminding ' it of the script. Every time I restart the app, it "forgets".

Obviously this is a deficiency in the Mac version of the app that it doesn't read this from the settings file. I will search in Trac later, and post an issue if it's not there already.

x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: script-torrent-done-filename on OS X?

Post by x190 » Wed Oct 13, 2010 3:24 am

Overview

GTK, CLI and Daemon (both on a Mac and Linux) use a JSON formatted file, mainly because of its human readability.
(Consult the JSON for detailed information)

https://trac.transmissionbt.com/wiki/Ed ... ationFiles
The stone age didn’t end because we ran out of stones.
---The Great Disruption - by Paul Gilding
https://paulgilding.com/
-------------------------------------------------

Post Reply