mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
set pdf state to success even if download has not completed
This commit is contained in:
parent
26a5b5dae1
commit
c08c710601
2 changed files with 9 additions and 2 deletions
|
|
@ -154,7 +154,7 @@ extension DataService {
|
|||
return
|
||||
}
|
||||
|
||||
if status == .succeeded {
|
||||
if status == .succeeded || result.item.isPDF {
|
||||
do {
|
||||
try self?.persistArticleContent(
|
||||
item: result.item,
|
||||
|
|
@ -174,7 +174,7 @@ extension DataService {
|
|||
let articleContent = ArticleContent(
|
||||
htmlContent: result.htmlContent,
|
||||
highlightsJSONString: result.highlights.asJSONString,
|
||||
contentStatus: .make(from: result.contentStatus)
|
||||
contentStatus: result.item.isPDF ? .succeeded : .make(from: result.contentStatus)
|
||||
)
|
||||
|
||||
continuation.resume(returning: articleContent)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ struct InternalLinkedItem {
|
|||
let contentReader: String?
|
||||
var labels: [InternalLinkedItemLabel]
|
||||
|
||||
var isPDF: Bool {
|
||||
if let contentReader = contentReader {
|
||||
return contentReader == "PDF"
|
||||
}
|
||||
return (pageURLString ?? "").hasSuffix("pdf")
|
||||
}
|
||||
|
||||
func asManagedObject(inContext context: NSManagedObjectContext) -> LinkedItem {
|
||||
let existingItem = LinkedItem.lookup(byID: id, inContext: context)
|
||||
let linkedItem = existingItem ?? LinkedItem(entity: LinkedItem.entity(), insertInto: context)
|
||||
|
|
|
|||
Loading…
Reference in a new issue