retry method

Future<void> retry(
  1. String id
)

Starts a finished or failed task over from byte zero.

Implementation

Future<void> retry(String id) async {
  final UDownloadTask? task = this.task(id);
  if (task == null || task.isActive) return;
  await _deletePart(task);
  task
    ..segments.clear()
    ..received = 0
    ..total = -1
    ..error = null
    ..mirrorIndex = 0
    ..status = UDownloadStatus.queued;
  _changed(task);
  _pump();
}