mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-27 17:22:42 +02:00
remove items destruturing
This commit is contained in:
parent
8be58920ba
commit
0bc39279a5
1 changed files with 3 additions and 3 deletions
|
@ -74,7 +74,7 @@ export default class {
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(query: string, shouldSplitChapters: boolean): Promise<SongMetadata[]> {
|
async search(query: string, shouldSplitChapters: boolean): Promise<SongMetadata[]> {
|
||||||
const {items}: ytsr.VideoResult | void = await this.ytsrQueue.add<ytsr.VideoResult>(async () => this.cache.wrap(
|
const result = await this.ytsrQueue.add<ytsr.VideoResult>(async () => this.cache.wrap(
|
||||||
ytsr,
|
ytsr,
|
||||||
query,
|
query,
|
||||||
{
|
{
|
||||||
|
@ -85,13 +85,13 @@ export default class {
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
if (!items) {
|
if (result === undefined) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let firstVideo: Video | undefined;
|
let firstVideo: Video | undefined;
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of result.items) {
|
||||||
if (item.type === 'video') {
|
if (item.type === 'video') {
|
||||||
firstVideo = item;
|
firstVideo = item;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue