Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podcast.publish! on change #721

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/controllers/episodes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def create
respond_to do |format|
if @episode.save
@episode.copy_media
@episode.podcast&.publish!
format.html { redirect_to edit_episode_url(@episode), notice: t(".notice") }
elsif @episode.errors.added?(:base, :media_not_ready)
@episode.build_contents.each(&:valid?)
Expand All @@ -68,6 +69,7 @@ def update
respond_to do |format|
if @episode.save
@episode.copy_media
@episode.podcast&.publish!
format.html { redirect_to edit_episode_url(@episode), notice: t(".notice") }
elsif @episode.errors.added?(:base, :media_not_ready)
@episode.build_contents.each(&:valid?)
Expand All @@ -86,6 +88,7 @@ def destroy

respond_to do |format|
if @episode.destroy
@episode.podcast&.publish!
format.html { redirect_to podcast_episodes_url(@episode.podcast_id), notice: t(".notice") }
else
format.html do
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/feeds_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def create
respond_to do |format|
if @feed.save
@feed.copy_media
@feed.podcast&.publish!
format.html { redirect_to podcast_feed_path(@podcast, @feed), notice: t(".success", model: "Feed") }
else
format.html do
Expand All @@ -44,6 +45,7 @@ def update
respond_to do |format|
if @feed.save
@feed.copy_media
@feed.podcast&.publish!
format.html { redirect_to podcast_feed_path(@podcast, @feed), notice: t(".success", model: "Feed") }
else
format.html do
Expand All @@ -58,6 +60,7 @@ def update
def destroy
respond_to do |format|
if @feed.destroy
@feed.podcast&.publish!
svevang marked this conversation as resolved.
Show resolved Hide resolved
format.html { redirect_to podcast_feed_path(@podcast, @podcast.default_feed), notice: t(".success", model: "Feed") }
else
format.html do
Expand Down
1 change: 1 addition & 0 deletions app/controllers/podcast_engagement_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def update

respond_to do |format|
if @podcast.save
@podcast.publish!
format.html { redirect_to podcast_engagement_path(@podcast), notice: t(".notice") }
else
flash.now[:error] = t(".error")
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/podcasts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def create
respond_to do |format|
if @podcast.save
@podcast.copy_media
@podcast.publish!
format.html { redirect_to podcast_url(@podcast), notice: t(".notice") }
else
flash.now[:error] = t(".error")
Expand All @@ -85,6 +86,7 @@ def update
respond_to do |format|
if @podcast.save
@podcast.copy_media
@podcast.publish!
format.html { redirect_to edit_podcast_url(@podcast), notice: t(".notice") }
else
flash.now[:error] = t(".error")
Expand Down