omnivore-app / logseq-omnivore

Logseq plugin to fetch articles and highlights from Omnivore
MIT License
278 stars 15 forks source link

Articles fail to import when isSinglePage set to false #178

Open sstent opened 4 months ago

sstent commented 4 months ago

When do a first sync or full re-sync the "articles" page flashes up for a second, gets populate, then it jsut flashes back and forth between the journal page and other pages.

{
  "generalSettings": "",
  "apiKey": "<REDACTED>",
  "filter": "import all my articles",
  "customQuery": "",
  "highlightOrder": "the time that highlights are updated",
  "isSinglePage": false,
  "createTemplate": "",
  "createTemplateDesc": "",
  "articleTemplate": "[{{{title}}}]({{{omnivoreUrl}}})\ncollapsed:: true\nsite:: {{#siteName}}[{{{siteName}}}]{{/siteName}}({{{originalUrl}}})\n{{#author}}\nauthor:: {{{author}}}\n{{/author}}\n{{#labels.length}}\nlabels:: {{#labels}}[[{{{name}}}]] {{/labels}}\n{{/labels.length}}\ndate-saved:: {{{dateSaved}}}\n{{#datePublished}}\ndate-published:: {{{datePublished}}}\n{{/datePublished}}",
  "highlightTemplate": "> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #[[{{{name}}}]] {{/labels}}\n\n{{#note.length}}note:: {{{note}}}{{/note.length}}",
  "syncContent": true,
  "advancedSettings": "",
  "frequency": 60,
  "syncAt": "2024-02-07T15:53:01",
  "graph": "LogSeq",
  "pageName": "Omnivore",
  "headingBlockTitle": "## 🔖 Articles",
  "endpoint": "https://api-prod.omnivore.app/api/graphql",
  "disabled": false,
  "version": "v1.16.4",
  "syncJobId": 45,
  "loading": false
}
mhofherr commented 4 months ago

same here - same OS and logseq version

sywhb commented 4 months ago

hey @sstent @mhofherr , sorry for the delay.

if isSinglePage is set to false, it will sync each item from omnivore to a separate page in logseq so you will have to change pageName to use a variable like {{{title}} or {{{date}}}

you can refer to this section in the document: https://docs.omnivore.app/integrations/logseq.html#sync-articles-into-a-specific-logseq-page

mhofherr commented 4 months ago

Hi @sywhb, thanks for the explanation. Using {{{title}} is exactly my setup, which causes the above mentioned issues with first sync.

sywhb commented 4 months ago

Hi @sywhb, thanks for the explanation. Using {{{title}} is exactly my setup, which causes the above mentioned issues with first sync.

May I have a look at your plugin settings?

mhofherr commented 4 months ago

Sure, here we go:

`{

  "generalSettings": "",

  "apiKey": "xxx",

  "filter": "advanced",

  "customQuery": "label:\"#logseq\"",

  "highlightOrder": "the location of highlights in the article",

  "isSinglePage": false,

  "createTemplate": "",

  "createTemplateDesc": "",

  "articleTemplate": "{{#author}}\nauthor:: {{{author}}}\n{{/author}}\npage-type:: [[articles]]\nstate:: unprocessed\nlink:: {{{originalUrl}}}\nomnivore-link:: {{{omnivoreUrl}}}\nsource:: [[Omnivore]]\nrelated-to:: \n",

  "highlightTemplate": "> {{{text}}} ⤴️ {{#labels}} #[[{{{name}}}]] {{/labels}}\n\n{{#note.length}}note:: {{{note}}}{{/note.length}}",

  "syncContent": true,

  "advancedSettings": "",

  "frequency": "0",

  "syncAt": "2024-02-22T15:46:52",

  "graph": "logseq",

  "pageName": "{{{title}}}",

  "headingBlockTitle": "",

  "endpoint": "https://api-prod.omnivore.app/api/graphql",

  "disabled": false,

  "version": "v1.16.4",

  "syncJobId": 0,

  "loading": false

} `

thiswillbeyourgithub commented 4 months ago

I don't know if it's helpful but I noticed this behavior in Logseq (flashing between journal and another page) usually after manually modifying files part of my logseq graph (i.e. modifying it by openning the .md file in another editor). This makes logseq unusable until I restart the app, which completely resolves the issue

skf-funzt commented 3 weeks ago

hey @sstent @mhofherr , sorry for the delay.

if isSinglePage is set to false, it will sync each item from omnivore to a separate page in logseq so you will have to change pageName to use a variable like {{{title}} or {{{date}}}

you can refer to this section in the document: https://docs.omnivore.app/integrations/logseq.html#sync-articles-into-a-specific-logseq-page

Solved it for me :+1: