chore: removed code

This commit is contained in:
Fredrik Burmester
2025-02-17 14:19:29 +01:00
parent 9ca0f04278
commit 8924dd2ce8
3 changed files with 0 additions and 57 deletions

View File

@@ -25,14 +25,6 @@ function downloadHLSAsset(
HlsDownloaderModule.downloadHLSAsset(id, url, metadata);
}
/**
* Checks for existing downloads.
* Returns an array of downloads with additional fields:
*/
async function checkForExistingDownloads(): Promise<DownloadInfo[]> {
return HlsDownloaderModule.checkForExistingDownloads();
}
/**
* Cancels an ongoing download.
* @param id - The unique identifier for the download.
@@ -105,7 +97,6 @@ function useDownloadError(): string | null {
export {
downloadHLSAsset,
checkForExistingDownloads,
useDownloadError,
useDownloadProgress,
addCompleteListener,

View File

@@ -144,30 +144,6 @@ public class HlsDownloaderModule: Module {
}
}
Function("checkForExistingDownloads") {
() -> [[String: Any]] in
var downloads: [[String: Any]] = []
for (id, pair) in self.activeDownloads {
let task = pair.task
let delegate = pair.delegate
let metadata = pair.metadata
let startTime = pair.startTime
let downloaded = delegate.downloadedSeconds
let total = delegate.totalSeconds
let progress = total > 0 ? downloaded / total : 0
downloads.append([
"id": delegate.providedId.isEmpty ? String(id) : delegate.providedId,
"progress": progress,
"secondsDownloaded": downloaded,
"secondsTotal": total,
"state": self.mappedState(for: task),
"metadata": metadata,
"startTime": startTime,
])
}
return downloads
}
Function("cancelDownload") { (providedId: String) -> Void in
guard
let entry = self.activeDownloads.first(where: { $0.value.delegate.providedId == providedId }