File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -230,17 +230,18 @@ var downloadedItems = previousDownloadedItems
230230
231231await withTaskGroup ( of: Void . self) { group in
232232 for portalItem in portalItems {
233- // Checks to see if an item is already downloaded.
234- guard downloadedItems [ portalItem. identifier] == nil else {
235- print ( " note: Item already downloaded: \( portalItem. identifier) " )
236- continue
237- }
238-
239233 let destinationURL = downloadDirectoryURL. appendingPathComponent (
240234 portalItem. identifier,
241235 isDirectory: true
242236 )
243237
238+ // Checks to see if an item needs downloading.
239+ guard downloadedItems [ portalItem. identifier] == nil ||
240+ !FileManager. default. fileExists ( atPath: destinationURL. path) else {
241+ print ( " note: Item already downloaded: \( portalItem. identifier) " )
242+ continue
243+ }
244+
244245 // Deletes the directory when the item is not in the plist.
245246 try ? FileManager . default. removeItem ( at: destinationURL)
246247
You can’t perform that action at this time.
0 commit comments