From 8dec30fae3d62428d176a524b9f2e4d91fe14b8c Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Wed, 27 Sep 2023 22:12:34 +0800 Subject: [PATCH 1/4] fix: file already exists error caused by having duplicate article titles --- src/main.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index c01dd3e..8ea0d2d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -363,7 +363,17 @@ export default class OmnivorePlugin extends Plugin { continue; } // file doesn't exist, so we need to create it - await this.app.vault.create(normalizedPath, content); + try { + await this.app.vault.create(normalizedPath, content); + } catch (error) { + if (error.toString().includes("File already exists")) { + new Notice( + `Skipping file creation: ${normalizedPath}. Please check if you have duplicated article titles and delete the file if needed.` + ); + } else { + throw error; + } + } } } From e18d5bcb3c7b9a8fb228e6285947b60fd065d9d0 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 28 Sep 2023 10:00:11 +0800 Subject: [PATCH 2/4] remove rupin from codeowners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2b85185..1bdcf24 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @jacksonh @rupin90 @satindar @sywhb +* @jacksonh @satindar @sywhb From 3c10e1a1c4183892e82301bf85ab4e1244c22a06 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 28 Sep 2023 16:19:26 +0800 Subject: [PATCH 3/4] fix: search content was returned if we are syncing a pdf --- src/api.ts | 2 ++ src/settings/template.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/api.ts b/src/api.ts index eb0a059..8ad032b 100644 --- a/src/api.ts +++ b/src/api.ts @@ -54,6 +54,7 @@ export interface Article { readingProgressPercent: number; isArchived: boolean; archivedAt?: string; + contentReader?: string; } export interface Label { @@ -122,6 +123,7 @@ export const loadArticles = async ( isArchived readingProgressPercent archivedAt + contentReader highlights { id quote diff --git a/src/settings/template.ts b/src/settings/template.ts index ee42069..e80b1c3 100644 --- a/src/settings/template.ts +++ b/src/settings/template.ts @@ -62,7 +62,7 @@ export type ArticleView = labels?: LabelView[]; dateSaved: string; highlights: HighlightView[]; - content: string; + content?: string; datePublished?: string; fileAttachment?: string; description?: string; @@ -219,7 +219,7 @@ export const renderArticleContnet = async ( labels: renderLabels(article.labels), dateSaved, highlights, - content: article.content, + content: article.contentReader === 'WEB' ? article.content : undefined, datePublished, fileAttachment, description: article.description, From dbe46a835ab96f628823a9dca1d77d845a943549 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 28 Sep 2023 21:22:01 +0800 Subject: [PATCH 4/4] fix: ribbon icon stroke color does not match the theme color --- src/main.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index c01dd3e..35e578f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -89,11 +89,7 @@ export default class OmnivorePlugin extends Plugin { // add icon addIcon( iconId, - ` - - - - ` + `` ); // This creates an icon in the left ribbon.