From 2a15569e57cfedf9fc2c89160bbd94f5f1ca9a0a Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Tue, 7 Jul 2020 18:20:53 +0200 Subject: [PATCH 1/2] Use new SyncPlay API client --- src/components/syncPlay/groupSelectionMenu.js | 8 ++++---- src/components/syncPlay/syncPlayManager.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/syncPlay/groupSelectionMenu.js b/src/components/syncPlay/groupSelectionMenu.js index 48b22261f4..3c77a67ea5 100644 --- a/src/components/syncPlay/groupSelectionMenu.js +++ b/src/components/syncPlay/groupSelectionMenu.js @@ -37,7 +37,7 @@ function showNewJoinGroupSelection (button, user, apiClient) { console.debug('No item is currently playing.'); } - apiClient.sendSyncPlayCommand('ListGroups').then(function (response) { + apiClient.getSyncPlayGroups().then(function (response) { response.json().then(function (groups) { var menuItems = groups.map(function (group) { return { @@ -83,9 +83,9 @@ function showNewJoinGroupSelection (button, user, apiClient) { actionsheet.show(menuOptions).then(function (id) { if (id == 'new-group') { - apiClient.sendSyncPlayCommand('NewGroup'); + apiClient.createSyncPlayGroup(); } else { - apiClient.sendSyncPlayCommand('JoinGroup', { + apiClient.joinSyncPlayGroup({ GroupId: id, PlayingItemId: playingItemId }); @@ -140,7 +140,7 @@ function showLeaveGroupSelection (button, user, apiClient) { actionsheet.show(menuOptions).then(function (id) { if (id == 'leave-group') { - apiClient.sendSyncPlayCommand('LeaveGroup'); + apiClient.leaveSyncPlayGroup(); } }).catch((error) => { console.error('SyncPlay: unexpected error showing group menu:', error); diff --git a/src/components/syncPlay/syncPlayManager.js b/src/components/syncPlay/syncPlayManager.js index 860e3edcd4..c847fbaede 100644 --- a/src/components/syncPlay/syncPlayManager.js +++ b/src/components/syncPlay/syncPlayManager.js @@ -139,7 +139,7 @@ class SyncPlayManager { return; } - apiClient.sendSyncPlayCommand('UpdatePing', { + apiClient.sendSyncPlayPing({ Ping: ping }); } @@ -447,7 +447,7 @@ class SyncPlayManager { if (!success) { console.warning('Error reporting playback state to server. Joining group will fail.'); } - apiClient.sendSyncPlayCommand('JoinGroup', { + apiClient.joinSyncPlayGroup({ GroupId: groupId, PlayingItemId: playingItemId }); @@ -658,7 +658,7 @@ class SyncPlayManager { */ playRequest (player) { var apiClient = connectionManager.currentApiClient(); - apiClient.sendSyncPlayCommand('PlayRequest'); + apiClient.requestSyncPlayStart(); } /** @@ -666,7 +666,7 @@ class SyncPlayManager { */ pauseRequest (player) { var apiClient = connectionManager.currentApiClient(); - apiClient.sendSyncPlayCommand('PauseRequest'); + apiClient.requestSyncPlayPause(); // Pause locally as well, to give the user some little control playbackManager._localUnpause(player); } @@ -676,7 +676,7 @@ class SyncPlayManager { */ seekRequest (PositionTicks, player) { var apiClient = connectionManager.currentApiClient(); - apiClient.sendSyncPlayCommand('SeekRequest', { + apiClient.requestSyncPlaySeek({ PositionTicks: PositionTicks }); } From 6cf9cf6632d0300b72ba990be6288c3e36b6b027 Mon Sep 17 00:00:00 2001 From: MrTimscampi Date: Thu, 9 Jul 2020 22:23:50 +0200 Subject: [PATCH 2/2] Upgrade jellyfin-apiclient --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 51b17ae8a9..cbbf1fc6ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6316,9 +6316,9 @@ isurl@^1.0.0-alpha5: is-object "^1.0.1" jellyfin-apiclient@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.3.1.tgz#7ecaa986dbb6e36cce9d8f94dd66619419afa32d" - integrity sha512-PQUKFDcQOy4hJ43Jc3Lm3571zONlTjr2qmr6pEVcfLZs7Lvwa4oUu/yonH6MMxpjZOvTbcirjer+XXgF2RwXyA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.4.0.tgz#d8fedc88cc177597290687be31e38de3cd0d035a" + integrity sha512-v2lcSZwcbKh3YSrZkBwNM7tisxvUJHZawz0xpxIobEI6MHrQLo4oDdm1zHXN6Mku9uzbuBpbAV1tA6XJwVVTyA== "jellyfin-noto@https://github.com/jellyfin/jellyfin-noto": version "1.0.3"