From b383e16f968d9c322322de3a28d81999d9317921 Mon Sep 17 00:00:00 2001 From: Willy Reyno Date: Wed, 22 May 2024 17:10:12 +0200 Subject: [PATCH 1/4] Add support for undocumented "isPublic" parameter when creating playlist --- .../LibraryPlaylistCreationRequest.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Request/LibraryPlaylistCreationRequest.php b/src/Request/LibraryPlaylistCreationRequest.php index ac27bc4..3c6f8cd 100644 --- a/src/Request/LibraryPlaylistCreationRequest.php +++ b/src/Request/LibraryPlaylistCreationRequest.php @@ -19,6 +19,11 @@ class LibraryPlaylistCreationRequest */ protected $description = ''; + /** + * @var bool + */ + protected $isPublic = false; + /** * @var LibraryResource[] */ @@ -64,6 +69,22 @@ public function getDescription(): string return $this->description; } + /** + * @param bool $isPublic + */ + public function setIsPublic(bool $isPublic): void + { + $this->isPublic = $isPublic; + } + + /** + * @return bool + */ + public function getIsPublic(): bool + { + return $this->isPublic; + } + /** * @param LibraryResource $track */ From b08382a5e69ae864c29edc6b97296d58ec60965b Mon Sep 17 00:00:00 2001 From: Willy Reyno Date: Wed, 22 May 2024 17:11:55 +0200 Subject: [PATCH 2/4] Add support for isPublic when creating a library playlist --- src/AppleMusicAPI.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AppleMusicAPI.php b/src/AppleMusicAPI.php index 796eccc..2548175 100644 --- a/src/AppleMusicAPI.php +++ b/src/AppleMusicAPI.php @@ -508,6 +508,7 @@ public function createLibraryPlaylist(LibraryPlaylistCreationRequest $playlist) $requestBody['attributes'] = [ 'name' => $playlist->getName(), 'description' => $playlist->getDescription(), + 'isPublic' => $playlist->getIsPublic(), ]; foreach ($playlist->getTracks() as $track) { From 525e9c892cec4ddd661d20507f934e196d3eae6e Mon Sep 17 00:00:00 2001 From: Willy Reyno Date: Wed, 22 May 2024 19:44:42 +0200 Subject: [PATCH 3/4] Rename getIsPublic to isPublic --- src/Request/LibraryPlaylistCreationRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Request/LibraryPlaylistCreationRequest.php b/src/Request/LibraryPlaylistCreationRequest.php index 3c6f8cd..905bcc6 100644 --- a/src/Request/LibraryPlaylistCreationRequest.php +++ b/src/Request/LibraryPlaylistCreationRequest.php @@ -80,7 +80,7 @@ public function setIsPublic(bool $isPublic): void /** * @return bool */ - public function getIsPublic(): bool + public function isPublic(): bool { return $this->isPublic; } From 1d14f5511b50216f511213d85bf49bd0825ff59e Mon Sep 17 00:00:00 2001 From: Willy Reyno Date: Wed, 22 May 2024 19:45:02 +0200 Subject: [PATCH 4/4] Rename getIsPublic to isPublic --- src/AppleMusicAPI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppleMusicAPI.php b/src/AppleMusicAPI.php index 2548175..e7fa402 100644 --- a/src/AppleMusicAPI.php +++ b/src/AppleMusicAPI.php @@ -508,7 +508,7 @@ public function createLibraryPlaylist(LibraryPlaylistCreationRequest $playlist) $requestBody['attributes'] = [ 'name' => $playlist->getName(), 'description' => $playlist->getDescription(), - 'isPublic' => $playlist->getIsPublic(), + 'isPublic' => $playlist->isPublic(), ]; foreach ($playlist->getTracks() as $track) {