Small bug fixes

This commit is contained in:
Max Isom 2020-03-19 19:16:07 -05:00
parent 4659717e5f
commit f25467a41d
6 changed files with 29 additions and 16 deletions

View file

@ -176,7 +176,7 @@ export default class {
private async spotifyToYouTube(track: SpotifyApi.TrackObjectSimplified, playlist: QueuedPlaylist | null): Promise<QueuedSong | null> {
try {
const {items} = await ytsr(`${track.name} ${track.artists[0].name} offical`, {limit: 5});
const {items} = await ytsr(`"${track.name}" "${track.artists[0].name}" offical`, {limit: 5});
const video = items.find((item: { type: string }) => item.type === 'video');
if (!video) {

View file

@ -140,6 +140,10 @@ export default class {
this.stopTrackingPosition();
}
resetPosition(): void {
this.positionInSeconds = 0;
}
private getCachedPath(url: string): string {
return path.join(this.cacheDir, hasha(url));
}