These are chat archives for anacrolix/torrent

1st
Jun 2017
Matt Joiner
@anacrolix
Jun 01 2017 03:45
where would you put it? in type PieceState?
@elgatito ^
it's a very likely yes, i didn't realise that's something axet had
Denis
@elgatito
Jun 01 2017 04:14
@anacrolix probably yes, somewhere like PieceState, not needed always, not needed for all pieces, so will take a look
Matt Joiner
@anacrolix
Jun 01 2017 05:26
after a quick look, i think that's probably the place to do it. I also think missing bytes is very quick to calculate for an arbitrary piece.
Matt Joiner
@anacrolix
Jun 01 2017 05:32
actually it's not good, it won't work with piecestateruns
it'll have to be on something else
Denis
@elgatito
Jun 01 2017 06:23
@anacrolix , not sure that commit about making directory for bolt piece completion was connecetd to #158. There should be a db.Close() call if created by NewBoltPieceCompletion
to allow boltdb lock database again
Matt Joiner
@anacrolix
Jun 01 2017 06:24
Yes it was completely unrelated to that issue
coincidental
Denis
@elgatito
Jun 01 2017 06:24
then sorry)
Matt Joiner
@anacrolix
Jun 01 2017 06:30
i've had a sudden surge in issues reported in the last few days
but i'm working full time so i don't have as much time
Denis
@elgatito
Jun 01 2017 09:43
when torrent is added to client, all files are marked to download by default?
when I add one, and loop through each file, mark which I want to download,() other mark as cancel(), but I see files are created on the disk, not only the files I've selected
Matt Joiner
@anacrolix
Jun 01 2017 12:27
All files are not marked as download to begin with. However the pieces do not align with the file boundaries exactly, so marking a file for download, may download parts of surrounding files where those pieces overlap.
Denis
@elgatito
Jun 01 2017 12:28
hm... I'm doing Download() on a file (episode from a series bundle), but first another episode if fully allocated on the disk\
Matt Joiner
@anacrolix
Jun 01 2017 12:29
another episode is fully allocated?
Denis
@elgatito
Jun 01 2017 12:31

```
-rw-r----- 1 e e 620924928 jun 1 13:11 ---.s01e03.---.avi
-rw-r----- 1 e e 6356992 jun 1 13:11 ---.s01e05.---.avi
-rw-r----- 1 e e 722114560 jun 1 13:09 ---.s01e10.---.avi

``` s01e03 - is the one I've selected with Download()

Matt Joiner
@anacrolix
Jun 01 2017 12:34
You should find that s01e10 is not completed. Further, the torrent info likely has the files ordered e10, e03, then e05. There's no requirement that they be ordered lexically. Only the last bytes of e10 will be correct. The rest will probably be zeroes.
The implementation writes the bytes for pieces directly to their final location in the files. Depending on your OS, e10 could be 722MB on disk, or only the parts that have been actually written.
Denis
@elgatito
Jun 01 2017 12:35
Got it. Thanks