From 12c9fc1b2e6e2a8f7f484abd8078e3564ce77544 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 21 Apr 2021 19:33:51 -0400 Subject: [PATCH] Update filtering of MAL IDs for items to check to update --- src/AnimeClient/Command/SyncLists.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AnimeClient/Command/SyncLists.php b/src/AnimeClient/Command/SyncLists.php index 01964a2b..abf4c2df 100644 --- a/src/AnimeClient/Command/SyncLists.php +++ b/src/AnimeClient/Command/SyncLists.php @@ -413,7 +413,7 @@ final class SyncLists extends BaseCommand { $malIds = array_keys($anilistList); $kitsuMalIds = array_map('intval', array_column($kitsuList, 'malId')); - $missingMalIds = array_filter(array_diff($kitsuMalIds, $malIds), fn ($id) => ! in_array($id, $kitsuMalIds)); + $missingMalIds = array_filter($malIds, fn ($id) => ! in_array($id, $kitsuMalIds)); // Add items on Anilist, but not Kitsu to Kitsu foreach($missingMalIds as $mid) @@ -747,7 +747,7 @@ final class SyncLists extends BaseCommand { $responseData = Json::decode($response); $id = $itemsToUpdate[$key]['id']; - $mal_id = $itemsToUpdate[$key]['mal_id']; + $mal_id = $itemsToUpdate[$key]['mal_id'] ?? NULL; if ( ! array_key_exists('errors', $responseData)) { $verb = ($action === SyncAction::UPDATE) ? 'updated' : 'created';