Ton-O / transmisson-remote-gui

Automatically exported from code.google.com/p/transmisson-remote-gui
GNU General Public License v2.0
0 stars 0 forks source link

Enhancement: Adjust Subfolder Structure #801

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download a torrent containing multiple files (with or without a folder 
structure)
2. Move some files into a subfolder or rename existing subfolder
3. Rename/relocate the files in the torrent
4. Attempt to verify

What is the expected output? What do you see instead?

Not 100% sure if this is expected or not, but verification fails. The same 
*files* are present, but the *folders* have changed. It would be nice if this 
was possible (again, not sure if it is or not).

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

5.0.1 on Win7

Please provide any additional information below.

Original issue reported on code.google.com by aerosa...@gmail.com on 21 Jun 2014 at 2:58

GoogleCodeExporter commented 9 years ago
I've checked and this is possible in uTorrent, so hopefully it isn't that huge 
an ask for it to be possible here too. :)

Original comment by aerosa...@gmail.com on 22 Jun 2014 at 7:25

GoogleCodeExporter commented 9 years ago
To further add to this: It seems like it isn't handling file paths quite right. 
(Bear with me here while I explain.)

If the file path is specified in the original torrent file while downloading, 
the folder structure is created correctly.

E.g. Torrent includes information for /Main folder/Sub folder 1/File

If the file path is *changed* as part of the download process, the folder 
structure is not created and the 'folder structure' is simply added to the file 
names.

E.g. Torrent includes information for /Main folder/File, but is amended when 
adding the torrent to be /Main folder\Sub folder 1\File

If the file path is changed when adding a torrent of existing files to seed, 
the files in the amended part of the structure do not verify.

Now, I have noted that it is not possible to add "/" to a file name in the GUI 
(Invalid Argument error), and you instead have to use "\", so (taking a wild 
guess here) this might be the issue, even though the file tree displays the 
folder correctly.

Original comment by aerosa...@gmail.com on 25 Jun 2014 at 12:02

GoogleCodeExporter commented 9 years ago
There is also no option to move files *out* of a sub folder, at least not that 
I can identify.

Original comment by aerosa...@gmail.com on 25 Jun 2014 at 1:36

GoogleCodeExporter commented 9 years ago
If you are describing a scenario where you are renaming files/directories 
through the transmission daemon then I might think that this is a bug in the 
daemon. I can't exactly tell from the description the exact procedures you are 
using but there are some reported bugs possibly related. i.e. 
https://trac.transmissionbt.com/ticket/5656#comment:3

Original comment by s...@yourfreemail.info on 26 Jun 2014 at 3:52

GoogleCodeExporter commented 9 years ago
Apologies, I will attempt to provide a more detailed description. To hopefully 
clarify what I mean, filenames are surrounded by single quotes, while 
everything preceding the first ' is the folder structure.

Scenario 1: If the torrent itself contains a folder structure, this structure 
is successfully created when downloading the files.

Example 1

  Torrent structure:
    TESTA>'Testa.a'
    TESTA>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

  Disk structure:
    TESTA>'Testa.a'
    TESTA>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

Result 1

  SUCCESS

Scenario 2: If the folder structure is changed as part of the download, this 
does not work. This appears to be covered in the daemon bug mentioned in 
comment #4. However, I can see no way to _remove_ a level of folder structure 
(i.e. moving 'Testb.a' in the below example into folder TESTA), so I have left 
this out for now.

  Torrent structure:
    TESTA>'Testa.a'
    TESTA>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

  Change structure (prior to download) to:
    TESTA>'Testa.a'
*   TESTA>TESTC>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

  Disk structure:
    TESTA>'Testa.a'
*   TESTA>'TESTC\Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

Result 2

  FAIL

Scenario 3: If the folder structure is changed after the download has completed 
(using local filesystem/mapped network drive access - NOT the daemon), the 
torrent no longer verifies/fails to seed.

  Torrent structure:
    TESTA>'Testa.a'
    TESTA>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

  Change disk structure:
    TESTA>'Testa.a'
*   TESTA>TESTC>'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

  Attempt to change listing within Transmission:
    TESTA>'Testa.a'
*   TESTA>TESTC\'Testa_1.a'
    TESTA>TESTB>'Testb.a'
    TESTA>TESTB>'Testb_1.a'

Result 2

  FAIL

Original comment by aerosa...@gmail.com on 26 Jun 2014 at 9:25

GoogleCodeExporter commented 9 years ago
Thank you aerosa.

It looks to me that what you are experiencing are daemon bugs. At least two of 
them.

1.)  https://trac.transmissionbt.com/ticket/5656
2.)  https://trac.transmissionbt.com/ticket/5517#comment:34

The issues you describe probably should be carried on the issue tracker there 
and thereby "stir the hot pot".

I submitted patches on their tracker for path_component_is_suspicious() which 
might have solved some of these issues for you but they were ultimately 
rejected for a solution I still consider wrong. You can get a version of the 
daemon with my implementations here: https://github.com/cfpp2p/transmission  or 
  here:  http://sourceforge.net/projects/transmissiondaemon/   but I do not 
include rename since it's too buggy yet :-(

Original comment by s...@yourfreemail.info on 27 Jun 2014 at 3:45

GoogleCodeExporter commented 9 years ago
Thank you for the reply. :)

I have had a look at the two daemon bugs you mention and notice that an 
'improved patch' has been posted on 5656. Do you think this will potentially 
address the issue I have raised above?

I am afraid that everything mentioned in 5517 is way beyond my comprehension, 
so I can't tell if it is related or not. I will happily attempt to reword and 
post my issue on 5656 (&5517?) if you think it will help and the 
above-mentioned patch does not already address it. :)

Original comment by aerosa...@gmail.com on 27 Jun 2014 at 4:16

GoogleCodeExporter commented 9 years ago
Daemon bug 5656 has now been fixed, but this still appears to not work. Is this 
still a daemon bug or does the GUI need updating to access the new code?

Original comment by aerosa...@gmail.com on 16 Jul 2014 at 2:48

GoogleCodeExporter commented 9 years ago
I think 5656 is only part of the problem.  Quoting your previous"

"Now, I have noted that it is not possible to add "/" to a file name in the GUI 
(Invalid Argument error), and you instead have to use "\", so (taking a wild 
guess here) this might be the issue, even though the file tree displays the 
folder correctly."

"\" within a filename is still not handled correctly within a filename in my 
opinion (see my comment 6 above:
https://trac.transmissionbt.com/ticket/5517#comment:34

I'm in a bit of a hurry right now...

Original comment by s...@yourfreemail.info on 16 Jul 2014 at 10:27

GoogleCodeExporter commented 9 years ago
Thank you for taking the time to answer.

Could it be related to this (rather old) 'fix'?

https://trac.transmissionbt.com/changeset/11126

If not, I will raise a new issue and they can mark it as a duplicate or take it 
forward as necessary. :)

Original comment by aerosa...@gmail.com on 16 Jul 2014 at 10:49

GoogleCodeExporter commented 9 years ago
https://trac.transmissionbt.com/changeset/11126

is indirectly related to the problem.

https://trac.transmissionbt.com/changeset/14264

you'll see PATH_DELIMITER_CHARS  and in path_component_is_suspicious() we get 
into trouble. My patches would have worked but...

see what happens if you open a new ticket.

I don't have time now for a full analysis, I can do in 2 or three days from 
now. But don't wait unless you want to, to raise a new issue unless you think a 
full analysis would somehow help. 

Original comment by s...@yourfreemail.info on 16 Jul 2014 at 11:42

GoogleCodeExporter commented 9 years ago
I am in no huge rush. While this is an annoyance, it is only stopping me from 
seeding a few torrents, so I can wait on an analysis (which will likely be a 
big help and is much appreciated).

Original comment by aerosa...@gmail.com on 16 Jul 2014 at 11:49

GoogleCodeExporter commented 9 years ago
OK, I will do my best to be concise. This is going to be very difficult.

First I create the torrent you describe as Example-one.torrent.

And of course it works download and seed.

Now for Scenario-Two

As you stated "it is not possible to add "/" to a file name in the GUI (Invalid 
Argument error)" This is not the GUI but the daemon's torrent.c code.

static bool
renameArgsAreValid (const char * oldpath, const char * newname)
{
  return (oldpath && *oldpath)
      && (newname && *newname)
      && (strcmp (newname, "."))
      && (strcmp (newname, ".."))
      && (strchr (newname, TR_PATH_DELIMITER) == NULL);

The daemon won't allow the path deliminator "/" because the logic to check for 
duplicate files, etc is not there. But you can use "\" because "\" is NOT a 
path delimiter in Linux and is used like any other character. The official 
transmission project does not support Windows. If you try 
http://sourceforge.net/projects/trqtw/ which is a windows port you'll see 
Scenario-Two does work! Now my port
 http://sourceforge.net/projects/transmissiondaemon/ and
 https://github.com/cfpp2p/transmission 
doesn't support rename but DOES allow a torrent like  the attached 
Scenario-Two.torrent which transmission-QT-windows does not since it's using 
the official patches for https://trac.transmissionbt.com/ticket/5517#comment:34

Scenario 3 goes along a similar line as stated "\" is NOT a path delimiter in 
Linux and is used like any other character.

In windows either "\" or "/" can be path delimiter. 

For what you are trying to do the daemon would have to be fixed first. And 
we've got inconsistencies where path delimiters are not allowed in one place 
(ticket 5517 official fix NO allow Scenario-Two.torrent [Scenario-Two.JPG] ) 
and allowed for in rename's usage of resume
 ( see attached   TESTA-Resume.JPG )
Once the inconsistencies were accounted for and fixed, and the logic to check 
for duplicate files, etc were remedied we'd have it right.

Without going in great details and code examination of the daemon this is 
hopefully somewhat explanatory.  Besides it really doesn't look like a GUI bug 
and the right place would be at transmission's bug tracker. But how to explain 
and I would think be not looked at properly in this context.

Original comment by s...@yourfreemail.info on 18 Jul 2014 at 10:24

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you very much for your time and patience with me on this issue.

I will attempt to raise a ticket on Transmission's tracker but, having read 
your comments above, I hold little hope that it will ever be addressed. I will 
continue to use symlinks as a workaround (which is messy, but at least it 
works).

Original comment by aerosa...@gmail.com on 18 Jul 2014 at 10:40