diff --git a/CHANGELOG.md b/CHANGELOG.md index b70f5ef1..ff49ad68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Remove Spotify requirement +- Dependency update ## [2.10.0] - 2024-11-04 - New `/config set-reduce-vol-when-voice` command to automatically turn down the volume when people are speaking in the channel diff --git a/package.json b/package.json index 7fc56b9e..0e06fa48 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "ora": "^8.1.0", "p-event": "^5.0.1", "p-limit": "^6.1.0", - "p-queue": "7.1.0", + "p-queue": "8.1.0", "p-retry": "6.2.0", "pagination.djs": "^4.0.10", "parse-duration": "1.0.2", diff --git a/src/services/youtube-api.ts b/src/services/youtube-api.ts index 216a2c0c..47b91d8e 100644 --- a/src/services/youtube-api.ts +++ b/src/services/youtube-api.ts @@ -74,7 +74,7 @@ export default class { } async search(query: string, shouldSplitChapters: boolean): Promise { - const {items} = await this.ytsrQueue.add(async () => this.cache.wrap( + const result = await this.ytsrQueue.add(async () => this.cache.wrap( ytsr, query, { @@ -85,9 +85,13 @@ export default class { }, )); + if (result === undefined) { + return []; + } + let firstVideo: Video | undefined; - for (const item of items) { + for (const item of result.items) { if (item.type === 'video') { firstVideo = item; break; diff --git a/yarn.lock b/yarn.lock index e56451e4..5d48dbcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2024,10 +2024,10 @@ esutils@^2.0.2: resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== execa@5.1.1: version "5.1.1" @@ -3837,13 +3837,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -p-queue@7.1.0: - version "7.1.0" - resolved "https://registry.npmjs.org/p-queue/-/p-queue-7.1.0.tgz" - integrity sha512-V+0vPJbhYkBqknPp0qnaz+dWcj8cNepfXZcsVIVEHPbFQXMPwrzCNIiM4FoxGtwHXtPzVCPHDvqCr1YrOJX2Gw== +p-queue@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-8.1.0.tgz#d71929249868b10b16f885d8a82beeaf35d32279" + integrity sha512-mxLDbbGIBEXTJL0zEx8JIylaj3xQ7Z/7eEVjcF9fJX4DBiH9oqe+oahYnlKKxm0Ci9TlWTyhSHgygxMxjIB2jw== dependencies: - eventemitter3 "^4.0.7" - p-timeout "^5.0.0" + eventemitter3 "^5.0.1" + p-timeout "^6.1.2" p-retry@6.2.0: version "6.2.0" @@ -3854,16 +3854,16 @@ p-retry@6.2.0: is-network-error "^1.0.0" retry "^0.13.1" -p-timeout@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz" - integrity sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew== - p-timeout@^5.0.2: version "5.0.2" resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-5.0.2.tgz" integrity sha512-sEmji9Yaq+Tw+STwsGAE56hf7gMy9p0tQfJojIAamB7WHJYJKf1qlsg9jqBWG8q9VCxKPhZaP/AcXwEoBcYQhQ== +p-timeout@^6.1.2: + version "6.1.4" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-6.1.4.tgz#418e1f4dd833fa96a2e3f532547dd2abdb08dbc2" + integrity sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg== + pac-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz"