From 3877850ed5197f7ee3e1a20f92f3053379721670 Mon Sep 17 00:00:00 2001 From: Brandt Lareau Date: Fri, 1 Nov 2024 13:56:40 -0700 Subject: [PATCH] Address disk title no longer double up if provide (#494) --- app/controllers/seasons_controller.rb | 6 +++++- current_version.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/seasons_controller.rb b/app/controllers/seasons_controller.rb index 21fcd599..6427d168 100644 --- a/app/controllers/seasons_controller.rb +++ b/app/controllers/seasons_controller.rb @@ -29,7 +29,8 @@ def tv end def rip_disk_titles - @rip_disk_titles ||= episode_params.map do |episode_param| + disk_title_ids = [] + @rip_disk_titles ||= episode_params.filter_map do |episode_param| episode = season.episodes.find { _1.id == episode_param[:episode_id].to_i } disk_title = disk.disk_titles.find { _1.id == episode_param[:disk_title_id].to_i } if disk_title.episode @@ -37,6 +38,9 @@ def rip_disk_titles else disk_title.update!(video: tv, episode:) end + next if disk_title_ids.include?(disk_title.id) + + disk_title_ids.append(disk_title.id) RipWorker::DiskTitleHash[{ id: disk_title.id, part: episode_param[:part].presence&.to_i diff --git a/current_version.txt b/current_version.txt index 7094538d..339cbf23 100644 --- a/current_version.txt +++ b/current_version.txt @@ -1 +1 @@ -v5.9.0 +v5.10.0