Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
PruthiviRaj27 committed Jan 31, 2024
1 parent 63d561e commit 9f13d6a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions Source/Database/TPStreamsDownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,6 @@ public final class TPStreamsDownloadManager {
}
}
}

public func getAllOfflineAssets() -> [OfflineAsset]{
return Array(OfflineAsset.manager.getAll())
}

public func pauseDownload(_ offlineAsset: OfflineAsset) {
if let task = assetDownloadDelegate.activeDownloadsMap.first(where: { $0.value == offlineAsset })?.key {
task.suspend()
OfflineAsset.manager.update(object: offlineAsset, with: ["status": Status.paused.rawValue])
}
}

public func resumeDownload(_ offlineAsset: OfflineAsset) {
if let task = assetDownloadDelegate.activeDownloadsMap.first(where: { $0.value == offlineAsset })?.key {
if task.state != .running {
task.resume()
OfflineAsset.manager.update(object: offlineAsset, with: ["status": Status.inProgress.rawValue])
}
}
}

public func getAllOfflineAssets() -> [OfflineAsset]{
return Array(OfflineAsset.manager.getAll())
Expand Down

0 comments on commit 9f13d6a

Please sign in to comment.