hummingbird-me / kitsu-tools

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

ListImport system #710

Closed NuckChorris closed 7 years ago

NuckChorris commented 8 years ago

The ListImport system will form the basis of the MAL and Hummingbird importers in V3. The goal is to make the addition of other site imports relatively simple by abstracting the details away.

An early version of ListImport was set up in V2 as a duck-typed enumerable, but in V3 I'll actually build a base class to provide a number of helpful abstractions.

The goal is to make it this easy to run an import:

# MyAnimeList
importer = ListImport::MyAnimeList.new(file)
LibraryEntry.import(user, importer) { |progress| user.notify(progress) }

# Anime-Planet
importer = ListImport::AnimePlanet.new(profile_url)
LibraryEntry.import(user, importer) { |progress| user.notify(progress) }

# Hummingbird
importer = ListImport::Hummingbird.new(file)
LibraryEntry.import(user, importer) { |progress| user.notify(progress) }

All while making it extremely easy to build new ones.

Todo

toyhammered commented 8 years ago

Well feel free to add me to this, Ill be working on the MyAnimeList importer.