Rename 'track' into 'item' in SyncPlay

This commit is contained in:
Ionut Andrei Oanca 2020-12-03 15:55:28 +01:00
parent 308deaceba
commit b71b53eb6a
4 changed files with 15 additions and 15 deletions

View File

@ -71,7 +71,7 @@ class Controller {
const apiClient = this.manager.getApiClient();
const sendPlayRequest = (items) => {
const queue = items.map(item => item.Id);
apiClient.requestSyncPlayPlay({
apiClient.requestSyncPlaySetNewQueue({
PlayingQueue: queue,
PlayingItemPosition: options.startIndex ? options.startIndex : 0,
StartPositionTicks: options.startPositionTicks ? options.startPositionTicks : 0
@ -163,21 +163,21 @@ class Controller {
}
/**
* Plays next track from playlist in SyncPlay group.
* Plays next item from playlist in SyncPlay group.
*/
nextTrack() {
nextItem() {
const apiClient = this.manager.getApiClient();
apiClient.requestSyncPlayNextTrack({
apiClient.requestSyncPlayNextItem({
PlaylistItemId: this.manager.getQueueCore().getCurrentPlaylistItemId()
});
}
/**
* Plays previous track from playlist in SyncPlay group.
* Plays previous item from playlist in SyncPlay group.
*/
previousTrack() {
previousItem() {
const apiClient = this.manager.getApiClient();
apiClient.requestSyncPlayPreviousTrack({
apiClient.requestSyncPlayPreviousItem({
PlaylistItemId: this.manager.getQueueCore().getCurrentPlaylistItemId()
});
}

View File

@ -66,8 +66,8 @@ class QueueCore {
break;
}
case 'SetCurrentItem':
case 'NextTrack':
case 'PreviousTrack': {
case 'NextItem':
case 'PreviousItem': {
playerWrapper.onQueueUpdate();
const playlistItemId = this.getCurrentPlaylistItemId();

View File

@ -267,14 +267,14 @@ class GenericPlayer {
/**
* Picks next item in playlist.
*/
localNextTrack() {
localNextItem() {
}
/**
* Picks previous item in playlist.
*/
localPreviousTrack() {
localPreviousItem() {
}

View File

@ -284,7 +284,7 @@ class NoActivePlayer extends SyncPlay.Players.GenericPlayer {
*/
nextTrackRequest(player) {
const controller = syncPlayManager.getController();
controller.nextTrack();
controller.nextItem();
}
/**
@ -292,7 +292,7 @@ class NoActivePlayer extends SyncPlay.Players.GenericPlayer {
*/
previousTrackRequest(player) {
const controller = syncPlayManager.getController();
controller.previousTrack();
controller.previousItem();
}
/**
@ -388,7 +388,7 @@ class NoActivePlayer extends SyncPlay.Players.GenericPlayer {
/**
* Calls original PlaybackManager's nextTrack method.
*/
localNextTrack() {
localNextItem() {
if (playbackManager.syncPlayEnabled) {
playbackManager._localNextTrack(this.player);
} else {
@ -399,7 +399,7 @@ class NoActivePlayer extends SyncPlay.Players.GenericPlayer {
/**
* Calls original PlaybackManager's previousTrack method.
*/
localPreviousTrack() {
localPreviousItem() {
if (playbackManager.syncPlayEnabled) {
playbackManager._localPreviousTrack(this.player);
} else {