From 392432028d22af26b22b9f4058622d71088822b9 Mon Sep 17 00:00:00 2001 From: cavis Date: Wed, 26 Jul 2023 12:14:38 -0600 Subject: [PATCH] Bugfixes --- app/controllers/podcast_planner_controller.rb | 2 +- app/models/podcast_planner.rb | 2 +- app/views/podcast_planner/_form_draft.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/podcast_planner_controller.rb b/app/controllers/podcast_planner_controller.rb index 5c201cb1a..81a75f60f 100644 --- a/app/controllers/podcast_planner_controller.rb +++ b/app/controllers/podcast_planner_controller.rb @@ -39,7 +39,7 @@ def planner_params p = permit_params p[:podcast_id] = @podcast.id p[:date_range_condition] = p[:number_of_episodes].present? ? "episodes" : "date" - p[:segment_count] = p[:ad_breaks] + 1 if p[:ad_breaks].present? + p[:segment_count] = p[:ad_breaks].to_i + 1 if p[:ad_breaks].present? # translate selected weeks into monthly weeks monthly_weeks = monthly_week_options(p[:selected_weeks]) diff --git a/app/models/podcast_planner.rb b/app/models/podcast_planner.rb index 598141cff..798cf4a77 100644 --- a/app/models/podcast_planner.rb +++ b/app/models/podcast_planner.rb @@ -138,7 +138,7 @@ def generate_dates_by_end_date def ready_to_generate_drafts? @dates.present? && @publish_time.present? && - @segment_count.present? && + (@segment_count.present? || @medium === "video") && @medium.present? end diff --git a/app/views/podcast_planner/_form_draft.html.erb b/app/views/podcast_planner/_form_draft.html.erb index 46bc87a53..76e8cd261 100644 --- a/app/views/podcast_planner/_form_draft.html.erb +++ b/app/views/podcast_planner/_form_draft.html.erb @@ -25,7 +25,7 @@ <%= t(".title.calendar") %> -