Skip to content

Commit

Permalink
Address disk title no longer double up if provide (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
brand-it authored Nov 1, 2024
1 parent b613002 commit 3877850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/controllers/seasons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ 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
disk_title.update!(video: tv, episode_last: episode)
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
Expand Down
2 changes: 1 addition & 1 deletion current_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v5.9.0
v5.10.0

0 comments on commit 3877850

Please sign in to comment.