mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #598 from omnivore-app/fix/money-stuff-title
Use newsletter's title and author from emails
This commit is contained in:
commit
b409f40d89
5 changed files with 10 additions and 14 deletions
|
|
@ -35,22 +35,19 @@ export const saveEmail = async (
|
|||
},
|
||||
true
|
||||
)
|
||||
|
||||
const title = input.title
|
||||
const content = parseResult.parsedContent?.content || input.originalContent
|
||||
const slug = generateSlug(title)
|
||||
|
||||
const slug = generateSlug(input.title)
|
||||
const metadata = await parseUrlMetadata(url)
|
||||
|
||||
const articleToSave: Page = {
|
||||
id: '',
|
||||
userId: ctx.uid,
|
||||
slug,
|
||||
content,
|
||||
originalHtml: input.originalContent,
|
||||
content: content,
|
||||
description: metadata?.description || parseResult.parsedContent?.excerpt,
|
||||
title: metadata?.title || parseResult.parsedContent?.title || title,
|
||||
author:
|
||||
metadata?.author || parseResult.parsedContent?.byline || input.author,
|
||||
title: input.title,
|
||||
author: input.author,
|
||||
url: normalizeUrl(parseResult.canonicalUrl || url, {
|
||||
stripHash: true,
|
||||
stripWWW: false,
|
||||
|
|
@ -59,7 +56,6 @@ export const saveEmail = async (
|
|||
hash: stringToHash(content),
|
||||
image: metadata?.previewImage || parseResult.parsedContent?.previewImage,
|
||||
publishedAt: validatedDate(parseResult.parsedContent?.publishedDate),
|
||||
slug: slug,
|
||||
createdAt: new Date(),
|
||||
savedAt: new Date(),
|
||||
readingProgressAnchorIndex: 0,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -77,7 +77,7 @@ export class NewsletterHandler {
|
|||
const url =
|
||||
this.parseNewsletterUrl(postHeader, html) ||
|
||||
`${this.defaultUrl}?source=newsletters&id=${uuidv4()}`
|
||||
const author = this.parseAuthor(from) || 'Unknown'
|
||||
const author = this.parseAuthor(from)
|
||||
const unsubscribe = this.parseUnsubscribe(unSubHeader)
|
||||
const message = {
|
||||
email,
|
||||
|
|
|
|||
Loading…
Reference in a new issue