]> Sergey Matveev's repositories - btrtrc.git/commit
fix `Spec.Storage` and allow per-torrent dir
authorChris Walker <chris@thechriswalker.net>
Thu, 16 Mar 2017 14:24:54 +0000 (14:24 +0000)
committerChris Walker <chris@thechriswalker.net>
Thu, 16 Mar 2017 14:40:21 +0000 (14:40 +0000)
commit9d96cd659f4f9beb2cfe72d43e40972a6d69af80
tree23cbb1971e32e16227b44af228e6d5c888dd2bff
parentba3e798b5f050de4b60e0ca163c7c4f567ee7287
fix `Spec.Storage` and allow per-torrent dir

`TorrentSpec.Storage` was not honored when calling `Client.AddTorrentSpec`
and the configured `cfg.DefaultStorage` was always used. Now if you construct
your `TorrentSpec` you can specify any `StorageImpl`

Also, the most common use case for custom storage being per-torrent paths for
FileStorage, this adds a `pathMaker` function to the File implementation that
allows customization, along with the default (always use base path) and my use
case (which seemed common enough from the Gitter chat) which is infohash based
subdirectories.

All Public methods have not changed signature, but 1 private method did, hence
the test update.
client.go
storage/file.go
torrent_test.go