Change wire statistics update interval
This commit is contained in:
		
							parent
							
								
									201ee9813f
								
							
						
					
					
						commit
						734e791045
					
				| @ -117,14 +117,16 @@ export default { | |||||||
| 
 | 
 | ||||||
|         torrent.on('upload', bytes => { |         torrent.on('upload', bytes => { | ||||||
|           state.uploaded += bytes |           state.uploaded += bytes | ||||||
|           updateWireStatistics() |  | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|         torrent.on('wire', wire => { |         torrent.on('wire', wire => { | ||||||
|           updateWireStatistics() |  | ||||||
|           toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) |           toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|  |         setInterval(() => { | ||||||
|  |           updateWireStatistics() | ||||||
|  |         }, 200) | ||||||
|  | 
 | ||||||
|         toast.add({ severity: 'success', summary: 'Video added', detail: `You are now sharing ${video.name}`, life: 5000 }) |         toast.add({ severity: 'success', summary: 'Video added', detail: `You are now sharing ${video.name}`, life: 5000 }) | ||||||
|       }) |       }) | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -105,7 +105,6 @@ export default { | |||||||
|     const downloadVideo = (infoHash) => { |     const downloadVideo = (infoHash) => { | ||||||
|       webTorrent.add(infoHash, { announce: trackers }, torrent => { |       webTorrent.add(infoHash, { announce: trackers }, torrent => { | ||||||
|         torrent.on('wire', () => { |         torrent.on('wire', () => { | ||||||
|           updateWireStatistics() |  | ||||||
|           toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) |           toast.add({ severity: 'info', summary: 'New watcher', detail: 'Someone has joined your screen.', life: 3000 }) | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
| @ -114,7 +113,6 @@ export default { | |||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|         torrent.on('upload', bytes => { |         torrent.on('upload', bytes => { | ||||||
|           updateWireStatistics() |  | ||||||
|         }) |         }) | ||||||
| 
 | 
 | ||||||
|         torrent.on('download', bytes => { |         torrent.on('download', bytes => { | ||||||
| @ -124,7 +122,6 @@ export default { | |||||||
|           } |           } | ||||||
|           state.downloaded += bytes |           state.downloaded += bytes | ||||||
|           progress.value = state.downloaded / video.size * 100 |           progress.value = state.downloaded / video.size * 100 | ||||||
|           updateWireStatistics() |  | ||||||
|         }) |         }) | ||||||
|       }) |       }) | ||||||
|     } |     } | ||||||
| @ -148,6 +145,10 @@ export default { | |||||||
|       }) |       }) | ||||||
| 
 | 
 | ||||||
|       file.renderTo(player.value) |       file.renderTo(player.value) | ||||||
|  | 
 | ||||||
|  |       setInterval(() => { | ||||||
|  |         updateWireStatistics() | ||||||
|  |       }, 200) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     const updateWireStatistics = () => { |     const updateWireStatistics = () => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user