xbenjii / torrentexpander

Automatically exported from code.google.com/p/torrentexpander
0 stars 0 forks source link

Delete files from destination folder #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What version of the product are you using? On what operating system?
0.18

Can you add an option to delete files in the Destination folder? Movie (as an 
example). As of now: Download torrent -> complete -> copy to Destination folder 
-> renames movie -> deletes torrent file -> copies movie to correct folder.

It does not delete the file in the Destination folder once it has moved it to 
the correct folder on the HD. There is no reason to have the same file in 2 
different places :)

Thanks for this script! 

Original issue reported on code.google.com by vilhe...@gmail.com on 26 Dec 2011 at 2:34

GoogleCodeExporter commented 8 years ago
Good news : this feature is already included :-)
In your settings file, just change 
movies_post=copy
to
movies_post=move

You can do the same with movies_post and music_post

Original comment by addicted...@gmail.com on 26 Dec 2011 at 5:58

GoogleCodeExporter commented 8 years ago
Hey,

Thanks what I thought. I edited the settings by doing: nano
torrentexpander_settings.ini but what I did after I got your reply was
edited torrenetexpander.sh as well from copy to move, THEN it worked :) So
it looks like it takes the settings from the .sh file instead of the
settings.ini file when it is run in transmission. Is this correct?

Thanks for your script. It was JUST the script I needed when I was googling
around last night to make my HTPC complete! Thanks for all your hard work
and for sharing this great script!

Original comment by vilhe...@gmail.com on 26 Dec 2011 at 12:17

GoogleCodeExporter commented 8 years ago
This is not supposed to happen, of course
What unix distribution are you using ?
Are you using this line in transmission json settings file ?
"script-torrent-done-filename": "/path/to/torrentexpander.sh 
$TR_TORRENT_DIR/$TR_TORRENT_NAME"

Another explanation would be that the user running transmission reacts 
differently from others.
You should try to use this line in your terminal "su userrunningtransmission" 
then "/path/to/torrentexpander.sh -c". The path to your settings.ini will then 
be indicated in nano.

Until we solve this problem, you should make sure you disabled the script 
autoupdate, in order to keep your current settings.

Thanks for your feedback

Original comment by addicted...@gmail.com on 26 Dec 2011 at 7:33

GoogleCodeExporter commented 8 years ago
I am using ReadyNAS Duo V2

In the json settings file I just have: "script-torrent-done-filename"
: "/path/to/torrentexpander.sh",

If I have: "script-torrent-done-filename"
: "/path/to/torrentexpander.sh $TR_TORRENT_DIR/$TR_TORRENT_NAME",

then it won't work.

Notice I have a "," at the end of the line, but this is just so the script
knows to look at the next line for the next command, correct?

su admin (this user is running transmission) and the path to my
settings.ini file is shown in the correct location. So no dual
settinings.ini files.

Original comment by vilhe...@gmail.com on 26 Dec 2011 at 9:39

GoogleCodeExporter commented 8 years ago
The "," is there to separate lines from one another. This is the way 
transmission stores its settings

More and more people need to use the line "script-torrent-done-filename" : 
"/path/to/torrentexpander.sh",
This is weird, because my script is calling the $TR_TORRENT_DIR and 
$TR_TORRENT_NAME variables to determine the torrent path... go figure

settings.ini is in the correct location. We'll need to look elsewhere...

If the third_party_log feature is enabled or if you're running the script 
manually, the movies_post, tv_whows_post and music_post will switch to copy 
instead of move. Is there any chance this is what happened at the time ? This 
is the only logical explanation.

Original comment by addicted...@gmail.com on 27 Dec 2011 at 6:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
third_party_log is set to "no".

When this happened I might of run it manually, but I am not 100% sure. It 
worked after editing the torrentexpander.sh so it all worked out in the end.

Original comment by vilhe...@gmail.com on 27 Dec 2011 at 11:56

GoogleCodeExporter commented 8 years ago
Okay, we'll see later if another user experiences the same issue

Thanks for your feedback

Original comment by addicted...@gmail.com on 28 Dec 2011 at 9:19

GoogleCodeExporter commented 8 years ago
In settings.json I have: "script-torrent-done-filename": 
"/path/to/torrentexpander.sh"

I think it works to have:  "script-torrent-done-filename": 
"/path/to/torrentexpander.sh $TR_TORRENT_DIR/$TR_TORRENT_NAME" IF the torrent 
that is downloaded comes with its own folder.

I downloaded a torrent yesterday and I have destructive mode on, and it deleted 
it again. I think this was because I have: "/path/to/torrentexpander.sh" and 
not "/path/to/torrentexpander.sh $TR_TORRENT_DIR/$TR_TORRENT_NAME" as this 
torrent had it's own folder.

I downloaded a episode which didn't come in it's own folder, so when I had 
"script-torrent-done-filename": "/path/to/torrentexpander.sh 
$TR_TORRENT_DIR/$TR_TORRENT_NAME" in json it didn't do anything after 
completion. It seems like it needs different rules based on if the torrent has 
it's own folder or if it's downloaded in just a file and placed in the regular 
torrent dir.

I have been running the latest version of torrentexpander at all times.

Thanks.

Original comment by vilhe...@gmail.com on 31 Dec 2011 at 2:50

GoogleCodeExporter commented 8 years ago
Maybe you can add some sort of control before deleting? There is no reason to 
delete the torrent first and do the rest of the script after the file has been 
deleted? Wouldn't it be better if the torrent got moved, and if everything went 
without errors that it got deleted. If any errors occur, the torrent files are 
not deleted. Maybe do some kind of file size check, so that the moved file is 
the same size as the same file size in the torrent/torrent dir and if so, 
delete.  

Original comment by vilhe...@gmail.com on 31 Dec 2011 at 5:05

GoogleCodeExporter commented 8 years ago
Checking size is probably not an option.
With multipart rar torrents, size differs a lot ; also some files like the 
sample are not retained
I'd need to use percentages and I'm not comfortable with that

We need to find a way to make sure torrentexpander doesn't fuck up
The good news is that if the torrent is deleted, it means the right path is 
sent to torrentexpander.

I suggest you temporarily turn off destructive mode and let me know the path to 
the torrents that aren't processed correctly.

BTW, make sure you disable Transmission/transmission daemon before editing its 
settings.json file.

Original comment by addicted...@gmail.com on 31 Dec 2011 at 7:14

GoogleCodeExporter commented 8 years ago
Great news
Thanks to user feedback from a forum I found out an error in my code that may 
explain the issue you've been experiencing.
Please let me know how SVN r127 works for you

Original comment by addicted...@gmail.com on 31 Dec 2011 at 8:25

GoogleCodeExporter commented 8 years ago
Please confirm that this issue is now solved since the latest builds
Thanks

Original comment by addicted...@gmail.com on 7 Jan 2012 at 1:54

GoogleCodeExporter commented 8 years ago
Seems to be working. Thanks.

Original comment by vilhe...@gmail.com on 8 Jan 2012 at 12:13

GoogleCodeExporter commented 8 years ago
Solved

Original comment by addicted...@gmail.com on 8 Jan 2012 at 9:09