                 return
             }
             
+            DispatchQueue.main.async {
+                NotificationCenter.default.post(name: .downloadStarted, object: nil, userInfo: [Episode.episodeKey:downloadingEpisode])
+            }
+            
             guard shouldDownload() else {
                 return
             }

    
    func resumeDownloadingEpisode(downloadingEpisode: DownloadingEpisode) {
        
        guard shouldDownload() else {
            return
        }
        
        if let downloadTaskResumeData = downloadingEpisode.taskResumeData {
            let downloadTask = downloadSession.downloadTask(withResumeData: downloadTaskResumeData)
            downloadingEpisode.taskIdentifier = downloadTask.taskIdentifier
            downloadingEpisode.taskResumeData = nil
            
            let taskID = beginBackgroundTask()
            downloadTask.resume()
            endBackgroundTask(taskID)
            
            DispatchQueue.main.async {
               NotificationCenter.default.post(name: .downloadResumed, object: nil, userInfo: [Episode.episodeKey:downloadingEpisode])
            }
        }
    }
    

            downloadTask.resume()
            endBackgroundTask(taskID)
            
        }
    }
    
