GetBlockCounts returns a map filename -> number of blocks downloaded for the given folder.
(folder string)
| 152 | // GetBlockCounts returns a map filename -> number of blocks downloaded for the |
| 153 | // given folder. |
| 154 | func (t *deviceDownloadState) GetBlockCounts(folder string) map[string]int { |
| 155 | if t == nil { |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | t.mut.RLock() |
| 160 | defer t.mut.RUnlock() |
| 161 | |
| 162 | for name, state := range t.folders { |
| 163 | if name == folder { |
| 164 | return state.GetBlockCounts() |
| 165 | } |
| 166 | } |
| 167 | return nil |
| 168 | } |
| 169 | |
| 170 | func (t *deviceDownloadState) BytesDownloaded(folder string) int64 { |
| 171 | if t == nil { |