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

Group downloaded files by purchase #6

Open
MayeulC opened this issue Apr 21, 2018 · 1 comment
Open

Group downloaded files by purchase #6

MayeulC opened this issue Apr 21, 2018 · 1 comment
Milestone

Comments

@MayeulC
Copy link
Owner

MayeulC commented Apr 21, 2018

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?

  • hardlinks remain valid when moving original files around (both the file and the link is an "original file")
  • changing content from a hardlink changes the original as well
  • symlinks can span multiple filesystems
  • symlinks are usually better understood

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:

  • group by bundle/store purchase/monthly by creating one such subfolder in by-purchase
    • Alternatively, create three top-level directories by-bundle, by-store-purchase, by-monthly
  • to avoid cluttering the top level directory, create another folder, by-product that has the current contents.

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 MayeulC changed the title Sort products by purchase Group downloaded files by purchase May 8, 2018
@MayeulC
Copy link
Owner Author

MayeulC commented May 9, 2018

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)

@MayeulC MayeulC added this to the 0.6 milestone May 9, 2018
@MayeulC MayeulC modified the milestones: 0.6, 0.7 Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant