rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.39k stars 600 forks source link

Feature Request: Copy downloads using hardlinks #3197

Open rlue opened 5 years ago

rlue commented 5 years ago

I have the following post-processing settings configured:

[x] Move downloads to Destination Folder [x] Keep original folder (i.e. copy)?

This all works, but it creates a duplicate copy of all the files on my hard drive, which takes up a lot of unnecessary space. Is there any way to make Headphones copy recursively using hardlinks instead?

Progress

Unfortunately, I'm not very familiar with python. I did notice that headphones uses shutil.copytree to copy the download to the destination directory. Per this SO answer, shutil supports an option for creating hardlinks instead:

shutil.copytree(src, dst, copy_function=os.link)

but according to these docs, this optional argument was only added in Python 3.2?

I also don't know if you'd want to hide this behind a config option, rather than making it the default behavior.

What are the chances we could get this option implemented?