diff --git a/playlet-lib/src/components/VideoQueue/VideoQueue.bs b/playlet-lib/src/components/VideoQueue/VideoQueue.bs index 3df96729..7c565c0d 100644 --- a/playlet-lib/src/components/VideoQueue/VideoQueue.bs +++ b/playlet-lib/src/components/VideoQueue/VideoQueue.bs @@ -236,16 +236,16 @@ function FindPlaylistVideosInQueue(videoNodes as object) as integer queueVideos = m.content.getChildren(-1, 0) ' array in array search based on node.videoId, starting from the end - for i = queueCount - 1 to playlistCount step -1 + for i = queueCount - playlistCount to 0 step -1 found = true for j = 0 to playlistCount - 1 - if queueVideos[i - j].videoId <> videoNodes[j].videoId + if queueVideos[i + j].videoId <> videoNodes[j].videoId found = false exit for end if end for if found - return i - playlistCount + 1 + return i end if end for