mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1475 from crobibero/syncplay-api
remove sessionId parameter from api calls
This commit is contained in:
commit
6ca47a891b
4 changed files with 14 additions and 17 deletions
|
@ -66,7 +66,7 @@
|
||||||
"hls.js": "^0.13.1",
|
"hls.js": "^0.13.1",
|
||||||
"howler": "^2.2.0",
|
"howler": "^2.2.0",
|
||||||
"intersection-observer": "^0.10.0",
|
"intersection-observer": "^0.10.0",
|
||||||
"jellyfin-apiclient": "^1.2.2",
|
"jellyfin-apiclient": "^1.3.0",
|
||||||
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
|
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
|
||||||
"jquery": "^3.5.1",
|
"jquery": "^3.5.1",
|
||||||
"jstree": "^3.3.10",
|
"jstree": "^3.3.10",
|
||||||
|
|
|
@ -37,7 +37,7 @@ function showNewJoinGroupSelection (button, user, apiClient) {
|
||||||
console.debug('No item is currently playing.');
|
console.debug('No item is currently playing.');
|
||||||
}
|
}
|
||||||
|
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'ListGroups').then(function (response) {
|
apiClient.sendSyncPlayCommand('ListGroups').then(function (response) {
|
||||||
response.json().then(function (groups) {
|
response.json().then(function (groups) {
|
||||||
var menuItems = groups.map(function (group) {
|
var menuItems = groups.map(function (group) {
|
||||||
return {
|
return {
|
||||||
|
@ -83,9 +83,9 @@ function showNewJoinGroupSelection (button, user, apiClient) {
|
||||||
|
|
||||||
actionsheet.show(menuOptions).then(function (id) {
|
actionsheet.show(menuOptions).then(function (id) {
|
||||||
if (id == 'new-group') {
|
if (id == 'new-group') {
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'NewGroup');
|
apiClient.sendSyncPlayCommand('NewGroup');
|
||||||
} else {
|
} else {
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'JoinGroup', {
|
apiClient.sendSyncPlayCommand('JoinGroup', {
|
||||||
GroupId: id,
|
GroupId: id,
|
||||||
PlayingItemId: playingItemId
|
PlayingItemId: playingItemId
|
||||||
});
|
});
|
||||||
|
@ -140,7 +140,7 @@ function showLeaveGroupSelection (button, user, apiClient) {
|
||||||
|
|
||||||
actionsheet.show(menuOptions).then(function (id) {
|
actionsheet.show(menuOptions).then(function (id) {
|
||||||
if (id == 'leave-group') {
|
if (id == 'leave-group') {
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'LeaveGroup');
|
apiClient.sendSyncPlayCommand('LeaveGroup');
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error('SyncPlay: unexpected error showing group menu:', error);
|
console.error('SyncPlay: unexpected error showing group menu:', error);
|
||||||
|
|
|
@ -139,7 +139,7 @@ class SyncPlayManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'UpdatePing', {
|
apiClient.sendSyncPlayCommand('UpdatePing', {
|
||||||
Ping: ping
|
Ping: ping
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ class SyncPlayManager {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
console.warning('Error reporting playback state to server. Joining group will fail.');
|
console.warning('Error reporting playback state to server. Joining group will fail.');
|
||||||
}
|
}
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'JoinGroup', {
|
apiClient.sendSyncPlayCommand('JoinGroup', {
|
||||||
GroupId: groupId,
|
GroupId: groupId,
|
||||||
PlayingItemId: playingItemId
|
PlayingItemId: playingItemId
|
||||||
});
|
});
|
||||||
|
@ -658,8 +658,7 @@ class SyncPlayManager {
|
||||||
*/
|
*/
|
||||||
playRequest (player) {
|
playRequest (player) {
|
||||||
var apiClient = connectionManager.currentApiClient();
|
var apiClient = connectionManager.currentApiClient();
|
||||||
var sessionId = getActivePlayerId();
|
apiClient.sendSyncPlayCommand('PlayRequest');
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'PlayRequest');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -667,8 +666,7 @@ class SyncPlayManager {
|
||||||
*/
|
*/
|
||||||
pauseRequest (player) {
|
pauseRequest (player) {
|
||||||
var apiClient = connectionManager.currentApiClient();
|
var apiClient = connectionManager.currentApiClient();
|
||||||
var sessionId = getActivePlayerId();
|
apiClient.sendSyncPlayCommand('PauseRequest');
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'PauseRequest');
|
|
||||||
// Pause locally as well, to give the user some little control
|
// Pause locally as well, to give the user some little control
|
||||||
playbackManager._localUnpause(player);
|
playbackManager._localUnpause(player);
|
||||||
}
|
}
|
||||||
|
@ -678,8 +676,7 @@ class SyncPlayManager {
|
||||||
*/
|
*/
|
||||||
seekRequest (PositionTicks, player) {
|
seekRequest (PositionTicks, player) {
|
||||||
var apiClient = connectionManager.currentApiClient();
|
var apiClient = connectionManager.currentApiClient();
|
||||||
var sessionId = getActivePlayerId();
|
apiClient.sendSyncPlayCommand('SeekRequest', {
|
||||||
apiClient.sendSyncPlayCommand(sessionId, 'SeekRequest', {
|
|
||||||
PositionTicks: PositionTicks
|
PositionTicks: PositionTicks
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -6273,10 +6273,10 @@ isurl@^1.0.0-alpha5:
|
||||||
has-to-string-tag-x "^1.2.0"
|
has-to-string-tag-x "^1.2.0"
|
||||||
is-object "^1.0.1"
|
is-object "^1.0.1"
|
||||||
|
|
||||||
jellyfin-apiclient@^1.2.2:
|
jellyfin-apiclient@^1.3.0:
|
||||||
version "1.2.2"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.2.2.tgz#64f058320603df02d926f4c1b929b42c6acc4527"
|
resolved "https://registry.yarnpkg.com/jellyfin-apiclient/-/jellyfin-apiclient-1.3.0.tgz#428ec998ef17a755a7c07f6284f6eb4a56a63242"
|
||||||
integrity sha512-UwC56orm4darWlnNQJ1nbKo+W8ywlheJSJC6d9zm06CslYtOc/Dkv9kz2PadQEh+6EiBsB0hAZCc7FJ9ahOoGQ==
|
integrity sha512-jq+erwtg175Vg/VnxPdMIc+R2e0+t22T42tJiirMU84xBgk+h3maJar7Umr5NHyfkbt6J8d0TmR2O7nXwVpR+w==
|
||||||
|
|
||||||
"jellyfin-noto@https://github.com/jellyfin/jellyfin-noto":
|
"jellyfin-noto@https://github.com/jellyfin/jellyfin-noto":
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue