lib/icarus/mod/tools/mod_sync.rb in Icarus-Mod-Tools-1.7.1 vs lib/icarus/mod/tools/mod_sync.rb in Icarus-Mod-Tools-1.8.0
- old
+ new
@@ -17,11 +17,11 @@
def mods
@firestore.mods
end
def modinfo_array
- @modinfo_array ||= @firestore.modinfo_array.map do |url|
+ @modinfo_array ||= @firestore.modinfo_list.map do |url|
retrieve_from_url(url)[:mods].map { |mod| Modinfo.new(mod) if mod[:name] =~ /[a-z0-9]+/i }
rescue Icarus::Mod::Tools::RequestFailed
warn "Skipped; Failed to retrieve #{url}"
next
rescue JSON::ParserError => e
@@ -29,10 +29,10 @@
next
end.flatten.compact
end
def find_mod(modinfo)
- @firestore.find_mod(name: modinfo.name, author: modinfo.author)&.id
+ @firestore.find_by_type(type: "mods", name: modinfo.name, author: modinfo.author)&.id
end
def find_modinfo(modinfo)
@modinfo_array.find { |mod| mod.name == modinfo.name }
end