pyzotero 1.7.5__py3-none-any.whl → 1.7.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyzotero/zotero.py CHANGED
@@ -1879,6 +1879,12 @@ class Zupload:
1879
1879
  msg,
1880
1880
  )
1881
1881
  return None # Don't do anything if payload comes with keys
1882
+ # Set contentType for each attachment if not already provided
1883
+ for item in self.payload:
1884
+ if not item.get("contentType"):
1885
+ filepath = str(self.basedir.joinpath(item["filename"]))
1886
+ detected_type = mimetypes.guess_type(filepath)[0]
1887
+ item["contentType"] = detected_type or "application/octet-stream"
1882
1888
  liblevel = "/{t}/{u}/items"
1883
1889
  # Create one or more new attachments
1884
1890
  headers = {"Zotero-Write-Token": token(), "Content-Type": "application/json"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyzotero
3
- Version: 1.7.5
3
+ Version: 1.7.6
4
4
  Summary: Python wrapper for the Zotero API
5
5
  Keywords: Zotero,DH
6
6
  Author: Stephan Hügel
@@ -1,9 +1,9 @@
1
1
  pyzotero/__init__.py,sha256=5QI4Jou9L-YJAf_oN9TgRXVKgt_Unc39oADo2Ch8bLI,243
2
2
  pyzotero/cli.py,sha256=dsq4QFqs4vig7CpORQYWD96smM8Z00BbaVh8AsLjhmg,16243
3
3
  pyzotero/filetransport.py,sha256=umLik1LLmrpgaNmyjvtBoqqcaMgIq79PYsTvN5vG-gY,5530
4
- pyzotero/zotero.py,sha256=tXcSpUU1d72rVMCLiGqiRZHl4H2s3BcOLWYaK4lNbGs,76509
4
+ pyzotero/zotero.py,sha256=nUgch-YvNHiQb8qR7Pz9ntgNJv76XDcvINvCs56vvFc,76877
5
5
  pyzotero/zotero_errors.py,sha256=6obx9-pBO0z1bxt33vuzDluELvA5kSLCsfc-uGc3KNw,2660
6
- pyzotero-1.7.5.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
7
- pyzotero-1.7.5.dist-info/entry_points.txt,sha256=MzN7IMRj_oPNmDCsseYFPum3bHWE1gFxywhlbFbcn2k,48
8
- pyzotero-1.7.5.dist-info/METADATA,sha256=GeDQw1OkhpNH6iTVbQuSHIWjsNuEk_dlxa7KZtrVwm0,9962
9
- pyzotero-1.7.5.dist-info/RECORD,,
6
+ pyzotero-1.7.6.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
7
+ pyzotero-1.7.6.dist-info/entry_points.txt,sha256=MzN7IMRj_oPNmDCsseYFPum3bHWE1gFxywhlbFbcn2k,48
8
+ pyzotero-1.7.6.dist-info/METADATA,sha256=oPlV0BYolZ8TXTWJjtnChKeA4Rxcf1rx2crVENVlRhY,9962
9
+ pyzotero-1.7.6.dist-info/RECORD,,