Ignore double loads (fixes #84)
This commit is contained in:
parent
60ddc1fc89
commit
f85c7b1a65
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,7 @@ import {
|
||||||
} from "@reduxjs/toolkit";
|
} from "@reduxjs/toolkit";
|
||||||
import fetchProgress, { FetchProgressData } from "fetch-progress";
|
import fetchProgress, { FetchProgressData } from "fetch-progress";
|
||||||
import Between from "between.js";
|
import Between from "between.js";
|
||||||
import { PlanItem } from "../showplanner/state";
|
import { itemId, PlanItem } from "../showplanner/state";
|
||||||
import * as BroadcastState from "../broadcast/state";
|
import * as BroadcastState from "../broadcast/state";
|
||||||
import Keys from "keymaster";
|
import Keys from "keymaster";
|
||||||
import { Track, MYRADIO_NON_API_BASE, AuxItem } from "../api";
|
import { Track, MYRADIO_NON_API_BASE, AuxItem } from "../api";
|
||||||
|
@ -327,6 +327,11 @@ export const load = (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If this is already the currently loaded item, don't bother
|
||||||
|
const currentItem = getState().mixer.players[player].loadedItem;
|
||||||
|
if (currentItem !== null && itemId(currentItem) === itemId(item)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// If we're already loading something, abort it
|
// If we're already loading something, abort it
|
||||||
if (typeof loadAbortControllers[player] !== "undefined") {
|
if (typeof loadAbortControllers[player] !== "undefined") {
|
||||||
loadAbortControllers[player].abort();
|
loadAbortControllers[player].abort();
|
||||||
|
|
Loading…
Reference in a new issue