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, guard let url = webView.request?.URL,
let article = Article.addOrUpdate(url: url, context: NSManagedObjectContext.mainQueueContext) else {return} let article = Article.addOrUpdate(url: url, context: NSManagedObjectContext.mainQueueContext) else {return}
article.title = JSInjection.getTitle(from: webView) article.title = JSInjection.getTitle(from: webView)
article.thumbImageURL = URLResponseCache.shared.firstImage()?.absoluteString article.thumbImageURL = URLResponseCache.shared.firstImage()?.path
self.article = article self.article = article
// UI Updates // UI Updates

View File

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

View File

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

View File

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