zotero / translation-server

A Node.js-based server to run Zotero translators
Other
121 stars 50 forks source link

Export attachment urls #97

Open noctux opened 5 years ago

noctux commented 5 years ago

Hello,

thank you for the really useful project! However, I noticed that translation-server does not export all data available to zotero in the /web endpoint. The filtered item-fields can be found here:

https://github.com/zotero/translation-server/blob/6045c708ddd101bd4dc5bf08f313c2f1d83d3095/src/utilities.js#L68

I'm specifically missing the attachment field. The attached patch (include-attachments.patch.txt, modeled similar to the handling of notes as explicit items) will export the data, for instance:

$ ./translate_url 'http://drops.dagstuhl.de/opus/frontdoor.php?source_opus=10246'
[{
  "key": "P5KKCZHW",
  "version": 0,
  "itemType": "conferencePaper",
  "creators": [
   {
    "firstName": "Spyros",
    "lastName": "Angelopoulos",
    "creatorType": "author"
   },
   ...
  ],
  "tags": [...],
  "title": "Best-Of-Two-Worlds Analysis of Online Search",
  ...,
  "accessDate": "2019-03-13T09:46:39Z"
 },
 {
  "itemType": "attachment",
  "parentItem": "P5KKCZHW",
  "title": "Snapshot",
  "mimeType": "text\/html",
  "url": "http:\/\/drops.dagstuhl.de\/opus\/frontdoor.php?source_opus=10246"
 },
 {
  "itemType": "attachment",
  "parentItem": "P5KKCZHW",
  "title": "Full Text PDF",
  "mimeType": "application\/pdf",
  "url": "http:\/\/drops.dagstuhl.de\/opus\/volltexte\/2019\/10246\/pdf\/LIPIcs-STACS-2019-7.pdf"
}]

So I wonder whether this was a conscious decision to remove attachments (especially those kinds that simply carry an url field) or whether those could be included into the output. Please note that I'm not really familiar with the codebase or javascript, so the patch might do quite stupid things :D

Thank you for your work and consideration.

nikcaryo commented 3 years ago

Any updates on this issue?