diff options
| author | Max Isom <[email protected]> | 2020-08-24 14:53:18 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2020-08-24 14:53:18 -0500 |
| commit | cd4b42a8f6490965eee3af0666b20aa69ff888bb (patch) | |
| tree | 7b51252d0b71fcdab5a46bf2da147c6cbb7f4168 /src/services | |
| parent | e927334db66b04f1031548945b1a427f4b27e8dd (diff) | |
| download | muse-cd4b42a8f6490965eee3af0666b20aa69ff888bb.tar.xz muse-cd4b42a8f6490965eee3af0666b20aa69ff888bb.zip | |
Bump dependencies
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/get-songs.ts | 4 | ||||
| -rw-r--r-- | src/services/player.ts | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/services/get-songs.ts b/src/services/get-songs.ts index 8cbb60c..221a79c 100644 --- a/src/services/get-songs.ts +++ b/src/services/get-songs.ts @@ -188,14 +188,14 @@ export default class { const {items} = await ytsr(`"${track.name}" "${track.artists[0].name}" offical`, {limit: 5}); const video = items.find(item => item.type === 'video'); - if (!video) { + if (!video || video.type !== 'video') { throw new Error('No video found for query.'); } return { title: video.title, artist: track.artists[0].name, - length: parseTime(video.duration), + length: video.duration ? parseTime(video.duration) : 0, url: video.link, playlist, isLive: video.live diff --git a/src/services/player.ts b/src/services/player.ts index 6e4a9e9..0ba79c9 100644 --- a/src/services/player.ts +++ b/src/services/player.ts @@ -338,7 +338,7 @@ export default class { // Don't cache livestreams or long videos const MAX_CACHE_LENGTH_SECONDS = 30 * 60; // 30 minutes - shouldCacheVideo = !info.player_response.videoDetails.isLiveContent && parseInt(info.length_seconds, 10) < MAX_CACHE_LENGTH_SECONDS && !options.seek; + shouldCacheVideo = !info.player_response.videoDetails.isLiveContent && parseInt(info.videoDetails.lengthSeconds, 10) < MAX_CACHE_LENGTH_SECONDS && !options.seek; ffmpegInputOptions.push(...[ '-reconnect', |
