article thumb data path

This commit is contained in:
Chris Li 2016-09-29 16:24:41 -04:00
parent 79eabd2e90
commit 31aa28e2c3
4 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate, LPT
guard let url = webView.request?.URL,
let article = Article.addOrUpdate(url: url, context: NSManagedObjectContext.mainQueueContext) else {return}
article.title = JSInjection.getTitle(from: webView)
article.thumbImageURL = URLResponseCache.shared.firstImage()?.absoluteString
article.thumbImageURL = URLResponseCache.shared.firstImage()?.path
self.article = article
// UI Updates

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.1476</string>
<string>1.8.1479</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.1480</string>
<string>1.8.1483</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>

View File

@ -51,8 +51,8 @@ class Article: NSManagedObject {
}
var thumbImageData: NSData? {
if let urlString = thumbImageURL,
let url = NSURL(string: urlString),
if let bookID = book?.id, let path = thumbImageURL,
let url = NSURL(bookID: bookID, contentPath: path),
let data = NSData(contentsOfURL: url) {
return data
} else {