Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
2 changed files with 12 additions and 12 deletions
Showing only changes of commit 15b6d492f1 - Show all commits

View File

@ -17,10 +17,10 @@
namespace Aviat\AnimeClient\API\MAL; namespace Aviat\AnimeClient\API\MAL;
use Amp\Artax\Request; use Amp\Artax\Request;
use Aviat\AnimeClient\API\MAL as M;
use Aviat\AnimeClient\API\MAL\ListItem; use Aviat\AnimeClient\API\MAL\ListItem;
use Aviat\AnimeClient\API\MAL\Transformer\AnimeListTransformer; use Aviat\AnimeClient\API\MAL\Transformer\AnimeListTransformer;
use Aviat\AnimeClient\API\XML; use Aviat\AnimeClient\API\XML;
use Aviat\AnimeClient\API\Mapping\AnimeWatchingStatus;
use Aviat\Ion\Di\ContainerAware; use Aviat\Ion\Di\ContainerAware;
/** /**
@ -61,7 +61,7 @@ class Model {
$createData = [ $createData = [
'id' => $data['id'], 'id' => $data['id'],
'data' => [ 'data' => [
'status' => M::KITSU_MAL_WATCHING_STATUS_MAP[$data['status']] 'status' => AnimeWatchingStatus::KITSU_TO_MAL[$data['status']]
] ]
]; ];

View File

@ -25,22 +25,14 @@ use Aviat\AnimeClient\API\Enum\AnimeWatchingStatus\{
use Aviat\Ion\Enum; use Aviat\Ion\Enum;
class AnimeWatchingStatus extends Enum { class AnimeWatchingStatus extends Enum {
const MAL_TO_KITSU = [ const KITSU_TO_MAL = [
Kitsu::WATCHING => MAL::WATCHING, Kitsu::WATCHING => MAL::WATCHING,
Kitsu::PLAN_TO_WATCH => MAL::PLAN_TO_WATCH, Kitsu::PLAN_TO_WATCH => MAL::PLAN_TO_WATCH,
Kitsu::COMPLETED => MAL::COMPLETED, Kitsu::COMPLETED => MAL::COMPLETED,
Kitsu::ON_HOLD => MAL::ON_HOLD, Kitsu::ON_HOLD => MAL::ON_HOLD,
Kitsu::DROPPED => MAL::DROPPED Kitsu::DROPPED => MAL::DROPPED
]; ];
const KITSU_TO_MAL = [
MAL::WATCHING => Kitsu::WATCHING,
MAL::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
MAL::COMPLETED => Kitsu::COMPLETED,
MAL::ON_HOLD => Kitsu::ON_HOLD,
MAL::DROPPED => Kitsu::DROPPED
];
const KITSU_TO_TITLE = [ const KITSU_TO_TITLE = [
'all' => Title::ALL, 'all' => Title::ALL,
Kitsu::WATCHING => Title::WATCHING, Kitsu::WATCHING => Title::WATCHING,
@ -50,6 +42,14 @@ class AnimeWatchingStatus extends Enum {
Kitsu::COMPLETED => Title::COMPLETED Kitsu::COMPLETED => Title::COMPLETED
]; ];
const MAL_TO_KITSU = [
MAL::WATCHING => Kitsu::WATCHING,
MAL::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,
MAL::COMPLETED => Kitsu::COMPLETED,
MAL::ON_HOLD => Kitsu::ON_HOLD,
MAL::DROPPED => Kitsu::DROPPED
];
const ROUTE_TO_KITSU = [ const ROUTE_TO_KITSU = [
Route::WATCHING => Kitsu::WATCHING, Route::WATCHING => Kitsu::WATCHING,
Route::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH, Route::PLAN_TO_WATCH => Kitsu::PLAN_TO_WATCH,