Fix syncing manga to anilist when you have to create a new list item

This commit is contained in:
Timothy Warren 2019-07-11 15:24:34 -04:00
parent 51bf392d1b
commit 5bf8277376
2 changed files with 5 additions and 2 deletions

View File

@ -151,12 +151,13 @@ final class Model
* Create a list item with all the relevant data
*
* @param array $data
* @param string $type
* @return Request
*/
public function createFullListItem(array $data): Request
public function createFullListItem(array $data, string $type): Request
{
$createData = $data['data'];
$mediaId = $this->getMediaIdFromMalId($data['mal_id']);
$mediaId = $this->getMediaIdFromMalId($data['mal_id'], strtoupper($type));
$createData['id'] = $mediaId;
@ -213,6 +214,7 @@ final class Model
* Remove a list item
*
* @param string $malId - The id of the list item to remove
* @param string $type - Them media type (anime/manga)
* @return Request
*/
public function deleteListItem(string $malId, string $type): Request

View File

@ -325,6 +325,7 @@ final class SyncLists extends BaseCommand {
$missingMalIds = array_diff($malIds, $kitsuMalIds);
$missingMalIds = array_diff($missingMalIds, $malBlackList);
// Add items on Anilist, but not Kitsu to Kitsu
foreach($missingMalIds as $mid)
{
$itemsToAddToKitsu[] = array_merge($anilistList[$mid]['data'], [