Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rqbit is downloading the files within the torrent's directory and not the directory with the files within. #161

Closed
Xygyl opened this issue Aug 2, 2024 · 7 comments

Comments

@Xygyl
Copy link

Xygyl commented Aug 2, 2024

Let's say that I'm downloading "1.torrent" and that it has this structure:

1/
└─a

If I download this to '~/Downloads', then I would expect to see this:

~/Downloads/
└─ 1/
└─ a

But instead, I see this:

~/Downloads/
└─a

Is this the intended behavior? If so, is there a way for me to get the outcome in the second example?

Thank you very much.

@ikatson
Copy link
Owner

ikatson commented Aug 2, 2024

Let's say that I'm downloading "1.torrent" and that it has this structure

I think your assumption here is wrong. If the torrent really did have this structure, it would have downloaded exactly how you wanted.

In the torrent each file looks smth like this "foo/bar/baz.ext". In your example however, the only present file looks like "a", and NOT "1/a".

However, given this, what you seem to want is for torrents always to be downloaded to a separate subfolder of their own.

This currently happens only if there are more than 2 files, here's the code.

So, today, the only way to make it work like you want for torrents that contain only 1 file is to explicitly specify "subfolder" parameter (present in API). Web and Desktop UI don't let you do that, but they let you specifiy the full output folder instead.

The intention with "len < 2" was that it seemed useless to create another indirection (folder) for 1-size torrents, and I wouldn't want to remove this default behavior, as I don't see benefits, only downsides (more clicks to reach the needed file, longer paths).

But if you want, I'll accept a PR which adds an optional parameter that lets you bypass the "len < 2" check. Probably making it a Session property would be best: then in Desktop app, you can make it a permanent setting, and you can set it once from the CLI when launching the server. Smth like "always_create_subfolder"

@Xygyl
Copy link
Author

Xygyl commented Aug 2, 2024

The structure in my original post was only to serve as a simple example, the behavior persists regardless of the number of files in the torrent's directory. For example, I tried to download the tails linux .IS0 which has a structure that looks like this:

tails-amd64-6.5.img
├─ tails-amd64-6.5.img
└─ tails-amd64-6.5.img.sig

The same behavior persisted despite the number of files being two. I also tested torrents with directories that contained thirty files, though the same behavior persisted. Is there something I'm missing?

For transparency, this is the command that I'm running; 'rqbit download -o . -e tails-amd64-6.5.img.torrent'

Thank you for your time.

@ikatson
Copy link
Owner

ikatson commented Aug 3, 2024

Thanks for more details, that explains it now.

The quirk is in you using "rqbit download" rather then "rqbit server start" or any other way to download (web API, desktop etc).

"rqbit download" overrides the output folder per torrent rather than setting it per session. In this case it overrides all the logic I linked above.

Created a fix - #164

@ikatson ikatson closed this as completed in e03adfb Aug 3, 2024
@Xygyl
Copy link
Author

Xygyl commented Aug 3, 2024

Thank you very much! Once this gets implemented in a release I can finally switch completely from aria2.

@ikatson
Copy link
Owner

ikatson commented Aug 3, 2024

@Xygyl did you run it to check if it helps in your case?

@Xygyl
Copy link
Author

Xygyl commented Aug 3, 2024

It worked perfectly. My gratitude is more than my words can express. Thank you very much!

@ikatson
Copy link
Owner

ikatson commented Aug 6, 2024

@Xygyl released 6.0.0 today :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants