Version 5.1 - All the GraphQL #32

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

View File

@ -151,12 +151,13 @@ final class Model
* Create a list item with all the relevant data * Create a list item with all the relevant data
* *
* @param array $data * @param array $data
* @param string $type
* @return Request * @return Request
*/ */
public function createFullListItem(array $data): Request public function createFullListItem(array $data, string $type): Request
{ {
$createData = $data['data']; $createData = $data['data'];
$mediaId = $this->getMediaIdFromMalId($data['mal_id']); $mediaId = $this->getMediaIdFromMalId($data['mal_id'], strtoupper($type));
$createData['id'] = $mediaId; $createData['id'] = $mediaId;
@ -213,6 +214,7 @@ final class Model
* Remove a list item * Remove a list item
* *
* @param string $malId - The id of the list item to remove * @param string $malId - The id of the list item to remove
* @param string $type - Them media type (anime/manga)
* @return Request * @return Request
*/ */
public function deleteListItem(string $malId, string $type): 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($malIds, $kitsuMalIds);
$missingMalIds = array_diff($missingMalIds, $malBlackList); $missingMalIds = array_diff($missingMalIds, $malBlackList);
// Add items on Anilist, but not Kitsu to Kitsu
foreach($missingMalIds as $mid) foreach($missingMalIds as $mid)
{ {
$itemsToAddToKitsu[] = array_merge($anilistList[$mid]['data'], [ $itemsToAddToKitsu[] = array_merge($anilistList[$mid]['data'], [