mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-21 04:59:53 +02:00
play on next when paused
This commit is contained in:
@@ -32,6 +32,7 @@ import { AstraLibraryData } from '../../modules/astra-library-scanner';
|
||||
import { useDesktopSyncStore } from '@/stores/desktopSyncStore';
|
||||
import { identityMatchesPinnedConnection } from '@/services/desktopSyncPolicy';
|
||||
import { ensureDesktopRemoteCredentialsFresh } from '@/services/desktopRemoteSession';
|
||||
import { desktopRemoteControlSequence } from '@/services/desktopRemoteTransport';
|
||||
import { usePlaybackTargetStore } from '@/stores/playbackTargetStore';
|
||||
import type {
|
||||
DesktopRemoteConnection,
|
||||
@@ -732,16 +733,22 @@ export const useDesktopRemoteStore = create<DesktopRemoteStore>((set, get) => {
|
||||
},
|
||||
|
||||
sendControl: async (command, time) => {
|
||||
const { connection, token } = get();
|
||||
const { connection, token, snapshot } = get();
|
||||
if (!connection || !token) return;
|
||||
try {
|
||||
await sendDesktopRemoteControl(
|
||||
connection.baseUrl,
|
||||
token,
|
||||
connection.certificateFingerprint,
|
||||
const commands = desktopRemoteControlSequence(
|
||||
command,
|
||||
time
|
||||
snapshot?.playbackState,
|
||||
);
|
||||
for (const nextCommand of commands) {
|
||||
await sendDesktopRemoteControl(
|
||||
connection.baseUrl,
|
||||
token,
|
||||
connection.certificateFingerprint,
|
||||
nextCommand,
|
||||
nextCommand === command ? time : undefined,
|
||||
);
|
||||
}
|
||||
set({ errorMessage: '' });
|
||||
if (command === 'seek' && typeof time === 'number') {
|
||||
set((state) => state.snapshot
|
||||
|
||||
Reference in New Issue
Block a user