MayeulC / hb-downloader

An automated utility to download your Humble Bundle purchases.
MIT License
68 stars 11 forks source link

Group downloaded files by purchase #6

Open MayeulC opened 6 years ago

MayeulC commented 6 years ago

Original issue/proposal

Originally asked by @tobias-p in #4.

if possible, could you alter the downloader, so that everything is downloaded by bundle?

For example, I have single games bought in hb where it is ok that the downloader creates a folder called like the game, but another game within a bundle is also downloaded in just a folder called like the game itself.

For example:

bought bioshock in hb store: then download to "/destination/bioshock/..." is ok got bioshock within a bundle: then download should go to "/destination/bundlename/bioshock/..."

this would make it easier to check out, which bundles are alreday downloaded.

Proposed implementation

The major issue I see with this if using a naive implementation, is that it would take two times as much disk space, and bandwidth to download duplicate games. I would rather create a new folder, "by-purchase", or something like this, containing one subfolder for each purchase, and symlinks to the actual files.

Proposed organization, that just adds a "by-purchase" folder:

.
├── by-purchase
│   ├── Humble indie bundle X
│   │   ├── product01 -> ../../product01
│   │   └── product02 -> ../../product02
│   └── Humble store product 01
│       └── product01 -> ../../product01
├── product01
│   ├── audio
│   ├── linux
│   ├── mac
│   └── windows
└── product02
    ├── ebook
    ├── linux
    └── windows

See alternative trees at the end of the post.

Now, one question: symlinks, or hardlinks?

I have an issue with symlinks, though. On windows, as far as I know, only ntfs supports them (maybe vfat as well), and before the creators update, you had to be root/administrator to create one. Maybe we can try to do so, and fallback to .lnk if that doesn't work.

Alternative organizations:

Configuration:

I would make this optional (though probably enabled by default), behind a configuration switch. When disabled, she structure should remain the current one. This might not be easily backwards-compatible if the above feature (storing products in a by-products folder) is implemented. If so, I would probably always leave the downloads in by-product.

MayeulC commented 6 years ago

I will probably implement this after I finish adding tests for everything sensible. Probably with symlinks by default, and hardlinks on windows (with os.link)