python-substack 0.1.19__tar.gz → 0.1.20__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-substack
3
- Version: 0.1.19
3
+ Version: 0.1.20
4
4
  Summary: A Python wrapper around the Substack API.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -237,7 +237,14 @@ for _, item in body.items():
237
237
  post.add(item)
238
238
 
239
239
  draft = api.post_draft(post.get_draft())
240
- api.put_draft(draft.get("id"), draft_section_id=post.draft_section_id)
240
+ put_draft_kwargs = {
241
+ "draft_section_id": post.draft_section_id,
242
+ "search_engine_title": post_data.get("search_engine_title"),
243
+ "search_engine_description": post_data.get("search_engine_description"),
244
+ "slug": post_data.get("slug"),
245
+ }
246
+ put_draft_kwargs = {k: v for k, v in put_draft_kwargs.items() if v is not None}
247
+ api.put_draft(draft.get("id"), **put_draft_kwargs)
241
248
 
242
249
  # Publish the draft
243
250
  api.prepublish_draft(draft.get("id"))
@@ -212,7 +212,14 @@ for _, item in body.items():
212
212
  post.add(item)
213
213
 
214
214
  draft = api.post_draft(post.get_draft())
215
- api.put_draft(draft.get("id"), draft_section_id=post.draft_section_id)
215
+ put_draft_kwargs = {
216
+ "draft_section_id": post.draft_section_id,
217
+ "search_engine_title": post_data.get("search_engine_title"),
218
+ "search_engine_description": post_data.get("search_engine_description"),
219
+ "slug": post_data.get("slug"),
220
+ }
221
+ put_draft_kwargs = {k: v for k, v in put_draft_kwargs.items() if v is not None}
222
+ api.put_draft(draft.get("id"), **put_draft_kwargs)
216
223
 
217
224
  # Publish the draft
218
225
  api.prepublish_draft(draft.get("id"))
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-substack"
3
- version = "0.1.19"
3
+ version = "0.1.20"
4
4
  description = "A Python wrapper around the Substack API."
5
5
  authors = ["Paolo Mazza <mazzapaolo2019@gmail.com>"]
6
6
  license = "MIT"