try casting type directly

This commit is contained in:
Joe Howard 2025-01-26 20:08:32 -06:00
parent b6f5b1f45a
commit 8be58920ba

View file

@ -74,7 +74,7 @@ export default class {
}
async search(query: string, shouldSplitChapters: boolean): Promise<SongMetadata[]> {
const {items} = await this.ytsrQueue.add<ytsr.VideoResult>(async () => this.cache.wrap(
const {items}: ytsr.VideoResult | void = await this.ytsrQueue.add<ytsr.VideoResult>(async () => this.cache.wrap(
ytsr,
query,
{
@ -85,6 +85,10 @@ export default class {
},
));
if (!items) {
return [];
}
let firstVideo: Video | undefined;
for (const item of items) {