Collect deleted ids

This commit is contained in:
Leeingnyo 2021-09-14 22:51:05 +09:00
parent 523195d649
commit 2e09efbd62
2 changed files with 13 additions and 3 deletions

View File

@ -152,7 +152,10 @@ class Library
@title_ids.select! do |title_id| @title_ids.select! do |title_id|
title = @title_hash[title_id] title = @title_hash[title_id]
existence = title.examine examine_context existence = title.examine examine_context
@title_hash.delete title_id unless existence unless existence
@title_hash.delete title_id
examine_context["deleted_title_ids"] << title_id
end
existence existence
end end
remained_title_dirs = @title_ids.map { |id| title_hash[id].dir } remained_title_dirs = @title_ids.map { |id| title_hash[id].dir }

View File

@ -101,7 +101,10 @@ class Title
@title_ids.select! do |title_id| @title_ids.select! do |title_id|
title = Library.default.get_title! title_id title = Library.default.get_title! title_id
existence = title.examine context existence = title.examine context
Library.default.title_hash.delete title_id unless existence unless existence
Library.default.title_hash.delete title_id
context["deleted_title_ids"] << title_id
end
existence existence
end end
remained_title_dirs = @title_ids.map do |title_id| remained_title_dirs = @title_ids.map do |title_id|
@ -110,7 +113,11 @@ class Title
end end
previous_entries_size = @entries.size previous_entries_size = @entries.size
@entries.select! { |entry| File.exists? entry.zip_path } @entries.select! do |entry|
existence = File.exists? entry.zip_path
context["deleted_entry_ids"] << entry.id unless existence
existence
end
remained_entry_zip_paths = @entries.map &.zip_path remained_entry_zip_paths = @entries.map &.zip_path
is_titles_added = false is_titles_added = false