-
hi all. I need to generate thumbnails as soon as the download completes, so I need to make sure the file has been written. I see that there are different ways to do this: 1. BytesCompleted == TotalLength
2. BytesMissing == 0 Which one is more appropriate for this scenario? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
My strategy for thumbnails is to provide the file as an input over HTTP, and let it use the streaming support in anacrolix/torrent to just fetch what it needs. It typically results in thumbnails appearing long before file is completely downloaded. Here's the implementation I use: https://github.com/anacrolix/webtorrent-public/blob/master/services/poster.go. See how it's done in https://www.coveapp.info/ for a demo. |
Beta Was this translation helpful? Give feedback.
My strategy for thumbnails is to provide the file as an input over HTTP, and let it use the streaming support in anacrolix/torrent to just fetch what it needs. It typically results in thumbnails appearing long before file is completely downloaded.
Here's the implementation I use: https://github.com/anacrolix/webtorrent-public/blob/master/services/poster.go.
See how it's done in https://www.coveapp.info/ for a demo.