diff --git a/client/src/components/AddPreview.vue b/client/src/components/AddPreview.vue index ce98f9785..9da150153 100644 --- a/client/src/components/AddPreview.vue +++ b/client/src/components/AddPreview.vue @@ -236,6 +236,7 @@ async function requestAddPreviewExplicit() { isLoadingAddPreview.value = true; hasAddPreviewFailed.value = false; videos.value = []; + highlightedAddPreviewItem.value = undefined; await requestAddPreview(); } async function addAllToQueue() { @@ -261,16 +262,19 @@ function onInputAddPreviewChange() { hasAddPreviewFailed.value = false; if (!inputAddPreview.value || _.trim(inputAddPreview.value).length === 0) { videos.value = []; + highlightedAddPreviewItem.value = undefined; return; } if (!isAddPreviewInputUrl.value) { videos.value = []; + highlightedAddPreviewItem.value = undefined; // Don't send API requests for non URL inputs without the user's explicit input to do so. // This is to help conserve youtube API quota. return; } isLoadingAddPreview.value = true; videos.value = []; + highlightedAddPreviewItem.value = undefined; requestAddPreviewDebounced(); } function onInputAddPreviewKeyDown(e) { diff --git a/server/infoextractor.ts b/server/infoextractor.ts index 3641f1535..6e1ee75c4 100644 --- a/server/infoextractor.ts +++ b/server/infoextractor.ts @@ -383,14 +383,16 @@ export default { return new AddPreview(completeResults, cacheDuration); } else { const videos = fetchResults.videos; - const completeResults = await this.getManyVideoInfo(videos); - return new AddPreview( - { - videos: completeResults, - highlighted: fetchResults.highlighted, - }, - cacheDuration - ); + const completeResults: BulkVideoResult = { + videos: await this.getManyVideoInfo(videos), + highlighted: fetchResults.highlighted + ? await this.getVideoInfo( + fetchResults.highlighted.service, + fetchResults.highlighted.id + ) + : undefined, + }; + return new AddPreview(completeResults, cacheDuration); } } else { if (query.length < ADD_PREVIEW_SEARCH_MIN_LENGTH) {