feat(sidebar): add dialogue selection and copying (#238)

This commit is contained in:
2026-09-07 14:03:54 -07:00
committed by GitHub
parent c14c690875
commit 1e5d7747b4
24 changed files with 624 additions and 3 deletions
+28
View File
@@ -5724,6 +5724,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
const client = appState.mpvClient;
if (!client?.connected) {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,
@@ -5743,6 +5747,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
const videoPath = typeof videoPathRaw === 'string' ? videoPathRaw : '';
if (!videoPath) {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,
@@ -5757,6 +5765,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
})
) {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,
@@ -5773,6 +5785,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
});
if (!resolvedSource) {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,
@@ -5783,6 +5799,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
try {
if (appState.activeParsedSubtitleSource === resolvedSource.sourceKey) {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,
@@ -5796,6 +5816,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
appState.activeParsedSubtitleSource = resolvedSource.sourceKey;
appState.activeParsedSubtitleMediaPath = videoPath || null;
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues,
currentTimeSec,
currentSubtitle,
@@ -5806,6 +5830,10 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
}
} catch {
return {
sourceKey: JSON.stringify([
appState.activeParsedSubtitleMediaPath,
appState.activeParsedSubtitleSource,
]),
cues: appState.activeParsedSubtitleCues,
currentTimeSec,
currentSubtitle,