mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-05-10 04:01:37 +02:00
Bump packages
This commit is contained in:
parent
4f0ab9b549
commit
599dbce6e6
15 changed files with 20134 additions and 6734 deletions
|
@ -29,7 +29,7 @@ export default class {
|
|||
const {items: [video]} = await this.youtube.videos.search({q: query, maxResults: 1, type: 'video'});
|
||||
|
||||
return await this.youtubeVideo(video.id.videoId);
|
||||
} catch (_) {
|
||||
} catch (_: unknown) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ export default class {
|
|||
playlist: null,
|
||||
isLive: videoDetails.snippet.liveBroadcastContent === 'live'
|
||||
};
|
||||
} catch (_) {
|
||||
} catch (_: unknown) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ export default class {
|
|||
playlist,
|
||||
isLive: video.live
|
||||
};
|
||||
} catch (_) {
|
||||
} catch (_: unknown) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ export default class {
|
|||
|
||||
resolve();
|
||||
}, duration * 1000);
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -141,7 +141,7 @@ export default class {
|
|||
this.startTrackingPosition(0);
|
||||
this.lastSongURL = currentSong.url;
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
this.removeCurrent();
|
||||
throw error;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ export default class {
|
|||
this.status = STATUS.PAUSED;
|
||||
this.disconnect();
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
this.queuePosition--;
|
||||
throw error;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ export default class {
|
|||
await fs.access(this.getCachedPath(url));
|
||||
|
||||
return true;
|
||||
} catch (_) {
|
||||
} catch (_: unknown) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ export default class {
|
|||
format = formats.find(filter);
|
||||
|
||||
const nextBestFormat = (formats: ytdl.videoFormat[]): ytdl.videoFormat | undefined => {
|
||||
if (formats[0].live) {
|
||||
if (formats[0].isLive) {
|
||||
formats = formats.sort((a, b) => (b as unknown as {audioBitrate: number}).audioBitrate - (a as unknown as {audioBitrate: number}).audioBitrate); // Bad typings
|
||||
|
||||
return formats.find(format => [128, 127, 120, 96, 95, 94, 93].includes(parseInt(format.itag as unknown as string, 10))); // Bad typings
|
||||
|
@ -321,7 +321,13 @@ export default class {
|
|||
|
||||
formats = formats
|
||||
.filter(format => format.averageBitrate)
|
||||
.sort((a, b) => b.averageBitrate - a.averageBitrate);
|
||||
.sort((a, b) => {
|
||||
if (a && b) {
|
||||
return b.averageBitrate! - a.averageBitrate!;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
return formats.find(format => !format.bitrate) ?? formats[0];
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue