webtorrent / create-torrent

Create .torrent files
https://webtorrent.io
MIT License
341 stars 93 forks source link

Allow to exclude the root folder name from file paths #166

Closed 0Dmitry closed 2 years ago

0Dmitry commented 2 years ago

What version of this package are you using? 5.0.2 What problem do you want to solve? I want to create a torrent file from a folder but I don't want the file paths within the generated torrent file to contain that folder name. For example if I have a this folder structure

MyRootFolder
--- folder1
------ file1.txt
--- file2.txt

In resulting torrent file I want to get this structure:

folder1
--- file1.txt
--- file2.txt

But instead I am getting the original structure with the MyRootFolder as the root folder.

I tried to pass the files to the createTorrent function as an array of stream.Readable with the path props modified, so they don't contain MyRootFolder. Also tried setting the name property. I didn't get the desired result in any case.

What do you think is the correct solution to this problem? Provide a way to exclude the root folder name from the file paths within the torrent file, so only the content of the specified folder is included without the folder itself.

github-actions[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?