Fix exploration for multiple videos
This commit is contained in:
parent
bd2300303b
commit
bf2730f991
|
@ -28,6 +28,9 @@ export const exploreVideos = async (videoId, onUpdate) =>
|
||||||
while (queue.length > 0)
|
while (queue.length > 0)
|
||||||
{
|
{
|
||||||
const currentId = queue.shift();
|
const currentId = queue.shift();
|
||||||
|
|
||||||
|
if (!(currentId in videosNodes))
|
||||||
|
{
|
||||||
const config = await api.getPlayerConfig(currentId);
|
const config = await api.getPlayerConfig(currentId);
|
||||||
const meta = api.getVideoMeta(config);
|
const meta = api.getVideoMeta(config);
|
||||||
|
|
||||||
|
@ -41,8 +44,6 @@ export const exploreVideos = async (videoId, onUpdate) =>
|
||||||
.forEach(nextId => nextVideos[meta.videoId].add(nextId));
|
.forEach(nextId => nextVideos[meta.videoId].add(nextId));
|
||||||
|
|
||||||
for (let nextId of nextVideos[meta.videoId])
|
for (let nextId of nextVideos[meta.videoId])
|
||||||
{
|
|
||||||
if (!(nextId in videosNodes))
|
|
||||||
{
|
{
|
||||||
queue.push(nextId);
|
queue.push(nextId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue