So this is solving a few different problems with MAL imports:
Anime titles which have ampersands ("Panty & Stocking with Garterbelt" for example) are apparently sometimes not escaped by MAL exports. This is fixed using a gsub to escape them.
Lists without any entries would result in an "Invalid list type" error in the sidekiq worker. This is fixed by detecting that case in the controller.
Users could upload random non-MAL XML files and it would break in the sidekiq worker. This is fixed by checking for <myanimelist> in the XML, which should sniff out all but the weirdest cases.
In all of these cases, the error message will now be passed back to the user to remedy.
So this is solving a few different problems with MAL imports:
gsub
to escape them.<myanimelist>
in the XML, which should sniff out all but the weirdest cases.In all of these cases, the error message will now be passed back to the user to remedy.