Doubt about env variables upon completed download

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
franzibub
Posts: 4
Joined: Mon Jun 17, 2013 2:18 pm

Doubt about env variables upon completed download

Post by franzibub »

Hello,

I want to automatically upload completed downloads to a ftp location using a script. If I have a TR_TORRENT_DIR that is fine, I can iterate over that directory and upload all files - but what should I do if the torrent has no directory, but is a "one-filer"?

To answer this question myself, I tried finding the location of your repository, but could not find it anywhere.

https://gist.github.com/janlimpens/5798379
blacke4dawn
Posts: 552
Joined: Sun Dec 13, 2009 10:44 pm

Re: Doubt about env variables upon completed download

Post by blacke4dawn »

As far as I know the DIR-variable is the name of the base directory the torrent was saved to (so could contain data from several other torrents), while the NAME-variable is the name of the file (if one-filer) or the directory (if multiple) of the torrent itself. So the simple solution is to check if NAME is a file or directory and then continue appropriately. The DIR-variable should always be a directory btw.
franzibub
Posts: 4
Joined: Mon Jun 17, 2013 2:18 pm

Re: Doubt about env variables upon completed download

Post by franzibub »

Ah, so TR_TORRENT_DIR would always be $HOME/Downloads in the default case?
franzibub
Posts: 4
Joined: Mon Jun 17, 2013 2:18 pm

Re: Doubt about env variables upon completed download

Post by franzibub »

I updated the gist to reflect this... Let's see if this works...
https://gist.github.com/janlimpens/5799506
Post Reply