     
     func syncWithFileSystem() {
         let videosPath = Preferences.shared.localVideoStorageURL.path
-        enumerateVideoFiles(videosPath)
+        updateDownloadedFlagsByEnumeratingFilesAtPath(videosPath)
     }
     
     func monitorDownloadsFolder() {

        
        mainDirURL.subDirectories.forEach { subdir in
            guard let monitor = DTFolderMonitor(for: subdir, block: { [unowned self] in
                self.enumerateVideoFiles(mainDirURL.path)
            }) else { return }
            
            subfoldersMonitors.append(monitor)

    }
    
    /// Updates the downloaded status for the sessions on the database based on the existence of the downloaded video file
    fileprivate func updateDownloadedFlagsByEnumeratingFilesAtPath(_ path: String) {
        guard let enumerator = FileManager.default.enumerator(atPath: path) else { return }
        guard let files = enumerator.allObjects as? [String] else { return }
        
        // existing/added files
        DispatchQueue.main.async {
            self.storage.update {
                
                // added/existing files
                
                files.forEach { file in
                    guard let asset = self.storage.realm.objects(SessionAsset.self).filter("relativeLocalURL == %@", file).first else { return }
                    
                    if asset.session.first?.isDownloaded == false {
                        asset.session.first?.isDownloaded = true
                    }
                    
                    NotificationCenter.default.post(name: .DownloadManagerFileAddedNotification, object: file)
                }
                
                if self.existingVideoFiles.count == 0 {
                    self.existingVideoFiles = files
                    return
                }
                
                // removed files
                
                let removedFiles = self.existingVideoFiles.filter { !files.contains($0) }
                
                removedFiles.forEach { file in
                    guard let asset = self.storage.realm.objects(SessionAsset.self).filter("relativeLocalURL == %@", file).first else { return }
                    
                    if asset.session.first?.isDownloaded == true {
                        asset.session.first?.isDownloaded = false
                    }
                    
                    NotificationCenter.default.post(name: .DownloadManagerFileDeletedNotification, object: file)
                }
                
            }
        }
    }
