Skip to content

Commit

Permalink
Remove duplicate method
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-osm committed Jul 20, 2024
1 parent 2564c3c commit 09a0f01
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,6 @@ class DownloadingCellResourceHelper: DownloadingCellBaseHelper {

// MARK: - Downloading cell progress observer's methods

func refreshDownloadingContent() {
for resourceId in resourceItems.keys {
if let task = getDownloadTask(resourceId) {
if task.progressCompleted == 1 {
DispatchQueue.main.async { [weak self] in
self?.setCellProgress(resourceId: resourceId, progress: task.progressCompleted, status: .finished)
// Start next downloading if needed
if let tasks = OsmAndApp.swiftInstance().downloadsManager.keysOfDownloadTasks(), !tasks.isEmpty {
if let nextTask = OsmAndApp.swiftInstance().downloadsManager.firstDownloadTasks(withKey: tasks[0] as? String) {
nextTask.resume()
}
}
}
} else if task.progressCompleted > 0 {
DispatchQueue.main.async { [weak self] in
self?.setCellProgress(resourceId: resourceId, progress: task.progressCompleted, status: .inProgress)
}
}
}
}
}

@objc private func onDownloadResourceTaskProgressChanged(observer: Any, key: Any, value: Any) {
guard let resourceId = getResourceIdFromNotificationKey(key: key, value: value) else { return }
guard let parsedValue = value as? NSNumber else { return }
Expand Down

0 comments on commit 09a0f01

Please sign in to comment.