mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
rename preview_content to feed_content in library_item table and gql schema
This commit is contained in:
parent
61e9ab3a17
commit
08e4bed146
8 changed files with 34 additions and 12 deletions
|
|
@ -191,7 +191,7 @@ export class LibraryItem {
|
|||
links?: any | null
|
||||
|
||||
@Column('text')
|
||||
previewContent?: string | null
|
||||
feedContent?: string | null
|
||||
|
||||
@Column('text')
|
||||
previewContentType?: string | null
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ export type Article = {
|
|||
contentReader: ContentReader;
|
||||
createdAt: Scalars['Date'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
feedContent?: Maybe<Scalars['String']>;
|
||||
folder: Scalars['String'];
|
||||
hasContent?: Maybe<Scalars['Boolean']>;
|
||||
hash: Scalars['String'];
|
||||
|
|
@ -2396,6 +2397,7 @@ export type SearchItem = {
|
|||
contentReader: ContentReader;
|
||||
createdAt: Scalars['Date'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
feedContent?: Maybe<Scalars['String']>;
|
||||
folder: Scalars['String'];
|
||||
highlights?: Maybe<Array<Highlight>>;
|
||||
id: Scalars['ID'];
|
||||
|
|
@ -2408,7 +2410,6 @@ export type SearchItem = {
|
|||
ownedByViewer?: Maybe<Scalars['Boolean']>;
|
||||
pageId?: Maybe<Scalars['ID']>;
|
||||
pageType: PageType;
|
||||
previewContent?: Maybe<Scalars['String']>;
|
||||
previewContentType?: Maybe<Scalars['String']>;
|
||||
publishedAt?: Maybe<Scalars['Date']>;
|
||||
quote?: Maybe<Scalars['String']>;
|
||||
|
|
@ -4584,6 +4585,7 @@ export type ArticleResolvers<ContextType = ResolverContext, ParentType extends R
|
|||
contentReader?: Resolver<ResolversTypes['ContentReader'], ParentType, ContextType>;
|
||||
createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
feedContent?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
folder?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
hasContent?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
hash?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
|
|
@ -5930,6 +5932,7 @@ export type SearchItemResolvers<ContextType = ResolverContext, ParentType extend
|
|||
contentReader?: Resolver<ResolversTypes['ContentReader'], ParentType, ContextType>;
|
||||
createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
feedContent?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
folder?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
||||
highlights?: Resolver<Maybe<Array<ResolversTypes['Highlight']>>, ParentType, ContextType>;
|
||||
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
||||
|
|
@ -5942,7 +5945,6 @@ export type SearchItemResolvers<ContextType = ResolverContext, ParentType extend
|
|||
ownedByViewer?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
pageId?: Resolver<Maybe<ResolversTypes['ID']>, ParentType, ContextType>;
|
||||
pageType?: Resolver<ResolversTypes['PageType'], ParentType, ContextType>;
|
||||
previewContent?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
previewContentType?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
publishedAt?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>;
|
||||
quote?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ type Article {
|
|||
contentReader: ContentReader!
|
||||
createdAt: Date!
|
||||
description: String
|
||||
feedContent: String
|
||||
folder: String!
|
||||
hasContent: Boolean
|
||||
hash: String!
|
||||
|
|
@ -1824,6 +1825,7 @@ type SearchItem {
|
|||
contentReader: ContentReader!
|
||||
createdAt: Date!
|
||||
description: String
|
||||
feedContent: String
|
||||
folder: String!
|
||||
highlights: [Highlight!]
|
||||
id: ID!
|
||||
|
|
@ -1836,7 +1838,6 @@ type SearchItem {
|
|||
ownedByViewer: Boolean
|
||||
pageId: ID
|
||||
pageType: PageType!
|
||||
previewContent: String
|
||||
previewContentType: String
|
||||
publishedAt: Date
|
||||
quote: String
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ const createTask = async (
|
|||
}
|
||||
|
||||
if (folder === 'following' && !fetchContent) {
|
||||
return createItemWithPreviewContent(userId, feedUrl, item)
|
||||
return createItemWithFeedContent(userId, feedUrl, item)
|
||||
}
|
||||
|
||||
logger.info(`adding fetch content task ${userId} ${item.link.trim()}`)
|
||||
|
|
@ -309,7 +309,7 @@ const fetchContentAndCreateItem = async (
|
|||
}
|
||||
}
|
||||
|
||||
const createItemWithPreviewContent = async (
|
||||
const createItemWithFeedContent = async (
|
||||
userId: string,
|
||||
feedUrl: string,
|
||||
item: RssFeedItem
|
||||
|
|
@ -321,7 +321,7 @@ const createItemWithPreviewContent = async (
|
|||
author: item.creator,
|
||||
description: item.summary,
|
||||
addedToFollowingFrom: 'feed',
|
||||
previewContent: item.content || item.contentSnippet || item.summary,
|
||||
feedContent: item.content || item.contentSnippet || item.summary,
|
||||
addedToFollowingBy: feedUrl,
|
||||
savedAt: item.isoDate,
|
||||
publishedAt: item.isoDate,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export interface SaveFollowingItemRequest {
|
|||
author?: string
|
||||
description?: string
|
||||
links?: any
|
||||
previewContent?: string
|
||||
feedContent?: string
|
||||
previewContentType?: string
|
||||
publishedAt?: Date
|
||||
savedAt?: Date
|
||||
|
|
@ -76,7 +76,7 @@ export function followingServiceRouter() {
|
|||
const url = cleanUrl(req.body.url)
|
||||
|
||||
const preparedDocument: PreparedDocumentInput = {
|
||||
document: req.body.previewContent || '',
|
||||
document: req.body.feedContent || '',
|
||||
pageInfo: {
|
||||
title: req.body.title,
|
||||
author: req.body.author,
|
||||
|
|
@ -89,7 +89,7 @@ export function followingServiceRouter() {
|
|||
let parsedResult: ParsedContentPuppeteer | undefined
|
||||
|
||||
// parse the content if we have a preview content
|
||||
if (req.body.previewContent) {
|
||||
if (req.body.feedContent) {
|
||||
parsedResult = await parsePreparedContent(url, preparedDocument)
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ export function followingServiceRouter() {
|
|||
userId,
|
||||
slug,
|
||||
croppedPathname,
|
||||
originalHtml: req.body.previewContent,
|
||||
originalHtml: req.body.feedContent,
|
||||
itemType: parsedResult?.pageType || PageType.Unknown,
|
||||
canonicalUrl: url,
|
||||
folder: FOLDER,
|
||||
|
|
|
|||
|
|
@ -397,6 +397,7 @@ const schema = gql`
|
|||
recommendations: [Recommendation!]
|
||||
wordsCount: Int
|
||||
folder: String!
|
||||
feedContent: String
|
||||
}
|
||||
|
||||
# Query: article
|
||||
|
|
@ -1634,7 +1635,7 @@ const schema = gql`
|
|||
wordsCount: Int
|
||||
content: String
|
||||
archivedAt: Date
|
||||
previewContent: String
|
||||
feedContent: String
|
||||
previewContentType: String
|
||||
links: JSON
|
||||
folder: String!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
-- Type: DO
|
||||
-- Name: rename_preview_content_in_library_item
|
||||
-- Description: Rename preview_content column in library_item table to feed_content
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.library_item RENAME COLUMN preview_content TO feed_content;
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
-- Type: UNDO
|
||||
-- Name: rename_preview_content_in_library_item
|
||||
-- Description: Rename preview_content column in library_item table to feed_content
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE omnivore.library_item RENAME COLUMN feed_content TO preview_content;
|
||||
|
||||
COMMIT;
|
||||
Loading…
Reference in a new issue