Skip to content

Commit b1e2fe6

Browse files
committed
Append bundle identifier to cache path
~/Library/Caches gets polluted without this.
1 parent 914daec commit b1e2fe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PodcastMenu/ImageCache.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class ImageCache {
2626
let filebase = imageUrl.path.replacingOccurrences(of: "/", with: "_")
2727
let filename = filebase + "-" + imageUrl.lastPathComponent
2828

29-
let path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first! + "/" + filename + "-" + imageUrl.lastPathComponent
29+
let path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first! + "/" + Bundle.main.bundleIdentifier! + "/ImageCache/" + filename + "-" + imageUrl.lastPathComponent
3030

3131
return URL(fileURLWithPath: path)
3232
}

0 commit comments

Comments
 (0)