From 0fa54d9f7f326138eeaf5e2c59b2d6daa6f0cbfa Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Mon, 29 Oct 2018 10:07:20 -0400 Subject: [PATCH] Attempt to fix tests again --- src/API/JsonAPI.php | 13 +- tests/API/JsonAPITest.php | 14 +- tests/test_data/JsonAPI/inlineIncluded.json | 2 +- .../test_data/JsonAPI/organizedIncludes.json | 386 +----------------- 4 files changed, 17 insertions(+), 398 deletions(-) diff --git a/src/API/JsonAPI.php b/src/API/JsonAPI.php index 323af807..292658f5 100644 --- a/src/API/JsonAPI.php +++ b/src/API/JsonAPI.php @@ -195,7 +195,6 @@ final class JsonAPI { } $organized[$type][$id] = $newItem; - $organized[$type][$id]['original'] = $item; } // Second pass, go through and fill missing relationships in the first pass @@ -215,7 +214,6 @@ final class JsonAPI { $relationship =& $organized[$type][$id]['relationships'][$relType]; unset($relationship['links']); unset($relationship['data']); - $relationship['foo'] = TRUE; if ($relType === $dataType) { @@ -255,16 +253,16 @@ final class JsonAPI { $inlined[$key][$itemId] = $item; foreach($item['relationships'] as $type => $ids) - { + { $inlined[$key][$itemId]['relationships'][$type] = []; - + if ( ! array_key_exists($type, $included)) continue; - + if (array_key_exists('data', $ids )) { $ids = array_column($ids['data'], 'id'); } - + foreach($ids as $id) { $inlined[$key][$itemId]['relationships'][$type][$id] = $included[$type][$id]; @@ -326,12 +324,13 @@ final class JsonAPI { foreach($relationships as $key => $data) { - $organized[$key] = $organized[$key] ?? []; if ( ! array_key_exists('data', $data)) { continue; } + $organized[$key] = $organized[$key] ?? []; + foreach ($data['data'] as $item) { if (\is_array($item) && array_key_exists('id', $item)) diff --git a/tests/API/JsonAPITest.php b/tests/API/JsonAPITest.php index c96aecc0..ac08c1be 100644 --- a/tests/API/JsonAPITest.php +++ b/tests/API/JsonAPITest.php @@ -21,11 +21,11 @@ use Aviat\Ion\Json; use PHPUnit\Framework\TestCase; class JsonAPITest extends TestCase { - + protected $startData; protected $organizedIncludes; protected $inlineIncluded; - + public function setUp() { $dir = __DIR__ . '/../test_data/JsonAPI'; @@ -33,20 +33,24 @@ class JsonAPITest extends TestCase { $this->organizedIncludes = Json::decodeFile("{$dir}/organizedIncludes.json"); $this->inlineIncluded = Json::decodeFile("{$dir}/inlineIncluded.json"); } - + public function testOrganizeIncludes() { $expected = $this->organizedIncludes; $actual = JsonAPI::organizeIncludes($this->startData['included']); + // file_put_contents(__DIR__ . '/../test_data/JsonAPI/organizedIncludes.json', json_Encode($actual)); + $this->assertEquals($expected, $actual); } - + public function testInlineIncludedRelationships() { $expected = $this->inlineIncluded; $actual = JsonAPI::inlineIncludedRelationships($this->organizedIncludes, 'anime'); - + + // file_put_contents(__DIR__ . '/../test_data/JsonAPI/inlineIncluded.json', json_Encode($actual)); + $this->assertEquals($expected, $actual); } } \ No newline at end of file diff --git a/tests/test_data/JsonAPI/inlineIncluded.json b/tests/test_data/JsonAPI/inlineIncluded.json index f4d40970..a2ec42f5 100644 --- a/tests/test_data/JsonAPI/inlineIncluded.json +++ b/tests/test_data/JsonAPI/inlineIncluded.json @@ -1 +1 @@ -{"anime":{"11474":{"slug":"hibike-euphonium-2","synopsis":"Second season of Hibike! Euphonium.","coverImageTopOffset":120,"titles":{"en":"Sound! Euphonium 2","en_jp":"Hibike! Euphonium 2","ja_jp":"\u97ff\u3051\uff01\u30e6\u30fc\u30d5\u30a9\u30cb\u30a2\u30e0 \uff12"},"canonicalTitle":"Hibike! Euphonium 2","abbreviatedTitles":null,"averageRating":4.1684326428476,"ratingFrequencies":{"0.5":"1","1.0":"1","1.5":"2","2.0":"8","2.5":"13","3.0":"42","3.5":"90","4.0":"193","4.5":"180","5.0":"193","nil":"1972"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/tiny.jpg?1470781430","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/small.jpg?1470781430","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/medium.jpg?1470781430","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/large.jpg?1470781430","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/original.jpg?1470781430"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/small.jpg?1476203965","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/large.jpg?1476203965","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/original.jpg?1476203965"},"episodeCount":13,"episodeLength":25,"subtype":"TV","youtubeVideoId":"d2Di5swwzxg","ageRating":"PG","ageRatingGuide":"","showType":"TV","nsfw":false,"relationships":{"genres":{"24":{"name":"School","slug":"school","description":null},"35":{"name":"Music","slug":"music","description":null},"4":{"name":"Drama","slug":"drama","description":""}},"mappings":{"3155":{"externalSite":"myanimelist\/anime","externalId":"31988","relationships":[]}}}},"10802":{"slug":"nisekoimonogatari","synopsis":"Trailer for a fake anime created by Shaft as an April Fool's Day joke.","coverImageTopOffset":80,"titles":{"en":"","en_jp":"Nisekoimonogatari","ja_jp":""},"canonicalTitle":"Nisekoimonogatari","abbreviatedTitles":null,"averageRating":3.4857993435287,"ratingFrequencies":{"0.5":"22","1.0":"10","1.5":"16","2.0":"32","2.5":"74","3.0":"97","3.5":"118","4.0":"72","4.5":"34","5.0":"136","nil":"597","0.89":"-1","3.63":"-1","4.11":"-1","0.068":"-1","0.205":"-1","0.274":"-2","0.479":"-1","0.548":"-1","1.096":"-2","1.164":"-1","1.438":"-1","1.918":"-1","2.055":"-1","3.973":"-1","4.178":"-3","4.247":"-1","4.726":"-1","4.932":"-3","1.0958904109589":"3","0.89041095890411":"2","1.02739726027397":"1","1.16438356164384":"2","1.43835616438356":"2","1.57534246575342":"1","1.91780821917808":"1","2.05479452054794":"2","2.12328767123288":"1","2.73972602739726":"1","2.80821917808219":"2","2.94520547945205":"1","3.15068493150685":"1","3.35616438356164":"2","3.63013698630137":"2","3.97260273972603":"1","4.10958904109589":"2","4.17808219178082":"3","4.24657534246575":"1","4.38356164383562":"2","4.65753424657534":"1","4.72602739726027":"2","4.86301369863014":"1","4.93150684931507":"10","0.205479452054795":"1","0.273972602739726":"2","0.479452054794521":"2","0.547945205479452":"2","0.753424657534246":"1","0.0684931506849315":"1"},"startDate":"2015-04-01","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/tiny.jpg?1427974534","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/small.jpg?1427974534","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/medium.jpg?1427974534","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/large.jpg?1427974534","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/original.jpg?1427974534"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/small.jpg?1427928458","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/large.jpg?1427928458","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/original.jpg?1427928458"},"episodeCount":1,"episodeLength":1,"subtype":"ONA","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"ONA","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null}},"mappings":{"1755":{"externalSite":"myanimelist\/anime","externalId":"30514","relationships":[]}}}},"11887":{"slug":"brave-witches","synopsis":"In September 1944, allied forces led by the 501st Joint Fighter Wing \"Strike Witches\" successfully eliminate the Neuroi threat from the skies of the Republic of Gallia, thus ensuring the security of western Europe. Taking advantage of this victory, allied forces begin a full-fledged push toward central and eastern Europe. From a base in Petersburg in the Empire of Orussia, the 502nd Joint Fighter Wing \"Brave Witches,\" upon whom mankind has placed its hopes, flies with courage in the cold skies of eastern Europe.\n\n(Source: MAL News)","coverImageTopOffset":380,"titles":{"en":"","en_jp":"Brave Witches","ja_jp":"\u30d6\u30ec\u30a4\u30d6\u30a6\u30a3\u30c3\u30c1\u30fc\u30ba"},"canonicalTitle":"Brave Witches","abbreviatedTitles":null,"averageRating":3.5846888163849,"ratingFrequencies":{"0.5":"1","1.0":"4","1.5":"8","2.0":"12","2.5":"17","3.0":"33","3.5":"41","4.0":"32","4.5":"9","5.0":"19","nil":"620"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/tiny.jpg?1476481854","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/small.jpg?1476481854","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/medium.jpg?1476481854","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/large.jpg?1476481854","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/original.png?1476481854"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/small.jpg?1479834725","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/large.jpg?1479834725","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/original.jpg?1479834725"},"episodeCount":12,"episodeLength":24,"subtype":"TV","youtubeVideoId":"VLUqd-jEBuE","ageRating":"R","ageRatingGuide":"Mild Nudity","showType":"TV","nsfw":false,"relationships":{"genres":{"5":{"name":"Sci-Fi","slug":"sci-fi","description":null},"8":{"name":"Magic","slug":"magic","description":null},"28":{"name":"Military","slug":"military","description":null},"1":{"name":"Action","slug":"action","description":""},"25":{"name":"Ecchi","slug":"ecchi","description":""}},"mappings":{"2593":{"externalSite":"myanimelist\/anime","externalId":"32866","relationships":[]}}}},"12024":{"slug":"www-working","synopsis":"Daisuke Higashida is a serious first-year student at Higashizaka High School. He lives a peaceful everyday life even though he is not satisfied with the family who doesn't laugh at all and makes him tired. However, his father's company goes bankrupt one day, and he can no longer afford allowances, cellphone bills, and commuter tickets. When his father orders him to take up a part-time job, Daisuke decides to work at a nearby family restaurant in order to avoid traveling 15 kilometers to school by bicycle.","coverImageTopOffset":165,"titles":{"en":"WWW.WAGNARIA!!","en_jp":"WWW.Working!!","ja_jp":""},"canonicalTitle":"WWW.Working!!","abbreviatedTitles":null,"averageRating":3.8238374224378,"ratingFrequencies":{"1.0":"2","1.5":"7","2.0":"19","2.5":"28","3.0":"68","3.5":"114","4.0":"144","4.5":"78","5.0":"74","nil":"1182"},"startDate":"2016-10-01","endDate":"2016-12-24","posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/tiny.jpg?1473990267","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/small.jpg?1473990267","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/medium.jpg?1473990267","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/large.jpg?1473990267","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/original.jpg?1473990267"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/small.jpg?1479834612","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/large.jpg?1479834612","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/original.png?1479834612"},"episodeCount":13,"episodeLength":23,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"TV","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null},"16":{"name":"Slice of Life","slug":"slice-of-life","description":""}},"mappings":{"2538":{"externalSite":"myanimelist\/anime","externalId":"33094","relationships":[]}}}},"12465":{"slug":"bishoujo-yuugi-unit-crane-game-girls-galaxy","synopsis":"Second season of Bishoujo Yuugi Unit Crane Game Girls.","coverImageTopOffset":0,"titles":{"en":"Crane Game Girls Galaxy","en_jp":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","ja_jp":"\u7f8e\u5c11\u5973\u904a\u622f\u30e6\u30cb\u30c3\u30c8 \u30af\u30ec\u30fc\u30f3\u30b2\u30fc\u30eb\u30ae\u30e3\u30e9\u30af\u30b7\u30fc"},"canonicalTitle":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","abbreviatedTitles":null,"averageRating":null,"ratingFrequencies":{"0.5":"2","1.0":"2","1.5":"0","2.0":"4","2.5":"6","3.0":"2","3.5":"4","4.0":"1","4.5":"2","nil":"66"},"startDate":"2016-10-05","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/tiny.jpg?1473601756","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/small.jpg?1473601756","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/medium.jpg?1473601756","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/large.jpg?1473601756","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/original.png?1473601756"},"coverImage":null,"episodeCount":null,"episodeLength":13,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Children","showType":"TV","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null}},"mappings":{"9871":{"externalSite":"myanimelist\/anime","externalId":"33541","relationships":[]}}}}}} \ No newline at end of file +{"anime":{"11474":{"slug":"hibike-euphonium-2","synopsis":"Second season of Hibike! Euphonium.","coverImageTopOffset":120,"titles":{"en":"Sound! Euphonium 2","en_jp":"Hibike! Euphonium 2","ja_jp":"\u97ff\u3051\uff01\u30e6\u30fc\u30d5\u30a9\u30cb\u30a2\u30e0 \uff12"},"canonicalTitle":"Hibike! Euphonium 2","abbreviatedTitles":null,"averageRating":4.1684326428476197,"ratingFrequencies":{"0.5":"1","1.0":"1","1.5":"2","2.0":"8","2.5":"13","3.0":"42","3.5":"90","4.0":"193","4.5":"180","5.0":"193","nil":"1972"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/tiny.jpg?1470781430","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/small.jpg?1470781430","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/medium.jpg?1470781430","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/large.jpg?1470781430","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/original.jpg?1470781430"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/small.jpg?1476203965","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/large.jpg?1476203965","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/original.jpg?1476203965"},"episodeCount":13,"episodeLength":25,"subtype":"TV","youtubeVideoId":"d2Di5swwzxg","ageRating":"PG","ageRatingGuide":"","showType":"TV","nsfw":false,"relationships":{"genres":{"24":{"name":"School","slug":"school","description":null},"35":{"name":"Music","slug":"music","description":null},"4":{"name":"Drama","slug":"drama","description":""}},"castings":[],"installments":[],"mappings":{"3155":{"externalSite":"myanimelist\/anime","externalId":"31988","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/3155\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/3155\/media"}}}}},"reviews":[],"episodes":[],"streamingLinks":[]}},"10802":{"slug":"nisekoimonogatari","synopsis":"Trailer for a fake anime created by Shaft as an April Fool's Day joke.","coverImageTopOffset":80,"titles":{"en":"","en_jp":"Nisekoimonogatari","ja_jp":""},"canonicalTitle":"Nisekoimonogatari","abbreviatedTitles":null,"averageRating":3.48579934352873,"ratingFrequencies":{"0.5":"22","1.0":"10","1.5":"16","2.0":"32","2.5":"74","3.0":"97","3.5":"118","4.0":"72","4.5":"34","5.0":"136","nil":"597","0.89":"-1","3.63":"-1","4.11":"-1","0.068":"-1","0.205":"-1","0.274":"-2","0.479":"-1","0.548":"-1","1.096":"-2","1.164":"-1","1.438":"-1","1.918":"-1","2.055":"-1","3.973":"-1","4.178":"-3","4.247":"-1","4.726":"-1","4.932":"-3","1.0958904109589":"3","0.89041095890411":"2","1.02739726027397":"1","1.16438356164384":"2","1.43835616438356":"2","1.57534246575342":"1","1.91780821917808":"1","2.05479452054794":"2","2.12328767123288":"1","2.73972602739726":"1","2.80821917808219":"2","2.94520547945205":"1","3.15068493150685":"1","3.35616438356164":"2","3.63013698630137":"2","3.97260273972603":"1","4.10958904109589":"2","4.17808219178082":"3","4.24657534246575":"1","4.38356164383562":"2","4.65753424657534":"1","4.72602739726027":"2","4.86301369863014":"1","4.93150684931507":"10","0.205479452054795":"1","0.273972602739726":"2","0.479452054794521":"2","0.547945205479452":"2","0.753424657534246":"1","0.0684931506849315":"1"},"startDate":"2015-04-01","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/tiny.jpg?1427974534","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/small.jpg?1427974534","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/medium.jpg?1427974534","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/large.jpg?1427974534","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/original.jpg?1427974534"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/small.jpg?1427928458","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/large.jpg?1427928458","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/original.jpg?1427928458"},"episodeCount":1,"episodeLength":1,"subtype":"ONA","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"ONA","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null}},"castings":[],"installments":[],"mappings":{"1755":{"externalSite":"myanimelist\/anime","externalId":"30514","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/1755\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/1755\/media"}}}}},"reviews":[],"episodes":[],"streamingLinks":[]}},"11887":{"slug":"brave-witches","synopsis":"In September 1944, allied forces led by the 501st Joint Fighter Wing \"Strike Witches\" successfully eliminate the Neuroi threat from the skies of the Republic of Gallia, thus ensuring the security of western Europe. Taking advantage of this victory, allied forces begin a full-fledged push toward central and eastern Europe. From a base in Petersburg in the Empire of Orussia, the 502nd Joint Fighter Wing \"Brave Witches,\" upon whom mankind has placed its hopes, flies with courage in the cold skies of eastern Europe.\n\n(Source: MAL News)","coverImageTopOffset":380,"titles":{"en":"","en_jp":"Brave Witches","ja_jp":"\u30d6\u30ec\u30a4\u30d6\u30a6\u30a3\u30c3\u30c1\u30fc\u30ba"},"canonicalTitle":"Brave Witches","abbreviatedTitles":null,"averageRating":3.5846888163849102,"ratingFrequencies":{"0.5":"1","1.0":"4","1.5":"8","2.0":"12","2.5":"17","3.0":"33","3.5":"41","4.0":"32","4.5":"9","5.0":"19","nil":"620"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/tiny.jpg?1476481854","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/small.jpg?1476481854","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/medium.jpg?1476481854","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/large.jpg?1476481854","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/original.png?1476481854"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/small.jpg?1479834725","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/large.jpg?1479834725","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/original.jpg?1479834725"},"episodeCount":12,"episodeLength":24,"subtype":"TV","youtubeVideoId":"VLUqd-jEBuE","ageRating":"R","ageRatingGuide":"Mild Nudity","showType":"TV","nsfw":false,"relationships":{"genres":{"5":{"name":"Sci-Fi","slug":"sci-fi","description":null},"8":{"name":"Magic","slug":"magic","description":null},"28":{"name":"Military","slug":"military","description":null},"1":{"name":"Action","slug":"action","description":""},"25":{"name":"Ecchi","slug":"ecchi","description":""}},"castings":[],"installments":[],"mappings":{"2593":{"externalSite":"myanimelist\/anime","externalId":"32866","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/2593\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/2593\/media"}}}}},"reviews":[],"episodes":[],"streamingLinks":[]}},"12024":{"slug":"www-working","synopsis":"Daisuke Higashida is a serious first-year student at Higashizaka High School. He lives a peaceful everyday life even though he is not satisfied with the family who doesn't laugh at all and makes him tired. However, his father's company goes bankrupt one day, and he can no longer afford allowances, cellphone bills, and commuter tickets. When his father orders him to take up a part-time job, Daisuke decides to work at a nearby family restaurant in order to avoid traveling 15 kilometers to school by bicycle.","coverImageTopOffset":165,"titles":{"en":"WWW.WAGNARIA!!","en_jp":"WWW.Working!!","ja_jp":""},"canonicalTitle":"WWW.Working!!","abbreviatedTitles":null,"averageRating":3.8238374224378302,"ratingFrequencies":{"1.0":"2","1.5":"7","2.0":"19","2.5":"28","3.0":"68","3.5":"114","4.0":"144","4.5":"78","5.0":"74","nil":"1182"},"startDate":"2016-10-01","endDate":"2016-12-24","posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/tiny.jpg?1473990267","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/small.jpg?1473990267","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/medium.jpg?1473990267","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/large.jpg?1473990267","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/original.jpg?1473990267"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/small.jpg?1479834612","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/large.jpg?1479834612","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/original.png?1479834612"},"episodeCount":13,"episodeLength":23,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"TV","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null},"16":{"name":"Slice of Life","slug":"slice-of-life","description":""}},"castings":[],"installments":[],"mappings":{"2538":{"externalSite":"myanimelist\/anime","externalId":"33094","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/2538\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/2538\/media"}}}}},"reviews":[],"episodes":[],"streamingLinks":[]}},"12465":{"slug":"bishoujo-yuugi-unit-crane-game-girls-galaxy","synopsis":"Second season of Bishoujo Yuugi Unit Crane Game Girls.","coverImageTopOffset":0,"titles":{"en":"Crane Game Girls Galaxy","en_jp":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","ja_jp":"\u7f8e\u5c11\u5973\u904a\u622f\u30e6\u30cb\u30c3\u30c8 \u30af\u30ec\u30fc\u30f3\u30b2\u30fc\u30eb\u30ae\u30e3\u30e9\u30af\u30b7\u30fc"},"canonicalTitle":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","abbreviatedTitles":null,"averageRating":null,"ratingFrequencies":{"0.5":"2","1.0":"2","1.5":"0","2.0":"4","2.5":"6","3.0":"2","3.5":"4","4.0":"1","4.5":"2","nil":"66"},"startDate":"2016-10-05","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/tiny.jpg?1473601756","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/small.jpg?1473601756","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/medium.jpg?1473601756","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/large.jpg?1473601756","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/original.png?1473601756"},"coverImage":null,"episodeCount":null,"episodeLength":13,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Children","showType":"TV","nsfw":false,"relationships":{"genres":{"3":{"name":"Comedy","slug":"comedy","description":null}},"castings":[],"installments":[],"mappings":{"9871":{"externalSite":"myanimelist\/anime","externalId":"33541","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/9871\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/9871\/media"}}}}},"reviews":[],"episodes":[],"streamingLinks":[]}}}} \ No newline at end of file diff --git a/tests/test_data/JsonAPI/organizedIncludes.json b/tests/test_data/JsonAPI/organizedIncludes.json index 995226b1..44d5c1e2 100644 --- a/tests/test_data/JsonAPI/organizedIncludes.json +++ b/tests/test_data/JsonAPI/organizedIncludes.json @@ -1,385 +1 @@ -{ - "anime": { - "11474": { - "slug": "hibike-euphonium-2", - "synopsis": "Second season of Hibike! Euphonium.", - "coverImageTopOffset": 120, - "titles": { - "en": "Sound! Euphonium 2", - "en_jp": "Hibike! Euphonium 2", - "ja_jp": "\u97ff\u3051\uff01\u30e6\u30fc\u30d5\u30a9\u30cb\u30a2\u30e0 \uff12" - }, - "canonicalTitle": "Hibike! Euphonium 2", - "abbreviatedTitles": null, - "averageRating": 4.1684326428476, - "ratingFrequencies": { - "0.5": "1", - "1.0": "1", - "1.5": "2", - "2.0": "8", - "2.5": "13", - "3.0": "42", - "3.5": "90", - "4.0": "193", - "4.5": "180", - "5.0": "193", - "nil": "1972" - }, - "startDate": "2016-10-06", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/tiny.jpg?1470781430", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/small.jpg?1470781430", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/medium.jpg?1470781430", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/large.jpg?1470781430", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/original.jpg?1470781430" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/small.jpg?1476203965", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/large.jpg?1476203965", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/original.jpg?1476203965" - }, - "episodeCount": 13, - "episodeLength": 25, - "subtype": "TV", - "youtubeVideoId": "d2Di5swwzxg", - "ageRating": "PG", - "ageRatingGuide": "", - "showType": "TV", - "nsfw": false, - "relationships": { - "genres": ["24", "35", "4"], - "mappings": ["3155"] - } - }, - "10802": { - "slug": "nisekoimonogatari", - "synopsis": "Trailer for a fake anime created by Shaft as an April Fool's Day joke.", - "coverImageTopOffset": 80, - "titles": { - "en": "", - "en_jp": "Nisekoimonogatari", - "ja_jp": "" - }, - "canonicalTitle": "Nisekoimonogatari", - "abbreviatedTitles": null, - "averageRating": 3.4857993435287, - "ratingFrequencies": { - "0.5": "22", - "1.0": "10", - "1.5": "16", - "2.0": "32", - "2.5": "74", - "3.0": "97", - "3.5": "118", - "4.0": "72", - "4.5": "34", - "5.0": "136", - "nil": "597", - "0.89": "-1", - "3.63": "-1", - "4.11": "-1", - "0.068": "-1", - "0.205": "-1", - "0.274": "-2", - "0.479": "-1", - "0.548": "-1", - "1.096": "-2", - "1.164": "-1", - "1.438": "-1", - "1.918": "-1", - "2.055": "-1", - "3.973": "-1", - "4.178": "-3", - "4.247": "-1", - "4.726": "-1", - "4.932": "-3", - "1.0958904109589": "3", - "0.89041095890411": "2", - "1.02739726027397": "1", - "1.16438356164384": "2", - "1.43835616438356": "2", - "1.57534246575342": "1", - "1.91780821917808": "1", - "2.05479452054794": "2", - "2.12328767123288": "1", - "2.73972602739726": "1", - "2.80821917808219": "2", - "2.94520547945205": "1", - "3.15068493150685": "1", - "3.35616438356164": "2", - "3.63013698630137": "2", - "3.97260273972603": "1", - "4.10958904109589": "2", - "4.17808219178082": "3", - "4.24657534246575": "1", - "4.38356164383562": "2", - "4.65753424657534": "1", - "4.72602739726027": "2", - "4.86301369863014": "1", - "4.93150684931507": "10", - "0.205479452054795": "1", - "0.273972602739726": "2", - "0.479452054794521": "2", - "0.547945205479452": "2", - "0.753424657534246": "1", - "0.0684931506849315": "1" - }, - "startDate": "2015-04-01", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/tiny.jpg?1427974534", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/small.jpg?1427974534", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/medium.jpg?1427974534", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/large.jpg?1427974534", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/original.jpg?1427974534" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/small.jpg?1427928458", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/large.jpg?1427928458", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/original.jpg?1427928458" - }, - "episodeCount": 1, - "episodeLength": 1, - "subtype": "ONA", - "youtubeVideoId": "", - "ageRating": "PG", - "ageRatingGuide": "Teens 13 or older", - "showType": "ONA", - "nsfw": false, - "relationships": { - "genres": ["3"], - "mappings": ["1755"] - } - }, - "11887": { - "slug": "brave-witches", - "synopsis": "In September 1944, allied forces led by the 501st Joint Fighter Wing \"Strike Witches\" successfully eliminate the Neuroi threat from the skies of the Republic of Gallia, thus ensuring the security of western Europe. Taking advantage of this victory, allied forces begin a full-fledged push toward central and eastern Europe. From a base in Petersburg in the Empire of Orussia, the 502nd Joint Fighter Wing \"Brave Witches,\" upon whom mankind has placed its hopes, flies with courage in the cold skies of eastern Europe.\n\n(Source: MAL News)", - "coverImageTopOffset": 380, - "titles": { - "en": "", - "en_jp": "Brave Witches", - "ja_jp": "\u30d6\u30ec\u30a4\u30d6\u30a6\u30a3\u30c3\u30c1\u30fc\u30ba" - }, - "canonicalTitle": "Brave Witches", - "abbreviatedTitles": null, - "averageRating": 3.5846888163849, - "ratingFrequencies": { - "0.5": "1", - "1.0": "4", - "1.5": "8", - "2.0": "12", - "2.5": "17", - "3.0": "33", - "3.5": "41", - "4.0": "32", - "4.5": "9", - "5.0": "19", - "nil": "620" - }, - "startDate": "2016-10-06", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/tiny.jpg?1476481854", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/small.jpg?1476481854", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/medium.jpg?1476481854", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/large.jpg?1476481854", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/original.png?1476481854" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/small.jpg?1479834725", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/large.jpg?1479834725", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/original.jpg?1479834725" - }, - "episodeCount": 12, - "episodeLength": 24, - "subtype": "TV", - "youtubeVideoId": "VLUqd-jEBuE", - "ageRating": "R", - "ageRatingGuide": "Mild Nudity", - "showType": "TV", - "nsfw": false, - "relationships": { - "genres": ["5", "8", "28", "1", "25"], - "mappings": ["2593"] - } - }, - "12024": { - "slug": "www-working", - "synopsis": "Daisuke Higashida is a serious first-year student at Higashizaka High School. He lives a peaceful everyday life even though he is not satisfied with the family who doesn't laugh at all and makes him tired. However, his father's company goes bankrupt one day, and he can no longer afford allowances, cellphone bills, and commuter tickets. When his father orders him to take up a part-time job, Daisuke decides to work at a nearby family restaurant in order to avoid traveling 15 kilometers to school by bicycle.", - "coverImageTopOffset": 165, - "titles": { - "en": "WWW.WAGNARIA!!", - "en_jp": "WWW.Working!!", - "ja_jp": "" - }, - "canonicalTitle": "WWW.Working!!", - "abbreviatedTitles": null, - "averageRating": 3.8238374224378, - "ratingFrequencies": { - "1.0": "2", - "1.5": "7", - "2.0": "19", - "2.5": "28", - "3.0": "68", - "3.5": "114", - "4.0": "144", - "4.5": "78", - "5.0": "74", - "nil": "1182" - }, - "startDate": "2016-10-01", - "endDate": "2016-12-24", - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/tiny.jpg?1473990267", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/small.jpg?1473990267", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/medium.jpg?1473990267", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/large.jpg?1473990267", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/original.jpg?1473990267" - }, - "coverImage": { - "small": "https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/small.jpg?1479834612", - "large": "https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/large.jpg?1479834612", - "original": "https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/original.png?1479834612" - }, - "episodeCount": 13, - "episodeLength": 23, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": "PG", - "ageRatingGuide": "Teens 13 or older", - "showType": "TV", - "nsfw": false, - "relationships": { - "genres": ["3", "16"], - "mappings": ["2538"] - } - }, - "12465": { - "slug": "bishoujo-yuugi-unit-crane-game-girls-galaxy", - "synopsis": "Second season of Bishoujo Yuugi Unit Crane Game Girls.", - "coverImageTopOffset": 0, - "titles": { - "en": "Crane Game Girls Galaxy", - "en_jp": "Bishoujo Yuugi Unit Crane Game Girls Galaxy", - "ja_jp": "\u7f8e\u5c11\u5973\u904a\u622f\u30e6\u30cb\u30c3\u30c8 \u30af\u30ec\u30fc\u30f3\u30b2\u30fc\u30eb\u30ae\u30e3\u30e9\u30af\u30b7\u30fc" - }, - "canonicalTitle": "Bishoujo Yuugi Unit Crane Game Girls Galaxy", - "abbreviatedTitles": null, - "averageRating": null, - "ratingFrequencies": { - "0.5": "2", - "1.0": "2", - "1.5": "0", - "2.0": "4", - "2.5": "6", - "3.0": "2", - "3.5": "4", - "4.0": "1", - "4.5": "2", - "nil": "66" - }, - "startDate": "2016-10-05", - "endDate": null, - "posterImage": { - "tiny": "https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/tiny.jpg?1473601756", - "small": "https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/small.jpg?1473601756", - "medium": "https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/medium.jpg?1473601756", - "large": "https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/large.jpg?1473601756", - "original": "https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/original.png?1473601756" - }, - "coverImage": null, - "episodeCount": null, - "episodeLength": 13, - "subtype": "TV", - "youtubeVideoId": "", - "ageRating": "PG", - "ageRatingGuide": "Children", - "showType": "TV", - "nsfw": false, - "relationships": { - "genres": ["3"], - "mappings": ["9871"] - } - } - }, - "genres": { - "24": { - "name": "School", - "slug": "school", - "description": null - }, - "35": { - "name": "Music", - "slug": "music", - "description": null - }, - "4": { - "name": "Drama", - "slug": "drama", - "description": "" - }, - "3": { - "name": "Comedy", - "slug": "comedy", - "description": null - }, - "5": { - "name": "Sci-Fi", - "slug": "sci-fi", - "description": null - }, - "8": { - "name": "Magic", - "slug": "magic", - "description": null - }, - "28": { - "name": "Military", - "slug": "military", - "description": null - }, - "1": { - "name": "Action", - "slug": "action", - "description": "" - }, - "25": { - "name": "Ecchi", - "slug": "ecchi", - "description": "" - }, - "16": { - "name": "Slice of Life", - "slug": "slice-of-life", - "description": "" - } - }, - "mappings": { - "3155": { - "externalSite": "myanimelist\/anime", - "externalId": "31988", - "relationships": [] - }, - "1755": { - "externalSite": "myanimelist\/anime", - "externalId": "30514", - "relationships": [] - }, - "2593": { - "externalSite": "myanimelist\/anime", - "externalId": "32866", - "relationships": [] - }, - "2538": { - "externalSite": "myanimelist\/anime", - "externalId": "33094", - "relationships": [] - }, - "9871": { - "externalSite": "myanimelist\/anime", - "externalId": "33541", - "relationships": [] - } - } -} \ No newline at end of file +{"anime":{"11474":{"slug":"hibike-euphonium-2","synopsis":"Second season of Hibike! Euphonium.","coverImageTopOffset":120,"titles":{"en":"Sound! Euphonium 2","en_jp":"Hibike! Euphonium 2","ja_jp":"\u97ff\u3051\uff01\u30e6\u30fc\u30d5\u30a9\u30cb\u30a2\u30e0 \uff12"},"canonicalTitle":"Hibike! Euphonium 2","abbreviatedTitles":null,"averageRating":4.1684326428476197,"ratingFrequencies":{"0.5":"1","1.0":"1","1.5":"2","2.0":"8","2.5":"13","3.0":"42","3.5":"90","4.0":"193","4.5":"180","5.0":"193","nil":"1972"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/tiny.jpg?1470781430","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/small.jpg?1470781430","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/medium.jpg?1470781430","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/large.jpg?1470781430","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11474\/original.jpg?1470781430"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/small.jpg?1476203965","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/large.jpg?1476203965","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11474\/original.jpg?1476203965"},"episodeCount":13,"episodeLength":25,"subtype":"TV","youtubeVideoId":"d2Di5swwzxg","ageRating":"PG","ageRatingGuide":"","showType":"TV","nsfw":false,"relationships":{"genres":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/genres","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/genres"},"data":[{"type":"genres","id":"24"},{"type":"genres","id":"35"},{"type":"genres","id":"4"}],"0":"24","1":"35","2":"4"},"castings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/castings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/castings"}},"installments":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/installments","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/installments"}},"mappings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/mappings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/mappings"},"data":[{"type":"mappings","id":"3155"}],"0":"3155"},"reviews":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/reviews","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/reviews"}},"episodes":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/episodes","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/episodes"}},"streamingLinks":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/relationships\/streaming-links","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11474\/streaming-links"}}}},"10802":{"slug":"nisekoimonogatari","synopsis":"Trailer for a fake anime created by Shaft as an April Fool's Day joke.","coverImageTopOffset":80,"titles":{"en":"","en_jp":"Nisekoimonogatari","ja_jp":""},"canonicalTitle":"Nisekoimonogatari","abbreviatedTitles":null,"averageRating":3.48579934352873,"ratingFrequencies":{"0.5":"22","1.0":"10","1.5":"16","2.0":"32","2.5":"74","3.0":"97","3.5":"118","4.0":"72","4.5":"34","5.0":"136","nil":"597","0.89":"-1","3.63":"-1","4.11":"-1","0.068":"-1","0.205":"-1","0.274":"-2","0.479":"-1","0.548":"-1","1.096":"-2","1.164":"-1","1.438":"-1","1.918":"-1","2.055":"-1","3.973":"-1","4.178":"-3","4.247":"-1","4.726":"-1","4.932":"-3","1.0958904109589":"3","0.89041095890411":"2","1.02739726027397":"1","1.16438356164384":"2","1.43835616438356":"2","1.57534246575342":"1","1.91780821917808":"1","2.05479452054794":"2","2.12328767123288":"1","2.73972602739726":"1","2.80821917808219":"2","2.94520547945205":"1","3.15068493150685":"1","3.35616438356164":"2","3.63013698630137":"2","3.97260273972603":"1","4.10958904109589":"2","4.17808219178082":"3","4.24657534246575":"1","4.38356164383562":"2","4.65753424657534":"1","4.72602739726027":"2","4.86301369863014":"1","4.93150684931507":"10","0.205479452054795":"1","0.273972602739726":"2","0.479452054794521":"2","0.547945205479452":"2","0.753424657534246":"1","0.0684931506849315":"1"},"startDate":"2015-04-01","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/tiny.jpg?1427974534","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/small.jpg?1427974534","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/medium.jpg?1427974534","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/large.jpg?1427974534","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/10802\/original.jpg?1427974534"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/small.jpg?1427928458","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/large.jpg?1427928458","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/10802\/original.jpg?1427928458"},"episodeCount":1,"episodeLength":1,"subtype":"ONA","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"ONA","nsfw":false,"relationships":{"genres":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/genres","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/genres"},"data":[{"type":"genres","id":"3"}],"0":"3"},"castings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/castings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/castings"}},"installments":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/installments","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/installments"}},"mappings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/mappings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/mappings"},"data":[{"type":"mappings","id":"1755"}],"0":"1755"},"reviews":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/reviews","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/reviews"}},"episodes":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/episodes","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/episodes"}},"streamingLinks":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/relationships\/streaming-links","related":"https:\/\/kitsu.io\/api\/edge\/anime\/10802\/streaming-links"}}}},"11887":{"slug":"brave-witches","synopsis":"In September 1944, allied forces led by the 501st Joint Fighter Wing \"Strike Witches\" successfully eliminate the Neuroi threat from the skies of the Republic of Gallia, thus ensuring the security of western Europe. Taking advantage of this victory, allied forces begin a full-fledged push toward central and eastern Europe. From a base in Petersburg in the Empire of Orussia, the 502nd Joint Fighter Wing \"Brave Witches,\" upon whom mankind has placed its hopes, flies with courage in the cold skies of eastern Europe.\n\n(Source: MAL News)","coverImageTopOffset":380,"titles":{"en":"","en_jp":"Brave Witches","ja_jp":"\u30d6\u30ec\u30a4\u30d6\u30a6\u30a3\u30c3\u30c1\u30fc\u30ba"},"canonicalTitle":"Brave Witches","abbreviatedTitles":null,"averageRating":3.5846888163849102,"ratingFrequencies":{"0.5":"1","1.0":"4","1.5":"8","2.0":"12","2.5":"17","3.0":"33","3.5":"41","4.0":"32","4.5":"9","5.0":"19","nil":"620"},"startDate":"2016-10-06","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/tiny.jpg?1476481854","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/small.jpg?1476481854","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/medium.jpg?1476481854","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/large.jpg?1476481854","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/11887\/original.png?1476481854"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/small.jpg?1479834725","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/large.jpg?1479834725","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/11887\/original.jpg?1479834725"},"episodeCount":12,"episodeLength":24,"subtype":"TV","youtubeVideoId":"VLUqd-jEBuE","ageRating":"R","ageRatingGuide":"Mild Nudity","showType":"TV","nsfw":false,"relationships":{"genres":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/genres","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/genres"},"data":[{"type":"genres","id":"5"},{"type":"genres","id":"8"},{"type":"genres","id":"28"},{"type":"genres","id":"1"},{"type":"genres","id":"25"}],"0":"5","1":"8","2":"28","3":"1","4":"25"},"castings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/castings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/castings"}},"installments":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/installments","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/installments"}},"mappings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/mappings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/mappings"},"data":[{"type":"mappings","id":"2593"}],"0":"2593"},"reviews":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/reviews","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/reviews"}},"episodes":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/episodes","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/episodes"}},"streamingLinks":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/relationships\/streaming-links","related":"https:\/\/kitsu.io\/api\/edge\/anime\/11887\/streaming-links"}}}},"12024":{"slug":"www-working","synopsis":"Daisuke Higashida is a serious first-year student at Higashizaka High School. He lives a peaceful everyday life even though he is not satisfied with the family who doesn't laugh at all and makes him tired. However, his father's company goes bankrupt one day, and he can no longer afford allowances, cellphone bills, and commuter tickets. When his father orders him to take up a part-time job, Daisuke decides to work at a nearby family restaurant in order to avoid traveling 15 kilometers to school by bicycle.","coverImageTopOffset":165,"titles":{"en":"WWW.WAGNARIA!!","en_jp":"WWW.Working!!","ja_jp":""},"canonicalTitle":"WWW.Working!!","abbreviatedTitles":null,"averageRating":3.8238374224378302,"ratingFrequencies":{"1.0":"2","1.5":"7","2.0":"19","2.5":"28","3.0":"68","3.5":"114","4.0":"144","4.5":"78","5.0":"74","nil":"1182"},"startDate":"2016-10-01","endDate":"2016-12-24","posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/tiny.jpg?1473990267","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/small.jpg?1473990267","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/medium.jpg?1473990267","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/large.jpg?1473990267","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12024\/original.jpg?1473990267"},"coverImage":{"small":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/small.jpg?1479834612","large":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/large.jpg?1479834612","original":"https:\/\/media.kitsu.io\/anime\/cover_images\/12024\/original.png?1479834612"},"episodeCount":13,"episodeLength":23,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Teens 13 or older","showType":"TV","nsfw":false,"relationships":{"genres":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/genres","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/genres"},"data":[{"type":"genres","id":"3"},{"type":"genres","id":"16"}],"0":"3","1":"16"},"castings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/castings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/castings"}},"installments":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/installments","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/installments"}},"mappings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/mappings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/mappings"},"data":[{"type":"mappings","id":"2538"}],"0":"2538"},"reviews":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/reviews","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/reviews"}},"episodes":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/episodes","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/episodes"}},"streamingLinks":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/relationships\/streaming-links","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12024\/streaming-links"}}}},"12465":{"slug":"bishoujo-yuugi-unit-crane-game-girls-galaxy","synopsis":"Second season of Bishoujo Yuugi Unit Crane Game Girls.","coverImageTopOffset":0,"titles":{"en":"Crane Game Girls Galaxy","en_jp":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","ja_jp":"\u7f8e\u5c11\u5973\u904a\u622f\u30e6\u30cb\u30c3\u30c8 \u30af\u30ec\u30fc\u30f3\u30b2\u30fc\u30eb\u30ae\u30e3\u30e9\u30af\u30b7\u30fc"},"canonicalTitle":"Bishoujo Yuugi Unit Crane Game Girls Galaxy","abbreviatedTitles":null,"averageRating":null,"ratingFrequencies":{"0.5":"2","1.0":"2","1.5":"0","2.0":"4","2.5":"6","3.0":"2","3.5":"4","4.0":"1","4.5":"2","nil":"66"},"startDate":"2016-10-05","endDate":null,"posterImage":{"tiny":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/tiny.jpg?1473601756","small":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/small.jpg?1473601756","medium":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/medium.jpg?1473601756","large":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/large.jpg?1473601756","original":"https:\/\/media.kitsu.io\/anime\/poster_images\/12465\/original.png?1473601756"},"coverImage":null,"episodeCount":null,"episodeLength":13,"subtype":"TV","youtubeVideoId":"","ageRating":"PG","ageRatingGuide":"Children","showType":"TV","nsfw":false,"relationships":{"genres":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/genres","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/genres"},"data":[{"type":"genres","id":"3"}],"0":"3"},"castings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/castings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/castings"}},"installments":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/installments","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/installments"}},"mappings":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/mappings","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/mappings"},"data":[{"type":"mappings","id":"9871"}],"0":"9871"},"reviews":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/reviews","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/reviews"}},"episodes":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/episodes","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/episodes"}},"streamingLinks":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/relationships\/streaming-links","related":"https:\/\/kitsu.io\/api\/edge\/anime\/12465\/streaming-links"}}}}},"genres":{"24":{"name":"School","slug":"school","description":null},"35":{"name":"Music","slug":"music","description":null},"4":{"name":"Drama","slug":"drama","description":""},"3":{"name":"Comedy","slug":"comedy","description":null},"5":{"name":"Sci-Fi","slug":"sci-fi","description":null},"8":{"name":"Magic","slug":"magic","description":null},"28":{"name":"Military","slug":"military","description":null},"1":{"name":"Action","slug":"action","description":""},"25":{"name":"Ecchi","slug":"ecchi","description":""},"16":{"name":"Slice of Life","slug":"slice-of-life","description":""}},"mappings":{"3155":{"externalSite":"myanimelist\/anime","externalId":"31988","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/3155\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/3155\/media"}}}},"1755":{"externalSite":"myanimelist\/anime","externalId":"30514","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/1755\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/1755\/media"}}}},"2593":{"externalSite":"myanimelist\/anime","externalId":"32866","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/2593\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/2593\/media"}}}},"2538":{"externalSite":"myanimelist\/anime","externalId":"33094","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/2538\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/2538\/media"}}}},"9871":{"externalSite":"myanimelist\/anime","externalId":"33541","relationships":{"media":{"links":{"self":"https:\/\/kitsu.io\/api\/edge\/mappings\/9871\/relationships\/media","related":"https:\/\/kitsu.io\/api\/edge\/mappings\/9871\/media"}}}}}} \ No newline at end of file