Skip to content

Add support for imported_url, linked_file and improve support for inline attachments#47

Closed
OptionalLion411 wants to merge 2 commits into
benjypng:mainfrom
OptionalLion411:attachment-handling
Closed

Add support for imported_url, linked_file and improve support for inline attachments#47
OptionalLion411 wants to merge 2 commits into
benjypng:mainfrom
OptionalLion411:attachment-handling

Conversation

@OptionalLion411

Copy link
Copy Markdown

I added support for all types of attachments that occur in Zotero (this is the only place where they are mentioned in the official documentation).
This combines the features of #32 and #38. So this correctly handles

  • imported_file (already implemented)
  • imported_url (files, that are downloaded from the web, but locally stored, mostly usinig the Browser Extension)
  • linked_url (also already partially implemented, but I added support for content type and more complex URL which are possible to occur)
  • linked_file (files, that are not stored within Zotero, but where a link in the local filesystem exists)

For each of this types, Zotero stores the Content-Type of the attachment. In the settings, we already have the option whether links should be handled inside (inline) Logseq or outside. Currently, when enabled, the plugin tries to handle all types of files within Logseq, which does not work. For example, linked Latex documents can't be handled by Logseq and errors occur.
This pull request adds checks for the Content-Type and only inlines supported files.

I am not sure why the previous pull request did not get merged, because for me the addressed issues affect more than 50% of all my entries in Zotero. So if you need any further examples or debug logs of the JSON provided by the API, feel free to request this.

In the end I just want to say thank you for the really great plugin and all your efforts to already port it to the DB version!

`length` property is optional and for linked files, there is a `path` property
…attachments

only inline supported attachments like pdf and images
include all attachment types (new: `linked_file`, `imported_url`)
@OptionalLion411

Copy link
Copy Markdown
Author

Also, @benjypng, is there any reason why you are currently not taking in any pull requests, like stated in the README.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant