Path Substituiton

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
metaclam
Posts: 102
Joined: Sat Jan 31, 2009 6:31 pm

Path Substituiton

Post by metaclam »

I plan to rearrange the file structure of thousands of torrent files, which are spread across several volumes.

I want to go from some like:

/Volumes/Volume x/path

to

/Volumes/Big Volume/Folder x/path

is this possible and if so, how?
wooshyx
Posts: 2
Joined: Thu Dec 28, 2023 4:43 pm

Re: Path Substituiton

Post by wooshyx »

I have exactly the same question, I want to move files from one volume to another, without changing the rest of the path (and its custom subfolder names).
I know the file location path is stored in the .resume files (on MacOS they're located in /Users/UserName/Library/Application Support/Transmission/Resume/), but it seems that each path is preceded with a character checksum, so we eventually change the number of characters by editing the path, thus it requires to calculate and change that number for every single file, which doesn't seem to be elegant nor efficient.

Thank you !
darmok
Posts: 119
Joined: Tue Oct 16, 2007 9:14 pm
Location: New Jersey, USA

Re: Path Substituiton

Post by darmok »

Can you clarify this a bit more?

In Transmission (macOS) I can pick a number of torrents, then select "Move Data File To..." and it will move them enmass to the specified location - keeping each torrent's internal file organization intact. Is that the function you need or ?
wooshyx
Posts: 2
Joined: Thu Dec 28, 2023 4:43 pm

Re: Path Substituiton

Post by wooshyx »

Keeping the internal file organization intact is good, but what is requested here is to also keep the path intact.

Let's say you're downloading three torrents.
To keep your directory well organized, you put these torrents in different folders and subfolders. For this example, we'll use torrents with one file and no directory.
For example :
/Volumes/DriveA/Paintings/Picasso/blue.ext
/Volumes/DriveA/Paintings/Klein/blue.ext
/Volumes/DriveA/Musics/Davis/kind_of_blue.ext
In red, this is the common path for all three.
In blue, this is a custom folder created locally to properly sort those torrents.
In green, this is the actual torrent file.

So now, let's say you want to move all your torrents from DriveA to DriveB.
If you select the three torrents, select "Move Data File To…", and pick DriveB, they will all end up mixed in the main folder. If you create a subfolder and pick it, they will also all end up in the same subfolder.
What we're looking for is to preserve the path and only change the name of a common value of the path (drive, folder…).

The result we want in this example is :
/Volumes/DriveB/Paintings/Picasso/blue.ext
/Volumes/DriveB/Paintings/Klein/blue.ext
/Volumes/DriveB/Musics/Davis/kind_of_blue.ext

The result "Move Data File To…" would give us would be
/Volumes/DriveB/blue.ext (conflict with line 2)
/Volumes/DriveB/blue.ext (conflict with line 1)
/Volumes/DriveB/kind_of_blue.ext

In this example, I use the simplest case of a drive change, but we can also think about a new organisation where you want your torrents to be in a new subfolder (like /Volumes/DriveA/Documents/Arts/Torrents/). Basically, we're looking for a tool to replace /Volumes/DriveA by /Volumes/DriveB or Volumes/DriveA by Volumes/DriveA/Documents/Arts/Torrents, like the search and replace function of any text app. The app doesn't need to move the files itself (it's actually very bad at it), just point to the right direction again.
darmok
Posts: 119
Joined: Tue Oct 16, 2007 9:14 pm
Location: New Jersey, USA

Re: Path Substituiton

Post by darmok »

Ok. You're talking about changing the tree that you created *outside* of the original torrent's organization.

hum. IC two ways to do this...

First is to manually build the new tree on (on DriveB) then do a Move on each group of torrents to new tree branch. iow move all the Picassos then move the Klein's then... This can be painful - having to wait for each copy to finish (if you're moving to a different drive). Transmission's copy function is fast, but not synchronous - so it holds the UI hostage while the copy is done.

The second way would be to copy the folder trees and their data using an app such as ditto then Move each group of torrents in each tree branch. Still a PITA, but at least there is no hostage situation.

...I guess I've been fortunate in that I don't have any name dups to have to shuffle around. I've got 700+ torrents spread out over two HDs and a RAID box. I let Transmission's group settings organize them on the way in. Then, if I decide to keep them, Move them to the RAID box a few at a time.
metaclam
Posts: 102
Joined: Sat Jan 31, 2009 6:31 pm

Re: Path Substituiton

Post by metaclam »

thanks wooshyx for explaining that. was hoping there was a better solution here. I move torrents as they come in to folders based on their content type, and those folders exist on multiple volumes such as:

Vol1/Books/Science Fiction/
Vol1/Books/Crime/
Vol2/Movies/Features/
Vol3/Movies/Documentaries/

etc.

I want to consolidate on one big RAID5 vol., so now
> BigVol/Books/Science Fiction
> BigVol/Books Crime/
> BigVol/Vol2/Movies/Features
> BigVol/Vol3/Movies/Documentaries

notice I kept Vol2 & Vol3 in consolidated path, for legacy purposes, I may need to mount each as a separate network drive.

so, i'd want to substitute "/Vol1/Books/" for "/BigVol/Books/" but also "/Vol2/Movies/Features/" for "/BigVol/Vol2/Movies/Features/" etc.

ditto and move would be one solution, but I've got some 10,000 torrents in untold hundreds of such "tree branches". No real way to group the torrents by branch, either, is there?
killemov
Posts: 542
Joined: Sat Jul 31, 2010 5:04 pm

Re: Path Substituiton

Post by killemov »

Hi there power users!

AFAIK there is no way to do this with any stock UI. I have written a web UI, Shift, that allows you to select torrents on a certain path and batch move them to another path. Be aware that doing large move actions across filesystems with Transmission may cause servercide.

Try it and let me know how I can help you with this.
Last edited by killemov on Tue Mar 26, 2024 10:52 pm, edited 1 time in total.
metaclam
Posts: 102
Joined: Sat Jan 31, 2009 6:31 pm

Re: Path Substituiton

Post by metaclam »

wow, killemov, that's tremendous!! Thank you so much!

I don't have the time right now to study this fully, but will before I attempt to do this, of course. Will post back ASAP.
metaclam
Posts: 102
Joined: Sat Jan 31, 2009 6:31 pm

Re: Path Substituiton

Post by metaclam »

killemov wrote: Tue Mar 26, 2024 11:32 am Hi there power users!

AFAIK there is no way to do this with any stock UI. I have written a web UI, Shift, that allows you to select torrents on a certain path and batch move them to another path. Be aware that doing large move actions across filesystems with Transmission may cause servercide.

Try it and let me know how I can help you with this.
hi killemov. finally ready to try to do this. couple shamefully basic questions:

1. the instructions refer to transmission-daemon. how do I obtain or run this on MacOS? Is it part of the Transmission client, like in the package?

(note: it seems this daemon is running? I can run Transmission Remote GUI 5.18.0 and connect to localhost on the port set in Transmission under Remote settings.)

2. how do I then restart that daemon?

3. then how do I actually run Shift?

4. when you warn about servercide, is it possible with Shift to just change the paths, without moving the data? (The data is already in place on the NAS, I just need to point Transmission to it.)
Post Reply