hummingbird-me / kitsu-tools

:hammer: The tools we use to build Kitsu, the coolest platform for anime and manga
https://kitsu.app
Apache License 2.0
2.09k stars 265 forks source link

Robustificate MAL imports #719

Closed NuckChorris closed 8 years ago

NuckChorris commented 8 years ago

So this is solving a few different problems with MAL imports:

  1. 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.
  2. 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.
  3. 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.

trmcnvn commented 8 years ago

:100: lgtm