Skip to content

Commit

Permalink
change: upload media after metadata
Browse files Browse the repository at this point in the history
just so we have some metadata even if file upload fails
  • Loading branch information
eteubert committed Dec 30, 2024
1 parent 539bf62 commit bbe0d7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/lib/publisher/wordpress/episode.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ defmodule Publisher.WordPress.Episode do
post_id <- fetch_post_id(req, episode_id),
{:ok, _} <- write_episode_meta(req, episode_id, params),
:ok <- upload_content(req, post_id, params),
:ok <- upload_media(req, episode_id, post_id, params),
:ok <- upload_chapters(req, episode_id, params),
:ok <- upload_transcript(req, episode_id, params),
:ok <- upload_contributors(req, episode_id, params),
:ok <- upload_media(req, episode_id, post_id, params),
:ok <- verify_media(req, episode_id),
:ok <- upload_cover(req, episode_id, post_id, params) do
:ok
Expand Down Expand Up @@ -334,6 +334,7 @@ defmodule Publisher.WordPress.Episode do

{:ok, resp} = Req.get(enclosure_url)

# TODO: increase timeout or handle error, maybe retry
{:ok, upload} =
Req.post(req,
url: "wp/v2/media",
Expand Down

0 comments on commit bbe0d7c

Please sign in to comment.