mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-28 04:46:07 -08:00
fix(subsync): recheck cancellation after the secondary selection read
This commit is contained in:
1 file changed
+3
-2
@@ -509,10 +509,11 @@ export async function loadSyncedSubtitle(
|
|||||||
if (addedTrackId === null) {
|
if (addedTrackId === null) {
|
||||||
throw new Error('Synchronized subtitle did not appear in the mpv track list');
|
throw new Error('Synchronized subtitle did not appear in the mpv track list');
|
||||||
}
|
}
|
||||||
signal?.throwIfAborted();
|
|
||||||
// The lookup polls for a while; if the user picked another secondary track meanwhile,
|
// The lookup polls for a while; if the user picked another secondary track meanwhile,
|
||||||
// keep their choice (and delay) rather than overriding it.
|
// keep their choice (and delay) rather than overriding it.
|
||||||
if ((await client.requestProperty('secondary-sid')) !== secondaryBeforeAdd) {
|
const secondaryAfterLookup = await client.requestProperty('secondary-sid');
|
||||||
|
signal?.throwIfAborted();
|
||||||
|
if (secondaryAfterLookup !== secondaryBeforeAdd) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Secondary subtitle changed while loading; saved the synced file at ${pathToLoad} without selecting it.`,
|
`Secondary subtitle changed while loading; saved the synced file at ${pathToLoad} without selecting it.`,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user