markComplete static method

Future<void> markComplete(
  1. String url,
  2. int totalBytes
)

Mark download as complete.

Implementation

static Future<void> markComplete(String url, int totalBytes) async {
  await _ensureLoaded();

  final existing = _cache[url];
  _cache[url] = CacheMetadata(
    downloadedBytes: totalBytes,
    totalBytes: totalBytes,
    isComplete: true,
    lastUpdated: DateTime.now(),
    isHls: existing?.isHls ?? false,
  );

  await _persist();
}