         deleteMediaDownload(media)
     }
     
-    fileprivate func deleteMediaDownload(_ media: SambaMediaConfig, _ isError: Bool = false) {
+    fileprivate func deleteMediaDownload(_ media: SambaMediaConfig, _ isError: Bool = false, _ isNotify: Bool = true) {
         
         do {
             guard let localFileLocation = OfflineUtils.localAssetForMedia(withMedia: media)?.url else {

                            print("An unexpected error occured \(error.domain)")
                    }
                    
                    deleteMediaDownload(media, isError)

                    downloadState = DownloadState.from(state: isError ? DownloadState.State.FAILED : DownloadState.State.CANCELED, totalDownloadSize: 0, downloadPercentage: 0, media: media)
                    

            OfflineUtils.removeMediaLocation(from: media)
            sambaMediasDownloaded.removeAll(where: {$0.id == media.id})
            OfflineUtils.persistDownloadedMedias(sambaMediasDownloaded)
            
            
            if isNotify {
                let downloadState = DownloadState.from(state: isError ? DownloadState.State.FAILED : DownloadState.State.DELETED , totalDownloadSize: media.downloadData?.totalDownloadSizeInMB ?? 0, downloadPercentage: 0, media: media)
                
                OfflineUtils.sendNotification(with: downloadState)
            }
         
        } catch {
            print("An error occured deleting the file: \(error)")
        }
