kannibalox / pyrosimple

An overhauled fork of the pyrocore tools for rTorrent
https://kannibalox.github.io/pyrosimple/
GNU General Public License v3.0
48 stars 5 forks source link

Moving completed torrents #55

Closed darkalchemy closed 11 months ago

darkalchemy commented 11 months ago

If I run this command:

rtcontrol alias=TRK realpath="$HOME/torrents/rtorrent" --move-and-set "$HOME/torrents/TRK"

nothing gets moved and there is no output.

If I run the this one:

mkdir -p $HOME/torrents/TRK
rtcontrol --to-view=trk-to-move alias=TRK realpath=$HOME/torrents/rtorrent is_complete=yes
rtcontrol --from-view=trk-to-move // --yes \
  --stop \
  --spawn "mv {{item.path}} /$HOME/torrents/TRK" \
  --exec "directory.set=$HOME/torrents/TRK" \
  --flush \
  --start
rtcontrol --modify-view=trk-to-move --alter=remove realpath=$HOME/torrents/TRK

I get this:

Filtered 0 out of 10391 torrents using [ OrNode["AndNode['PatternFilter', 'PatternFilter', 'BoolFilter']"] ]

and nothing gets moved.

I've missed something, but I can't figured out what it is. Could you tell me what I'm missing to get the completed torrents moved.

Thanks

kannibalox commented 11 months ago

alias=TRK realpath="$HOME/torrents/rtorrent" is meant to be placeholders for your specific setup. If you leave them as-is, no torrents will match and nothing will happen, as you found out. You may want to try running the commands without the --move-and-set "$HOME/torrents/TRK" at first to ensure it's selecting the torrents you expect. As an example, if you want to see what the alias and realpath are for all your torrents, you can run rtcontrol -o alias,realpath // to see them, and then add whatever filters you want to narrow it down to the correct subset.

darkalchemy commented 11 months ago

Ok, I didn't understand how the alias worked. I removed all references to the alias and it appears to be working now. At least I'm seeing the first step in progress.

Thanks

darkalchemy commented 11 months ago

I have it right, now. I had to wrap the item.path in quotes and add 'd.' to directory.set. So, it looks like this now:

mkdir -p $HOME/torrents/Ebooks
rtcontrol --to-view=trk-to-move realpath="$HOME/torrents/rtorrent/*" is_complete=yes
rtcontrol --from-view=trk-to-move // --yes \
  --stop \
  --spawn "mv \"{{item.path}}\" $HOME/torrents/Ebooks" \
  --exec "d.directory.set=$HOME/torrents/Ebooks" \
  --flush \
  --start
rtcontrol --modify-view=trk-to-move --alter=remove realpath=$HOME/torrents/Ebooks

This project is awesome, thought I was going to lose pyro tools when I installed fresh on deb12 and python2 just wasn't available.