mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Remove debug lines
This commit is contained in:
parent
7084f18932
commit
2a7a87de09
3 changed files with 4 additions and 19 deletions
|
|
@ -142,7 +142,6 @@ import Utils
|
|||
// NOTE: the issue here is the PDF is downloaded, but saved to a URL we don't know about
|
||||
// because it is changed.
|
||||
let pdfURL = await viewModel.downloadPDF(dataService: dataService)
|
||||
print("PDF URL", pdfURL)
|
||||
if let pdfURL = pdfURL {
|
||||
let document = HighlightedDocument(url: pdfURL, viewModel: viewModel)
|
||||
pdfStateObject.document = document
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ public final class PDFViewerViewModel: ObservableObject {
|
|||
if let tempURL = pdfItem.tempPDFURL {
|
||||
if let localURL = try? PDFUtils.copyToLocal(url: tempURL) {
|
||||
return tempURL
|
||||
// return URL(string: localURL)
|
||||
}
|
||||
}
|
||||
if let localURL = try await dataService.fetchPDFData(slug: pdfItem.slug, pageURLString: pdfItem.originalArticleURL) {
|
||||
|
|
|
|||
|
|
@ -251,30 +251,17 @@ public extension DataService {
|
|||
}
|
||||
}
|
||||
|
||||
if item.isPDF {
|
||||
if needsPDFDownload {
|
||||
print("PDF does not exist, downloading", item.id, item.title)
|
||||
try await backgroundContext.perform {
|
||||
let fetchRequest: NSFetchRequest<Models.LinkedItem> = LinkedItem.fetchRequest()
|
||||
fetchRequest.predicate = NSPredicate(format: "id == %@", item.id)
|
||||
|
||||
let existingItem = try? self.backgroundContext.fetch(fetchRequest).first
|
||||
print("EXISTING ITEM", existingItem)
|
||||
}
|
||||
|
||||
try await fetchPDFData(slug: item.slug, pageURLString: item.pageURLString)
|
||||
} else {
|
||||
print("PDF already exists, not downloading", item.id)
|
||||
}
|
||||
if item.isPDF && needsPDFDownload {
|
||||
try await fetchPDFData(slug: item.slug, pageURLString: item.pageURLString)
|
||||
}
|
||||
|
||||
try await backgroundContext.perform { [weak self] in
|
||||
do {
|
||||
try self?.backgroundContext.save()
|
||||
// logger.debug("ArticleContent saved succesfully")
|
||||
logger.debug("ArticleContent saved succesfully")
|
||||
} catch {
|
||||
self?.backgroundContext.rollback()
|
||||
// logger.debug("Failed to save ArticleContent")
|
||||
logger.debug("Failed to save ArticleContent")
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue