Fix pathing problem with icon image urls
This commit is contained in:
parent
f22c3c644c
commit
051309d98b
|
@ -107,10 +107,11 @@ extension Article {
|
||||||
if let image = iconImage() {
|
if let image = iconImage() {
|
||||||
let fm = FileManager.default
|
let fm = FileManager.default
|
||||||
var path = fm.urls(for: .cachesDirectory, in: .userDomainMask)[0]
|
var path = fm.urls(for: .cachesDirectory, in: .userDomainMask)[0]
|
||||||
|
let feedID = webFeed.webFeedID.replacingOccurrences(of: "/", with: "_")
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
path.appendPathComponent(webFeed.webFeedID + "_smallIcon.tiff")
|
path.appendPathComponent(feedID + "_smallIcon.tiff")
|
||||||
#else
|
#else
|
||||||
path.appendPathComponent(webFeed.webFeedID + "_smallIcon.png")
|
path.appendPathComponent(feedID + "_smallIcon.png")
|
||||||
#endif
|
#endif
|
||||||
fm.createFile(atPath: path.path, contents: image.image.dataRepresentation()!, attributes: nil)
|
fm.createFile(atPath: path.path, contents: image.image.dataRepresentation()!, attributes: nil)
|
||||||
return path
|
return path
|
||||||
|
|
Loading…
Reference in New Issue