diff --git a/server/lib/data_import/my_anime_list.rb b/server/lib/data_import/my_anime_list.rb index 559118258..4f2971cba 100644 --- a/server/lib/data_import/my_anime_list.rb +++ b/server/lib/data_import/my_anime_list.rb @@ -13,7 +13,9 @@ def initialize(opts = {}) end def get_media(external_id) # anime/1234 or manga/1234 - media = Mapping.lookup('myanimelist', external_id) || external_id.split('/').first.classify.constantize.new # should return Anime.new or Manga.new + media = Mapping.lookup('myanimelist', external_id) + klass = external_id.split('/').first.classify.constantize # should return Anime or Manga + media ||= klass.new # picks the class get(external_id) do |response| details = Extractor::Media.new(response)