fix: Fix invalid download path with single-file torrents #651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #648.
You can't have multiple files at the root of a torrent. It's either a single file or a directory containing multiple files.
AllDebrid goes along with this and doesn't place torrents in a directory if it only contains a single file. RDT didn't handle this case.
This was fine, except for the people using AllDebrid with the rclone/symlink downloader. People using the other downloaders would've noticed that their files got placed into a directory with the same name as the file it contains, which shouldn't happen.
I've tested this with AllDebrid and the internal downloader using a single-file torrent and a multi-file torrent,
<nyaa dot si>/view/1806288
and<nyaa dot si>/view/1350495
respectively. The single-file torrent was placed in/data/downloads/FILE.mkv
, and the files and directories of the multi-file torrent were placed in/data/downloads/TORRENTNAME/
, which is what I expected to see.@Cucumberrbob @bob1321 Can you please let me know if this has fixed your issue? I believe it should've.
@rogerfar, or anyone with access to RealDebrid, can you check if this still works as expected for you?
If not, we may have to add a check for AllDebrid and only do this when AllDebrid is used to download the torrent.