From bebc93b838461d49a77bfaf2eab3dc85a18f7d96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 07:48:44 +0100 Subject: [PATCH 01/55] :arrow_up:(deps-dev): Bump @nestjs/testing from 9.3.9 to 9.3.10 (#124) Bumps [@nestjs/testing](https://github.com/nestjs/nest) from 9.3.9 to 9.3.10. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.9...v9.3.10) --- updated-dependencies: - dependency-name: "@nestjs/testing" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index dc75e73..140fadb 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "devDependencies": { "@nestjs/cli": "^9.2.0", "@nestjs/schematics": "^9.0.0", - "@nestjs/testing": "^9.3.9", + "@nestjs/testing": "^9.3.10", "@types/cron": "^2.0.0", "@types/express": "^4.17.13", "@types/jest": "28.1.8", diff --git a/yarn.lock b/yarn.lock index e3051f1..5758950 100644 --- a/yarn.lock +++ b/yarn.lock @@ -911,10 +911,10 @@ boxen "5.1.2" check-disk-space "3.3.1" -"@nestjs/testing@^9.3.9": - version "9.3.9" - resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.9.tgz#f09a5df30cb1725a06f9fddd666543bbeb87eb35" - integrity sha512-+mPvSVvSC2SAkYgZZv1mOI2xsdGc1pmq7/sem7iin/JDoFtlvoGSK+pfZHD3IV3EpYtq1v/8/5gi+UFH9yZnDg== +"@nestjs/testing@^9.3.10": + version "9.3.10" + resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.10.tgz#d0229d4d338806758dae824bdbeb935e097d4901" + integrity sha512-TGspJkzDx1YmJzlmNG5WrhFa7IGgXbCVt4UXvBVqEk2QRPmJFZnqd0T9waKZ+SxwH4gY5sdw2niTFvOgqGVfJw== dependencies: tslib "2.5.0" From 70f3aa76ee580445073f22f5457742410b00b01d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 07:48:59 +0100 Subject: [PATCH 02/55] :arrow_up:(deps): Bump @nestjs/common from 9.3.9 to 9.3.10 (#123) Bumps [@nestjs/common](https://github.com/nestjs/nest) from 9.3.9 to 9.3.10. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.9...v9.3.10) --- updated-dependencies: - dependency-name: "@nestjs/common" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 140fadb..a339636 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", - "@nestjs/common": "^9.0.0", + "@nestjs/common": "^9.3.10", "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.0.0", "@nestjs/event-emitter": "^1.3.1", diff --git a/yarn.lock b/yarn.lock index 5758950..bf8e93a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -823,10 +823,10 @@ webpack "5.75.0" webpack-node-externals "3.0.0" -"@nestjs/common@^9.0.0": - version "9.3.9" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.9.tgz#170201ce1c2a8f73bd4babe74b64a2a0b37a95d0" - integrity sha512-GshTD9Xz+wD2em6NyzU4NXw5IXMUmapgDgD+iuj6XL0258hvDwODmNk37mBBnZvTZlqER+krvIUKnS34etqF/A== +"@nestjs/common@^9.3.10": + version "9.3.10" + resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.10.tgz#c137402cad41123eaf5c74c2404e92490f9bbd50" + integrity sha512-wj2bM9TXBlAvzgznkID0s7bN/niVn90sZIDtRFDnvaB1qagEpkWA0Bt39qilIuqdReluIaCjeEW106U0oyz+mQ== dependencies: uid "2.0.1" iterare "1.2.1" From 07f728126766783b20c9217249d27317e226eba9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 07:49:26 +0100 Subject: [PATCH 03/55] :arrow_up:(deps): Bump @nestjs/platform-express from 9.3.9 to 9.3.10 (#122) Bumps [@nestjs/platform-express](https://github.com/nestjs/nest) from 9.3.9 to 9.3.10. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.9...v9.3.10) --- updated-dependencies: - dependency-name: "@nestjs/platform-express" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a339636..9fe3a57 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.0.0", "@nestjs/event-emitter": "^1.3.1", - "@nestjs/platform-express": "^9.0.0", + "@nestjs/platform-express": "^9.3.10", "@nestjs/schedule": "^2.1.0", "@nestjs/serve-static": "^3.0.1", "@nestjs/terminus": "^9.1.4", diff --git a/yarn.lock b/yarn.lock index bf8e93a..a469a36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -866,12 +866,12 @@ resolved "https://registry.yarnpkg.com/@nestjs/mapped-types/-/mapped-types-1.2.2.tgz#d9ddb143776e309dbc1a518ac1607fddac1e140e" integrity sha512-3dHxLXs3M0GPiriAcCFFJQHoDFUuzTD5w6JDhE7TyfT89YKpe6tcCCIqOZWdXmt9AZjjK30RkHRSFF+QEnWFQg== -"@nestjs/platform-express@^9.0.0": - version "9.3.9" - resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.9.tgz#557ace8589b54d4ee7bad87a1247a521058395d7" - integrity sha512-f8ja2sYuDGj2QSMmjg05n3WF19wJG5yTiYxRi64nsu5GKL0qLM1LzxNemehkni/knExlvF2bDpbKKpna9nC1JA== +"@nestjs/platform-express@^9.3.10": + version "9.3.10" + resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.10.tgz#5493bd4dc3f5f28e3224afd56d113017b746f3d6" + integrity sha512-5aWokr8s0pipD5c/n40xC1iv3cMXfWrOhciX430p53cy4uyTAE+sTBk0PhB6tdG8NpK33aNqqHz/tyKlauQu/Q== dependencies: - body-parser "1.20.1" + body-parser "1.20.2" cors "2.8.5" express "4.18.2" multer "1.4.4-lts.1" @@ -1777,6 +1777,24 @@ body-parser@1.20.1: type-is "~1.6.18" unpipe "1.0.0" +body-parser@1.20.2: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + boxen@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" @@ -2122,7 +2140,7 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" -content-type@~1.0.4: +content-type@~1.0.4, content-type@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== @@ -4413,6 +4431,16 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + react-is@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" From ddf7e52b7c021b558770ac30e6d60bfddf38f98f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Mar 2023 21:03:19 +0100 Subject: [PATCH 04/55] :arrow_up:(deps-dev): Bump @nestjs/cli from 9.2.0 to 9.3.0 (#120) Bumps [@nestjs/cli](https://github.com/nestjs/nest-cli) from 9.2.0 to 9.3.0. - [Release notes](https://github.com/nestjs/nest-cli/releases) - [Changelog](https://github.com/nestjs/nest-cli/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/nest-cli/compare/9.2.0...9.3.0) --- updated-dependencies: - dependency-name: "@nestjs/cli" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 175 ++++++++++++++++++++++++--------------------------- 2 files changed, 83 insertions(+), 94 deletions(-) diff --git a/package.json b/package.json index 9fe3a57..d8703b0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "ws": "^8.13.0" }, "devDependencies": { - "@nestjs/cli": "^9.2.0", + "@nestjs/cli": "^9.3.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.3.10", "@types/cron": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index a469a36..c32e286 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,10 +21,10 @@ rxjs "6.6.7" source-map "0.7.4" -"@angular-devkit/core@15.1.4": - version "15.1.4" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-15.1.4.tgz#462f123d56f9298cb04b3fa31b425fc31abb76c5" - integrity sha512-PW5MRmd9DHJR4FaXchwQtj9pXnsghSTnwRvfZeCRNYgU2sv0DKyTV+YTSJB+kNXnoPNG1Je6amDEkiXecpspXg== +"@angular-devkit/core@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-15.2.4.tgz#f7696f09c66d01568a07f0e71672e887fdf57280" + integrity sha512-yl+0j1bMwJLKShsyCXw77tbJG8Sd21+itisPLL2MgEpLNAO252kr9zG4TLlFRJyKVftm2l1h78KjqvM5nbOXNg== dependencies: ajv "8.12.0" ajv-formats "2.1.1" @@ -32,13 +32,13 @@ rxjs "6.6.7" source-map "0.7.4" -"@angular-devkit/schematics-cli@15.1.4": - version "15.1.4" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics-cli/-/schematics-cli-15.1.4.tgz#f2ea0379e27ddd6b05b302dd88b8d3f1b6c49ec8" - integrity sha512-qkM5Mfs28jZzNcJnSM6RlyrKkYvzhQmWFTxBXnn15k5T4EnSs1gI6O054Xn7jo/senfwNNt7h2Mlz2OmBLo6+w== +"@angular-devkit/schematics-cli@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics-cli/-/schematics-cli-15.2.4.tgz#c3a4c162779773d312d36cb23f3dd44d741d7225" + integrity sha512-QTTKEH5HOkxvQtCxb2Lna2wubehkaIzA6DKUBISijPQliLomw74tzc7lXCywmMqRTbQPVRLG3kBK97hR4x67nA== dependencies: - "@angular-devkit/core" "15.1.4" - "@angular-devkit/schematics" "15.1.4" + "@angular-devkit/core" "15.2.4" + "@angular-devkit/schematics" "15.2.4" ansi-colors "4.1.3" inquirer "8.2.4" symbol-observable "4.0.0" @@ -55,14 +55,14 @@ ora "5.4.1" rxjs "6.6.7" -"@angular-devkit/schematics@15.1.4": - version "15.1.4" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-15.1.4.tgz#30e38777f1bd98e20e6dbe1bfddabc3bcd42605f" - integrity sha512-jpddxo9Qd2yRQ1t9FLhAx5S+luz6HkyhDytq0LFKbxf9ikf1J4oy9riPBFl4pRmrNARWcHZ6GbD20/Ky8PjmXQ== +"@angular-devkit/schematics@15.2.4": + version "15.2.4" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-15.2.4.tgz#85129ebabcdb362f4b65a6e290bb2ae846f3d64c" + integrity sha512-/W7/vvn59PAVLzhcvD4/N/E8RDhub8ny1A7I96LTRjC5o+yvVV16YJ4YJzolrRrIEN01KmLVQJ9A58VCaweMgw== dependencies: - "@angular-devkit/core" "15.1.4" + "@angular-devkit/core" "15.2.4" jsonc-parser "3.2.0" - magic-string "0.27.0" + magic-string "0.29.0" ora "5.4.1" rxjs "6.6.7" @@ -795,32 +795,32 @@ resolved "https://registry.yarnpkg.com/@lukeed/csprng/-/csprng-1.0.1.tgz#625e93a0edb2c830e3c52ce2d67b9d53377c6a66" integrity sha512-uSvJdwQU5nK+Vdf6zxcWAY2A8r7uqe+gePwLWzJ+fsQehq18pc0I2hJKwypZ2aLM90+Er9u1xn4iLJPZ+xlL4g== -"@nestjs/cli@^9.2.0": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@nestjs/cli/-/cli-9.2.0.tgz#d174f54d7aaa6695b8e413093e3d18367bc8bec7" - integrity sha512-6B1IjDcJbrOu55oMF67L1x5lDUOZ3Zs9l7bKCBH9D78965m8wq/2rlEWl/gJto5TABLQWy3hVvV/s8VzUlRMxw== +"@nestjs/cli@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@nestjs/cli/-/cli-9.3.0.tgz#654ae6999d06c6da4ca17d5bdf68b7a85429938e" + integrity sha512-v/E8Y3zFk30+FljETvPgpoGIUiOfWuOe6WUFw3ExGfDeWrF/A8ceupDHPWNknBAqvNtz2kVrWu5mwsZUEKGIgg== dependencies: - "@angular-devkit/core" "15.1.4" - "@angular-devkit/schematics" "15.1.4" - "@angular-devkit/schematics-cli" "15.1.4" - "@nestjs/schematics" "^9.0.0" - chalk "3.0.0" + "@angular-devkit/core" "15.2.4" + "@angular-devkit/schematics" "15.2.4" + "@angular-devkit/schematics-cli" "15.2.4" + "@nestjs/schematics" "^9.0.4" + chalk "4.1.2" chokidar "3.5.3" cli-table3 "0.6.3" commander "4.1.1" - fork-ts-checker-webpack-plugin "7.3.0" - inquirer "7.3.3" + fork-ts-checker-webpack-plugin "8.0.0" + inquirer "8.2.5" node-emoji "1.11.0" ora "5.4.1" os-name "4.0.1" - rimraf "4.1.2" + rimraf "4.4.0" shelljs "0.8.5" source-map-support "0.5.21" tree-kill "1.2.2" tsconfig-paths "4.1.2" - tsconfig-paths-webpack-plugin "4.0.0" + tsconfig-paths-webpack-plugin "4.0.1" typescript "4.9.5" - webpack "5.75.0" + webpack "5.76.2" webpack-node-externals "3.0.0" "@nestjs/common@^9.3.10": @@ -885,7 +885,7 @@ cron "2.2.0" uuid "9.0.0" -"@nestjs/schematics@^9.0.0": +"@nestjs/schematics@^9.0.0", "@nestjs/schematics@^9.0.4": version "9.0.4" resolved "https://registry.yarnpkg.com/@nestjs/schematics/-/schematics-9.0.4.tgz#ab612f5a8e006ca1d617eddc8143ee00b766312b" integrity sha512-egurCfAc4e5i1r2TmeAF0UrOKejFmT5oTdv4b7HcOVPupc3QGU7CbEfGleL3mkM5AjrixTQeMxU9bJ00ttAbGg== @@ -1908,10 +1908,10 @@ caniuse-lite@^1.0.30001449: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001466.tgz#c1e6197c540392e09709ecaa9e3e403428c53375" integrity sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w== -chalk@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1925,14 +1925,6 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -2780,10 +2772,10 @@ follow-redirects@^1.14.9: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== -fork-ts-checker-webpack-plugin@7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.3.0.tgz#a9c984a018493962360d7c7e77a67b44a2d5f3aa" - integrity sha512-IN+XTzusCjR5VgntYFgxbxVx3WraPRnKehBFrf00cMSrtUuW9MsG9dhL6MWpY6MkjC3wVwoujfCDgZZCQwbswA== +fork-ts-checker-webpack-plugin@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-8.0.0.tgz#dae45dfe7298aa5d553e2580096ced79b6179504" + integrity sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg== dependencies: "@babel/code-frame" "^7.16.7" chalk "^4.1.2" @@ -3115,25 +3107,6 @@ inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@7.3.3: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.19" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.6.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - inquirer@8.2.4: version "8.2.4" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.4.tgz#ddbfe86ca2f67649a67daa6f1051c128f684f0b4" @@ -3155,6 +3128,27 @@ inquirer@8.2.4: through "^2.3.6" wrap-ansi "^7.0.0" +inquirer@8.2.5: + version "8.2.5" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.5.tgz#d8654a7542c35a9b9e069d27e2df4858784d54f8" + integrity sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ== + dependencies: + ansi-escapes "^4.2.1" + chalk "^4.1.1" + cli-cursor "^3.1.0" + cli-width "^3.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.21" + mute-stream "0.0.8" + ora "^5.4.1" + run-async "^2.4.0" + rxjs "^7.5.5" + string-width "^4.1.0" + strip-ansi "^6.0.0" + through "^2.3.6" + wrap-ansi "^7.0.0" + interpret@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" @@ -3809,7 +3803,7 @@ lodash.snakecase@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== -lodash@4.17.21, lodash@^4.17.19, lodash@^4.17.21: +lodash@4.17.21, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3858,10 +3852,10 @@ magic-string@0.26.7: dependencies: sourcemap-codec "^1.4.8" -magic-string@0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" - integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== +magic-string@0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.29.0.tgz#f034f79f8c43dba4ae1730ffb5e8c4e084b16cf3" + integrity sha512-WcfidHrDjMY+eLjlU+8OvwREqHwpgCeKVBUpQ3OhYYuvfaYCUgcbuBzappNzZvg/v8onU3oQj+BYpkOJe9Iw4Q== dependencies: "@jridgewell/sourcemap-codec" "^1.4.13" @@ -4548,10 +4542,12 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.1.2.tgz#20dfbc98083bdfaa28b01183162885ef213dbf7c" - integrity sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ== +rimraf@4.4.0, rimraf@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.0.tgz#c7a9f45bb2ec058d2e60ef9aca5167974313d605" + integrity sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ== + dependencies: + glob "^9.2.0" rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" @@ -4560,13 +4556,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.0.tgz#c7a9f45bb2ec058d2e60ef9aca5167974313d605" - integrity sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ== - dependencies: - glob "^9.2.0" - run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -4579,7 +4568,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@6.6.7, rxjs@^6.6.0: +rxjs@6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -5062,16 +5051,16 @@ ts-node@^10.0.0: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tsconfig-paths-webpack-plugin@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.0.0.tgz#84008fc3e3e0658fdb0262758b07b4da6265ff1a" - integrity sha512-fw/7265mIWukrSHd0i+wSwx64kYUSAKPfxRDksjKIYTxSAp9W9/xcZVBF4Kl0eqQd5eBpAQ/oQrc5RyM/0c1GQ== +tsconfig-paths-webpack-plugin@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.0.1.tgz#a24651d0f69668a1abad38d3c2489855c257460d" + integrity sha512-m5//KzLoKmqu2MVix+dgLKq70MnFi8YL8sdzQZ6DblmCdfuq/y3OqvJd5vMndg2KEVCOeNz8Es4WVZhYInteLw== dependencies: chalk "^4.1.0" enhanced-resolve "^5.7.0" - tsconfig-paths "^4.0.0" + tsconfig-paths "^4.1.2" -tsconfig-paths@4.1.2, tsconfig-paths@^4.0.0: +tsconfig-paths@4.1.2, tsconfig-paths@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz#4819f861eef82e6da52fb4af1e8c930a39ed979a" integrity sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw== @@ -5252,10 +5241,10 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@5.75.0: - version "5.75.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152" - integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ== +webpack@5.76.2: + version "5.76.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.2.tgz#6f80d1c1d1e3bf704db571b2504a0461fac80230" + integrity sha512-Th05ggRm23rVzEOlX8y67NkYCHa9nTNcwHPBhdg+lKG+mtiW7XgggjAeeLnADAe7mLjJ6LUNfgHAuRRh+Z6J7w== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" From c01ac56061986fb4525327ee220aaa4eb1b95b58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Mar 2023 21:03:28 +0100 Subject: [PATCH 05/55] :arrow_up:(deps): Bump @nestjs/core from 9.3.9 to 9.3.11 (#125) Bumps [@nestjs/core](https://github.com/nestjs/nest) from 9.3.9 to 9.3.11. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.9...v9.3.11) --- updated-dependencies: - dependency-name: "@nestjs/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d8703b0..6a10dce 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.10", "@nestjs/config": "^2.2.0", - "@nestjs/core": "^9.0.0", + "@nestjs/core": "^9.3.11", "@nestjs/event-emitter": "^1.3.1", "@nestjs/platform-express": "^9.3.10", "@nestjs/schedule": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index c32e286..ad509fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -842,10 +842,10 @@ lodash "4.17.21" uuid "9.0.0" -"@nestjs/core@^9.0.0": - version "9.3.9" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.9.tgz#694caf785e0209175479637f11be79a930d0c0d6" - integrity sha512-9g1A1G9eirLXEpH21rc6dKb08zHc2+adhCRz8NW39hbejcsxxD72FApJzt4QBQAKvu862ixt/tdpStnFT7lOSw== +"@nestjs/core@^9.3.11": + version "9.3.11" + resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.11.tgz#1be65db0e889f8f12b87aec12c9cf66ea6043205" + integrity sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ== dependencies: uid "2.0.1" "@nuxtjs/opencollective" "0.3.2" From 2141880b4401a58b23adea2da4a0215f2ddfbbaf Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sat, 25 Mar 2023 22:03:06 +0100 Subject: [PATCH 06/55] =?UTF-8?q?=F0=9F=90=9B=20Fix=20crash=20with=20empty?= =?UTF-8?q?=20playlists=20(#128)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/play/play.comands.ts | 4 ++++ src/models/shared/Playlist.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 72ffbab..0e72eb4 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -94,10 +94,14 @@ export class PlayItemCommand { } const tracks = await item.toTracks(this.jellyfinSearchService); + this.logger.debug(`Extracted ${tracks.length} tracks from the search item`); const reducedDuration = tracks.reduce( (sum, item) => sum + item.duration, 0, ); + this.logger.debug( + `Adding ${tracks.length} tracks with a duration of ${reducedDuration} ticks`, + ); this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); const remoteImage: RemoteImageInfo | undefined = tracks diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index 37145a5..f96ebea 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -84,6 +84,10 @@ export class Playlist { * @returns the new lendth of the tracks in the playlist */ enqueueTracks(tracks: Track[]) { + if (tracks.length === 0) { + return 0; + } + this.eventEmitter.emit('controls.playlist.tracks.enqueued', { count: tracks.length, activeTrack: this.activeTrackIndex, From 2c15e38b9491b0b1bc31adf7bd01a349d280bec2 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 26 Mar 2023 00:02:57 +0100 Subject: [PATCH 07/55] =?UTF-8?q?=E2=9C=A8=20Add=20enqueue=20random=20item?= =?UTF-8?q?s=20command=20(#130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discord/discord.message.service.ts | 2 +- .../jellyfin/jellyfin.search.service.ts | 24 ++++++ src/commands/command.module.ts | 2 + src/commands/random/random.command.ts | 77 +++++++++++++++++++ src/commands/random/random.params.ts | 12 +++ src/models/search/SearchHint.ts | 15 +++- 6 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 src/commands/random/random.command.ts create mode 100644 src/commands/random/random.params.ts diff --git a/src/clients/discord/discord.message.service.ts b/src/clients/discord/discord.message.service.ts index 3b76577..86e8d52 100644 --- a/src/clients/discord/discord.message.service.ts +++ b/src/clients/discord/discord.message.service.ts @@ -39,7 +39,7 @@ export class DiscordMessageService { }: { title: string; description?: string; - authorUrl?: string; + authorUrl?: string | undefined; mixin?: (embedBuilder: EmbedBuilder) => EmbedBuilder; }): APIEmbed { let embedBuilder = new EmbedBuilder() diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index 0f9c087..626d73f 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -170,6 +170,30 @@ export class JellyfinSearchService { } } + async getRandomTracks(limit: number) { + const api = this.jellyfinService.getApi(); + const searchApi = getItemsApi(api); + + try { + const response = await searchApi.getItems({ + includeItemTypes: [BaseItemKind.Audio], + limit: limit, + sortBy: ['random'], + userId: this.jellyfinService.getUserId(), + recursive: true, + }); + + return response.data.Items.map((item) => { + return SearchHint.constructFromBaseItem(item); + }); + } catch (err) { + this.logger.error( + `Unabele to retrieve random items from Jellyfin: ${err}`, + ); + return []; + } + } + private transformToSearchHint(jellyifnHint: JellyfinSearchHint) { switch (jellyifnHint.Type) { case BaseItemKind[BaseItemKind.Audio]: diff --git a/src/commands/command.module.ts b/src/commands/command.module.ts index c4b34f4..9981a94 100644 --- a/src/commands/command.module.ts +++ b/src/commands/command.module.ts @@ -15,6 +15,7 @@ import { StatusCommand } from './status.command'; import { StopPlaybackCommand } from './stop.command'; import { SummonCommand } from './summon.command'; import { PlaylistInteractionCollector } from './playlist/playlist.interaction-collector'; +import { EnqueueRandomItemsCommand } from './random/random.command'; @Module({ imports: [ @@ -28,6 +29,7 @@ import { PlaylistInteractionCollector } from './playlist/playlist.interaction-co PlaylistInteractionCollector, HelpCommand, StatusCommand, + EnqueueRandomItemsCommand, PlaylistCommand, DisconnectCommand, PausePlaybackCommand, diff --git a/src/commands/random/random.command.ts b/src/commands/random/random.command.ts new file mode 100644 index 0000000..9326175 --- /dev/null +++ b/src/commands/random/random.command.ts @@ -0,0 +1,77 @@ +import { SlashCommandPipe } from '@discord-nestjs/common'; +import { Command, Handler, IA, InteractionEvent } from '@discord-nestjs/core'; +import { Injectable } from '@nestjs/common'; +import { + CommandInteraction, + GuildMember, + InteractionReplyOptions, +} from 'discord.js'; +import { DiscordMessageService } from 'src/clients/discord/discord.message.service'; +import { DiscordVoiceService } from 'src/clients/discord/discord.voice.service'; +import { JellyfinSearchService } from 'src/clients/jellyfin/jellyfin.search.service'; +import { SearchHint } from 'src/models/search/SearchHint'; +import { Track } from 'src/models/shared/Track'; +import { PlaybackService } from 'src/playback/playback.service'; +import { RandomCommandParams } from './random.params'; + +@Command({ + name: 'random', + description: 'Enqueues a random selection of tracks to your playlist', +}) +@Injectable() +export class EnqueueRandomItemsCommand { + constructor( + private readonly playbackService: PlaybackService, + private readonly discordVoiceService: DiscordVoiceService, + private readonly discordMessageService: DiscordMessageService, + private readonly jellyfinSearchService: JellyfinSearchService, + ) {} + + @Handler() + async handler( + @InteractionEvent(SlashCommandPipe) dto: RandomCommandParams, + @IA() interaction: CommandInteraction, + ): Promise { + await interaction.deferReply(); + + const guildMember = interaction.member as GuildMember; + + const tryResult = + this.discordVoiceService.tryJoinChannelAndEstablishVoiceConnection( + guildMember, + ); + + if (!tryResult.success) { + const replyOptions = tryResult.reply as InteractionReplyOptions; + await interaction.editReply({ + embeds: replyOptions.embeds, + }); + return; + } + + const items = await this.jellyfinSearchService.getRandomTracks(dto.count); + const tracks = await this.getTracks(items); + + this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); + + await interaction.editReply({ + embeds: [ + this.discordMessageService.buildMessage({ + title: `Added ${tracks.length} tracks to your playlist`, + description: 'Use ``/playlist`` to see them', + }), + ], + }); + } + + private async getTracks(hints: SearchHint[]) { + const promises = await Promise.all( + hints.flatMap(async (item) => { + const tracks = await item.toTracks(this.jellyfinSearchService); + return tracks; + }), + ); + + return promises.flatMap((x) => x); + } +} diff --git a/src/commands/random/random.params.ts b/src/commands/random/random.params.ts new file mode 100644 index 0000000..6084a32 --- /dev/null +++ b/src/commands/random/random.params.ts @@ -0,0 +1,12 @@ +import { Param, ParamType } from '@discord-nestjs/core'; + +export class RandomCommandParams { + @Param({ + required: false, + description: 'Count of items to search for', + type: ParamType.INTEGER, + minValue: 0, + maxValue: 10000, + }) + count = 20; +} diff --git a/src/models/search/SearchHint.ts b/src/models/search/SearchHint.ts index c890b25..093d45a 100644 --- a/src/models/search/SearchHint.ts +++ b/src/models/search/SearchHint.ts @@ -1,7 +1,10 @@ -import { SearchHint as JellyfinSearchHint } from '@jellyfin/sdk/lib/generated-client/models'; +import { + BaseItemDto, + SearchHint as JellyfinSearchHint, +} from '@jellyfin/sdk/lib/generated-client/models'; -import { Track } from '../shared/Track'; import { JellyfinSearchService } from '../../clients/jellyfin/jellyfin.search.service'; +import { Track } from '../shared/Track'; export class SearchHint { constructor( @@ -28,4 +31,12 @@ export class SearchHint { static constructFromHint(hint: JellyfinSearchHint) { return new SearchHint(hint.Id, hint.Name, hint.RunTimeTicks / 10000); } + + static constructFromBaseItem(baseItem: BaseItemDto) { + return new SearchHint( + baseItem.Id, + baseItem.Name, + baseItem.RunTimeTicks / 10000, + ); + } } From 0130115be88eae07b3a0fb3b636e49281898bc34 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 26 Mar 2023 00:59:20 +0100 Subject: [PATCH 08/55] =?UTF-8?q?=F0=9F=90=9B=20Fix=20missing=20remote=20i?= =?UTF-8?q?mages=20for=20albums=20(#131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/search/AlbumSearchHint.ts | 13 ++++++++++--- src/models/search/SearchHint.ts | 5 +---- src/models/shared/Track.ts | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/models/search/AlbumSearchHint.ts b/src/models/search/AlbumSearchHint.ts index 4cec06c..dd4b440 100644 --- a/src/models/search/AlbumSearchHint.ts +++ b/src/models/search/AlbumSearchHint.ts @@ -17,10 +17,17 @@ export class AlbumSearchHint extends SearchHint { override async toTracks( searchService: JellyfinSearchService, ): Promise { + const remoteImages = await searchService.getRemoteImageById(this.id); + const albumItems = await searchService.getAlbumItems(this.id); - const tracks = albumItems.map(async (x) => - (await x.toTracks(searchService)).find((x) => x !== null), + const tracks = await Promise.all( + albumItems.map(async (x) => + (await x.toTracks(searchService)).find((x) => x !== null), + ), ); - return await Promise.all(tracks); + return tracks.map((track): Track => { + track.remoteImages = remoteImages; + return track; + }); } } diff --git a/src/models/search/SearchHint.ts b/src/models/search/SearchHint.ts index 093d45a..016acc4 100644 --- a/src/models/search/SearchHint.ts +++ b/src/models/search/SearchHint.ts @@ -18,10 +18,7 @@ export class SearchHint { } async toTracks(searchService: JellyfinSearchService): Promise { - const remoteImages = await searchService.getRemoteImageById(this.id); - return [ - new Track(this.id, this.name, this.runtimeInMilliseconds, remoteImages), - ]; + return [new Track(this.id, this.name, this.runtimeInMilliseconds, {})]; } getId(): string { diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index 7ef3b7c..b93875f 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -25,7 +25,7 @@ export class Track { /** * A result object that contains a collection of images that are available outside the current network. */ - readonly remoteImages?: RemoteImageResult; + remoteImages?: RemoteImageResult; constructor( id: string, From ea64f1666107a366404192b2814b4f2d3a85d646 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:29:42 +0100 Subject: [PATCH 09/55] =?UTF-8?q?=E2=9C=A8=20Add=20volume=20command=20(#13?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.voice.service.ts | 13 +++- src/commands/command.module.ts | 2 + src/commands/volume/volume.command.ts | 70 ++++++++++++++++++++ src/commands/volume/volume.params.ts | 12 ++++ src/utils/timeUtils.ts | 4 ++ 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 src/commands/volume/volume.command.ts create mode 100644 src/commands/volume/volume.params.ts diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index a2a9fb4..615fbc9 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -29,8 +29,9 @@ import { DiscordMessageService } from './discord.message.service'; @Injectable() export class DiscordVoiceService { private readonly logger = new Logger(DiscordVoiceService.name); - private audioPlayer: AudioPlayer; - private voiceConnection: VoiceConnection; + private audioPlayer: AudioPlayer | undefined; + private voiceConnection: VoiceConnection | undefined; + private audioResource: AudioResource | undefined; constructor( private readonly discordMessageService: DiscordMessageService, @@ -44,6 +45,9 @@ export class DiscordVoiceService { handleOnNewTrack(track: Track) { const resource = createAudioResource( track.getStreamUrl(this.jellyfinStreamBuilder), + { + inlineVolume: true, + }, ); this.playResource(resource); } @@ -99,9 +103,14 @@ export class DiscordVoiceService { }; } + changeVolume(volume: number) { + this.audioResource.volume.setVolume(volume); + } + playResource(resource: AudioResource) { this.logger.debug(`Playing audio resource with volume ${resource.volume}`); this.createAndReturnOrGetAudioPlayer().play(resource); + this.audioResource = resource; } /** diff --git a/src/commands/command.module.ts b/src/commands/command.module.ts index 9981a94..4b290bd 100644 --- a/src/commands/command.module.ts +++ b/src/commands/command.module.ts @@ -16,6 +16,7 @@ import { StopPlaybackCommand } from './stop.command'; import { SummonCommand } from './summon.command'; import { PlaylistInteractionCollector } from './playlist/playlist.interaction-collector'; import { EnqueueRandomItemsCommand } from './random/random.command'; +import { VolumeCommand } from './volume/volume.command'; @Module({ imports: [ @@ -38,6 +39,7 @@ import { EnqueueRandomItemsCommand } from './random/random.command'; SummonCommand, PlayItemCommand, PreviousTrackCommand, + VolumeCommand, ], exports: [], }) diff --git a/src/commands/volume/volume.command.ts b/src/commands/volume/volume.command.ts new file mode 100644 index 0000000..30f8f00 --- /dev/null +++ b/src/commands/volume/volume.command.ts @@ -0,0 +1,70 @@ +import { SlashCommandPipe } from '@discord-nestjs/common'; +import { Command, Handler, IA, InteractionEvent } from '@discord-nestjs/core'; +import { Logger } from '@nestjs/common'; + +import { Injectable } from '@nestjs/common/decorators'; + +import { CommandInteraction } from 'discord.js'; +import e from 'express'; +import { DiscordMessageService } from 'src/clients/discord/discord.message.service'; +import { DiscordVoiceService } from 'src/clients/discord/discord.voice.service'; +import { PlaybackService } from 'src/playback/playback.service'; +import { sleep } from 'src/utils/timeUtils'; +import { VolumeCommandParams } from './volume.params'; + +@Injectable() +@Command({ + name: 'volume', + description: 'Change the volume', +}) +export class VolumeCommand { + private readonly logger = new Logger(VolumeCommand.name); + + constructor( + private readonly discordVoiceService: DiscordVoiceService, + private readonly discordMessageService: DiscordMessageService, + private readonly playbackService: PlaybackService, + ) {} + + @Handler() + async handler( + @InteractionEvent(SlashCommandPipe) dto: VolumeCommandParams, + @IA() interaction: CommandInteraction, + ): Promise { + await interaction.deferReply(); + + if (!this.playbackService.getPlaylistOrDefault().hasActiveTrack()) { + await interaction.editReply({ + embeds: [ + this.discordMessageService.buildMessage({ + title: `Unable to change your volume`, + description: + 'The bot is not playing any music or is not straming to a channel', + }), + ], + }); + return; + } + + const volume = dto.volume / 100; + + this.logger.debug( + `Calculated volume ${volume} from dto param ${dto.volume}`, + ); + + this.discordVoiceService.changeVolume(volume); + + // Discord takes some time to react. Confirmation message should appear after actual change + await sleep(1500); + + await interaction.editReply({ + embeds: [ + this.discordMessageService.buildMessage({ + title: `Sucessfully set volume to ${dto.volume.toFixed(0)}%`, + description: + 'Updating may take a few seconds to take effect.\nPlease note that listening at a high volume for a long time may damage your hearing', + }), + ], + }); + } +} diff --git a/src/commands/volume/volume.params.ts b/src/commands/volume/volume.params.ts new file mode 100644 index 0000000..117a72c --- /dev/null +++ b/src/commands/volume/volume.params.ts @@ -0,0 +1,12 @@ +import { Param, ParamType } from '@discord-nestjs/core'; + +export class VolumeCommandParams { + @Param({ + required: true, + description: 'The desired volume', + type: ParamType.INTEGER, + minValue: 0, + maxValue: 150, + }) + volume: number; +} diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts index c6b5167..ea3e860 100644 --- a/src/utils/timeUtils.ts +++ b/src/utils/timeUtils.ts @@ -15,3 +15,7 @@ export const formatMillisecondsAsHumanReadable = ( ); return duration; }; + +export function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} From 84433d9d50ad1d52846427d65a3545520af2637d Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 26 Mar 2023 13:33:49 +0200 Subject: [PATCH 10/55] Create .github/workflows/sonarcloud.yml --- .github/workflows/sonarcloud.yml | 68 ++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000..f585203 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,68 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow helps you trigger a SonarCloud analysis of your code and populates +# GitHub Code Scanning alerts with the vulnerabilities found. +# Free for open source project. + +# 1. Login to SonarCloud.io using your GitHub account + +# 2. Import your project on SonarCloud +# * Add your GitHub organization first, then add your repository as a new project. +# * Please note that many languages are eligible for automatic analysis, +# which means that the analysis will start automatically without the need to set up GitHub Actions. +# * This behavior can be changed in Administration > Analysis Method. +# +# 3. Follow the SonarCloud in-product tutorial +# * a. Copy/paste the Project Key and the Organization Key into the args parameter below +# (You'll find this information in SonarCloud. Click on "Information" at the bottom left) +# +# * b. Generate a new token and add it to your Github repository's secrets using the name SONAR_TOKEN +# (On SonarCloud, click on your avatar on top-right > My account > Security +# or go directly to https://sonarcloud.io/account/security/) + +# Feel free to take a look at our documentation (https://docs.sonarcloud.io/getting-started/github/) +# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/help/sc/9) + +name: SonarCloud analysis + +on: + push: + branches: [ "master", "dev" ] + pull_request: + branches: [ "master", "dev" ] + workflow_dispatch: + +permissions: + pull-requests: read # allows SonarCloud to decorate PRs with analysis results + +jobs: + Analysis: + runs-on: ubuntu-latest + + steps: + - name: Analyze with SonarCloud + + # You can pin the exact commit or the version. + # uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 + uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) + with: + # Additional arguments for the sonarcloud scanner + args: + # Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu) + # mandatory + -Dsonar.projectKey=manuel-rw_jellyfin-discord-music-bot + -Dsonar.organization=manuel-rw + # Comma-separated paths to directories containing main source files. + #-Dsonar.sources= # optional, default is project base directory + # When you need the analysis to take place in a directory other than the one from which it was launched + #-Dsonar.projectBaseDir= # optional, default is . + # Comma-separated paths to directories containing test source files. + #-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/ + # Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing. + #-Dsonar.verbose= # optional, default is false From a51abebd06bb15723a6b65666f20538d2f9372e2 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 14:15:35 +0200 Subject: [PATCH 11/55] =?UTF-8?q?=F0=9F=94=96=20Set=20tag=20to=200.0.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/utils/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6a10dce..6d38dfa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jellyfin-discord-music-bot", - "version": "0.0.5", + "version": "0.0.6", "description": "", "author": "manuel-rw", "private": true, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index e73ec49..f93b132 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -3,7 +3,7 @@ export const Constants = { Version: { Major: 0, Minor: 0, - Patch: 5, + Patch: 6, All: () => `${Constants.Metadata.Version.Major}.${Constants.Metadata.Version.Minor}.${Constants.Metadata.Version.Patch}`, }, From c76d7ba82507ba376f2f3807878e8695affeed26 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 14:16:58 +0200 Subject: [PATCH 12/55] =?UTF-8?q?=F0=9F=91=B7=20Remove=20old=20static=20an?= =?UTF-8?q?alysis=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codeql.yml | 84 ------------------------------------ 1 file changed, 84 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 5810572..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,84 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "master" ] - paths-ignore: - - '.github/**' - - 'images/' - - '*.md' - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - paths-ignore: - - '.github/**' - - 'images/' - - '*.md' - schedule: - - cron: '31 2 * * 1' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From 61ab0eff2844252e37efa815842cebcd910b1235 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 14:32:21 +0200 Subject: [PATCH 13/55] =?UTF-8?q?=F0=9F=91=B7=20Add=20coverage=20to=20Sona?= =?UTF-8?q?rCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonarcloud.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index f585203..efaed3a 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -43,6 +43,22 @@ jobs: runs-on: ubuntu-latest steps: + - name: Setup + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --immutable + - run: yarn test:cov - name: Analyze with SonarCloud # You can pin the exact commit or the version. @@ -58,6 +74,7 @@ jobs: # mandatory -Dsonar.projectKey=manuel-rw_jellyfin-discord-music-bot -Dsonar.organization=manuel-rw + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info # Comma-separated paths to directories containing main source files. #-Dsonar.sources= # optional, default is project base directory # When you need the analysis to take place in a directory other than the one from which it was launched From 956b8f13380d608bb868e1db4a3174ce0414db0d Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 16:07:31 +0200 Subject: [PATCH 14/55] =?UTF-8?q?=E2=9C=85=20Fix=20faulty=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/updates/updates.service.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/updates/updates.service.spec.ts b/src/updates/updates.service.spec.ts index bd8133d..911aa04 100644 --- a/src/updates/updates.service.spec.ts +++ b/src/updates/updates.service.spec.ts @@ -1,6 +1,7 @@ import { Test } from '@nestjs/testing'; import axios from 'axios'; import { Client, GuildMember } from 'discord.js'; +import { Constants } from '../utils/constants'; import { DiscordMessageService } from '../clients/discord/discord.message.service'; import { GithubRelease } from '../models/github-release'; import { useDefaultMockerToken } from '../utils/tests/defaultMockerToken'; @@ -14,7 +15,6 @@ describe('UpdatesService', () => { const OLD_ENV = process.env; let updatesService: UpdatesService; - let discordClient: Client; let discordMessageService: DiscordMessageService; beforeEach(async () => { @@ -54,7 +54,6 @@ describe('UpdatesService', () => { .compile(); updatesService = moduleRef.get(UpdatesService); - discordClient = moduleRef.get('__inject_discord_client__'); discordMessageService = moduleRef.get( DiscordMessageService, ); @@ -88,6 +87,12 @@ describe('UpdatesService', () => { it('handleCronShouldNotifyWhenNewRelease', async () => { process.env.UPDATER_DISABLE_NOTIFICATIONS = 'false'; + Constants.Metadata.Version = { + All: () => '0.0.5', + Major: 0, + Minor: 0, + Patch: 5, + }; mockedAxios.mockResolvedValue({ data: { From 80f2b6e06146c946083b5e56651708cdf6ad0bd1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 16:11:25 +0200 Subject: [PATCH 15/55] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.message.service.ts | 2 +- src/commands/random/random.command.ts | 1 - src/commands/volume/volume.command.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/clients/discord/discord.message.service.ts b/src/clients/discord/discord.message.service.ts index 86e8d52..3b76577 100644 --- a/src/clients/discord/discord.message.service.ts +++ b/src/clients/discord/discord.message.service.ts @@ -39,7 +39,7 @@ export class DiscordMessageService { }: { title: string; description?: string; - authorUrl?: string | undefined; + authorUrl?: string; mixin?: (embedBuilder: EmbedBuilder) => EmbedBuilder; }): APIEmbed { let embedBuilder = new EmbedBuilder() diff --git a/src/commands/random/random.command.ts b/src/commands/random/random.command.ts index 9326175..3ce5bd6 100644 --- a/src/commands/random/random.command.ts +++ b/src/commands/random/random.command.ts @@ -10,7 +10,6 @@ import { DiscordMessageService } from 'src/clients/discord/discord.message.servi import { DiscordVoiceService } from 'src/clients/discord/discord.voice.service'; import { JellyfinSearchService } from 'src/clients/jellyfin/jellyfin.search.service'; import { SearchHint } from 'src/models/search/SearchHint'; -import { Track } from 'src/models/shared/Track'; import { PlaybackService } from 'src/playback/playback.service'; import { RandomCommandParams } from './random.params'; diff --git a/src/commands/volume/volume.command.ts b/src/commands/volume/volume.command.ts index 30f8f00..3bbe4ab 100644 --- a/src/commands/volume/volume.command.ts +++ b/src/commands/volume/volume.command.ts @@ -5,7 +5,6 @@ import { Logger } from '@nestjs/common'; import { Injectable } from '@nestjs/common/decorators'; import { CommandInteraction } from 'discord.js'; -import e from 'express'; import { DiscordMessageService } from 'src/clients/discord/discord.message.service'; import { DiscordVoiceService } from 'src/clients/discord/discord.voice.service'; import { PlaybackService } from 'src/playback/playback.service'; From ce1beb10478eb97ef02024e4982af7c3191142d4 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 17:09:51 +0200 Subject: [PATCH 16/55] =?UTF-8?q?=F0=9F=9A=91=20Fix=20missing=20dependenci?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d38dfa..a8f2790 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@discord-nestjs/common": "^5.2.2", "@discord-nestjs/core": "^5.3.4", - "@discordjs/opus": "^0.9.0", + "@discordjs/opus": "discordjs/opus", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.10", diff --git a/yarn.lock b/yarn.lock index ad509fd..669a0d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -424,6 +424,13 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" +"@discordjs/opus@discordjs/opus": + version "0.9.0" + resolved "https://codeload.github.com/discordjs/opus/tar.gz/814e500c2785c5207ace19650192629beba2728b" + dependencies: + "@discordjs/node-pre-gyp" "^0.4.5" + node-addon-api "^5.0.0" + "@discordjs/rest@^1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" From 53eb296258321617eff96029a3143e4612569f08 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 17:19:00 +0200 Subject: [PATCH 17/55] =?UTF-8?q?=E2=9E=96=20Remove=20invalid=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- yarn.lock | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a8f2790..f8be408 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@discord-nestjs/common": "^5.2.2", "@discord-nestjs/core": "^5.3.4", - "@discordjs/opus": "discordjs/opus", + "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.10", @@ -38,6 +38,7 @@ "discord.js": "^14.8.0", "joi": "^17.8.4", "libsodium-wrappers": "^0.7.10", + "opusscript": "^0.0.8", "reflect-metadata": "^0.1.13", "rimraf": "^4.4.0", "rxjs": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index 669a0d2..dfb9615 100644 --- a/yarn.lock +++ b/yarn.lock @@ -424,13 +424,6 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" -"@discordjs/opus@discordjs/opus": - version "0.9.0" - resolved "https://codeload.github.com/discordjs/opus/tar.gz/814e500c2785c5207ace19650192629beba2728b" - dependencies: - "@discordjs/node-pre-gyp" "^0.4.5" - node-addon-api "^5.0.0" - "@discordjs/rest@^1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" @@ -4162,6 +4155,11 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +opusscript@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/opusscript/-/opusscript-0.0.8.tgz#00b49e81281b4d99092d013b1812af8654bd0a87" + integrity sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ== + ora@5.4.1, ora@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" From 4ac09196c69853ae68a4f73ce160f1358da6a523 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 18:30:46 +0200 Subject: [PATCH 18/55] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20dependenci?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 26 ++++---- yarn.lock | 184 +++++++++++++++++++++++++++------------------------ 2 files changed, 111 insertions(+), 99 deletions(-) diff --git a/package.json b/package.json index f8be408..275bca8 100644 --- a/package.json +++ b/package.json @@ -21,26 +21,26 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { - "@discord-nestjs/common": "^5.2.2", - "@discord-nestjs/core": "^5.3.4", + "@discord-nestjs/common": "^5.2.3", + "@discord-nestjs/core": "^5.3.5", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", - "@nestjs/common": "^9.3.10", + "@nestjs/common": "^9.3.12", "@nestjs/config": "^2.2.0", - "@nestjs/core": "^9.3.11", + "@nestjs/core": "^9.3.12", "@nestjs/event-emitter": "^1.3.1", - "@nestjs/platform-express": "^9.3.10", + "@nestjs/platform-express": "^9.3.12", "@nestjs/schedule": "^2.1.0", "@nestjs/serve-static": "^3.0.1", "@nestjs/terminus": "^9.1.4", "date-fns": "^2.29.3", "discord.js": "^14.8.0", - "joi": "^17.8.4", + "joi": "^17.9.1", "libsodium-wrappers": "^0.7.10", "opusscript": "^0.0.8", "reflect-metadata": "^0.1.13", - "rimraf": "^4.4.0", + "rimraf": "^4.4.1", "rxjs": "^7.2.0", "uuid": "^9.0.0", "ws": "^8.13.0" @@ -48,16 +48,16 @@ "devDependencies": { "@nestjs/cli": "^9.3.0", "@nestjs/schematics": "^9.0.0", - "@nestjs/testing": "^9.3.10", - "@types/cron": "^2.0.0", + "@nestjs/testing": "^9.3.12", + "@types/cron": "^2.0.1", "@types/express": "^4.17.13", "@types/jest": "28.1.8", - "@types/node": "^18.15.0", + "@types/node": "^18.15.10", "@types/supertest": "^2.0.11", - "@typescript-eslint/eslint-plugin": "^5.53.0", - "@typescript-eslint/parser": "^5.55.0", + "@typescript-eslint/eslint-plugin": "^5.56.0", + "@typescript-eslint/parser": "^5.56.0", "eslint": "^8.35.0", - "eslint-config-prettier": "^8.6.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", "prettier": "^2.8.4", diff --git a/yarn.lock b/yarn.lock index dfb9615..c7826fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -360,19 +360,19 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@discord-nestjs/common@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@discord-nestjs/common/-/common-5.2.2.tgz#668ea808c849181e22be439996712bb8d4cf3545" - integrity sha512-TvONNjWXCywjUqZTJfJRHpyt202+zuyxZPj0iMBFYQ6aCtlKrwNOCsVSxINYOcta+Kl6I+/Cn1cbYYZ9NSSRKQ== +"@discord-nestjs/common@^5.2.3": + version "5.2.3" + resolved "https://registry.yarnpkg.com/@discord-nestjs/common/-/common-5.2.3.tgz#28e001b6c037eb319acfb323d805da91fb9fc871" + integrity sha512-IpA8RAGNloTdqa/tngph4PXIMUCY1evD3MXZ0pRqCMAAUJarqVIuv+itc9jDCuHBUgE9mLJjNPiLGvK7W8i4mw== dependencies: "@nestjs/mapped-types" "1.2.2" class-transformer "0.5.1" class-validator "0.14.0" -"@discord-nestjs/core@^5.3.4": - version "5.3.4" - resolved "https://registry.yarnpkg.com/@discord-nestjs/core/-/core-5.3.4.tgz#d683fe613b32e59a318771f2631abf5e108e75f2" - integrity sha512-e0dG6jk+9QLs0OiTvv1xeM3lo9iOtt7LfIeb2gaYU3eN1rkDfpzxrrqCa3B933LytGLCQNDZyeGQpeFcGmSyJg== +"@discord-nestjs/core@^5.3.5": + version "5.3.5" + resolved "https://registry.yarnpkg.com/@discord-nestjs/core/-/core-5.3.5.tgz#3f10a0f06a64e2e9140fa4cd0f67aa4a163cf383" + integrity sha512-/9Sv3fHi+G/yO9MeRo69RcID8P/AnSfi18Dzi6RaBmQgrQU5iRwi8BmfBJDotddcR0J4jJlWRrEgqt/pL3Ie+w== dependencies: class-transformer "0.5.1" @@ -823,10 +823,10 @@ webpack "5.76.2" webpack-node-externals "3.0.0" -"@nestjs/common@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.10.tgz#c137402cad41123eaf5c74c2404e92490f9bbd50" - integrity sha512-wj2bM9TXBlAvzgznkID0s7bN/niVn90sZIDtRFDnvaB1qagEpkWA0Bt39qilIuqdReluIaCjeEW106U0oyz+mQ== +"@nestjs/common@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.12.tgz#9b3a9e162fe73c830ffa588fd3d921fd8a9f174a" + integrity sha512-NtrUG2VgCbhmZEO1yRt/Utq16uFRV+xeHAOtdYIsfHGG0ssAV2lVLlvFFAQYh0SQ+KuYY1Gsxd3GK2JFoJCNqQ== dependencies: uid "2.0.1" iterare "1.2.1" @@ -842,10 +842,10 @@ lodash "4.17.21" uuid "9.0.0" -"@nestjs/core@^9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.11.tgz#1be65db0e889f8f12b87aec12c9cf66ea6043205" - integrity sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ== +"@nestjs/core@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.12.tgz#b1c06b56ff5c8ad41e841688c6763aa9748a2395" + integrity sha512-Qe0ZjJo7bOlfudn7KHLppYrt5i4k1nR1+9d5ppYat2bb5knCIT4kIqblj666n+22/2zvsHRiTo015cLyLKsLRQ== dependencies: uid "2.0.1" "@nuxtjs/opencollective" "0.3.2" @@ -866,10 +866,10 @@ resolved "https://registry.yarnpkg.com/@nestjs/mapped-types/-/mapped-types-1.2.2.tgz#d9ddb143776e309dbc1a518ac1607fddac1e140e" integrity sha512-3dHxLXs3M0GPiriAcCFFJQHoDFUuzTD5w6JDhE7TyfT89YKpe6tcCCIqOZWdXmt9AZjjK30RkHRSFF+QEnWFQg== -"@nestjs/platform-express@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.10.tgz#5493bd4dc3f5f28e3224afd56d113017b746f3d6" - integrity sha512-5aWokr8s0pipD5c/n40xC1iv3cMXfWrOhciX430p53cy4uyTAE+sTBk0PhB6tdG8NpK33aNqqHz/tyKlauQu/Q== +"@nestjs/platform-express@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.12.tgz#ad47eba72ec55cf3f4633afb19c01e6413bd77b0" + integrity sha512-iQToH9rnZHmm3a2YDKLEN7weU2qC/EVOBnuwTf1lIkqB48yLxlykSJu3KmgtlUUNDt2/HY527QIo+GZSZfCLyg== dependencies: body-parser "1.20.2" cors "2.8.5" @@ -911,10 +911,10 @@ boxen "5.1.2" check-disk-space "3.3.1" -"@nestjs/testing@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.10.tgz#d0229d4d338806758dae824bdbeb935e097d4901" - integrity sha512-TGspJkzDx1YmJzlmNG5WrhFa7IGgXbCVt4UXvBVqEk2QRPmJFZnqd0T9waKZ+SxwH4gY5sdw2niTFvOgqGVfJw== +"@nestjs/testing@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.12.tgz#e02ed34c9a267ba9495ba7f5e3d83d4956e3414f" + integrity sha512-nH274IXEqU4hr4bcb71POe58hYLONt9RcfKKM5ZvOS7wYMnybMpKKR8DkC1WcfE1P2k2GQmQoHeSH5emPtYrBA== dependencies: tslib "2.5.0" @@ -1080,10 +1080,10 @@ resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8" integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog== -"@types/cron@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/cron/-/cron-2.0.0.tgz#4fe75f2720a3b69a1f7b80e656749f4c2c96d727" - integrity sha512-xZM08fqvwIXgghtPVkSPKNgC+JoMQ2OHazEvyTKnNf7aWu1aB6/4lBbQFrb03Td2cUGG7ITzMv3mFYnMu6xRaQ== +"@types/cron@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/cron/-/cron-2.0.1.tgz#d8bf7a24475f64197c7ac868c362b41be596e5f8" + integrity sha512-WHa/1rtNtD2Q/H0+YTTZoty+/5rcE66iAFX2IY+JuUoOACsevYyFkSYu/2vdw+G5LrmO7Lxowrqm0av4k3qWNQ== dependencies: "@types/luxon" "*" "@types/node" "*" @@ -1182,11 +1182,16 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== -"@types/node@*", "@types/node@^18.15.0": +"@types/node@*": version "18.15.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.3.tgz#f0b991c32cfc6a4e7f3399d6cb4b8cf9a0315014" integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== +"@types/node@^18.15.10": + version "18.15.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.10.tgz#4ee2171c3306a185d1208dad5f44dae3dee4cfe3" + integrity sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -1264,15 +1269,15 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.53.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.55.0.tgz#bc2400c3a23305e8c9a9c04aa40933868aaaeb47" - integrity sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg== +"@typescript-eslint/eslint-plugin@^5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz#e4fbb4d6dd8dab3e733485c1a44a02189ae75364" + integrity sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/type-utils" "5.55.0" - "@typescript-eslint/utils" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/type-utils" "5.56.0" + "@typescript-eslint/utils" "5.56.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1280,72 +1285,72 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.55.0.tgz#8c96a0b6529708ace1dcfa60f5e6aec0f5ed2262" - integrity sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw== +"@typescript-eslint/parser@^5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.56.0.tgz#42eafb44b639ef1dbd54a3dbe628c446ca753ea6" + integrity sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg== dependencies: - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/typescript-estree" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/typescript-estree" "5.56.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.55.0.tgz#e863bab4d4183ddce79967fe10ceb6c829791210" - integrity sha512-OK+cIO1ZGhJYNCL//a3ROpsd83psf4dUJ4j7pdNVzd5DmIk+ffkuUIX2vcZQbEW/IR41DYsfJTB19tpCboxQuw== +"@typescript-eslint/scope-manager@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz#62b4055088903b5254fa20403010e1c16d6ab725" + integrity sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw== dependencies: - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/visitor-keys" "5.55.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/visitor-keys" "5.56.0" -"@typescript-eslint/type-utils@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.55.0.tgz#74bf0233523f874738677bb73cb58094210e01e9" - integrity sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA== +"@typescript-eslint/type-utils@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz#e6f004a072f09c42e263dc50e98c70b41a509685" + integrity sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A== dependencies: - "@typescript-eslint/typescript-estree" "5.55.0" - "@typescript-eslint/utils" "5.55.0" + "@typescript-eslint/typescript-estree" "5.56.0" + "@typescript-eslint/utils" "5.56.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.55.0.tgz#9830f8d3bcbecf59d12f821e5bc6960baaed41fd" - integrity sha512-M4iRh4AG1ChrOL6Y+mETEKGeDnT7Sparn6fhZ5LtVJF1909D5O4uqK+C5NPbLmpfZ0XIIxCdwzKiijpZUOvOug== +"@typescript-eslint/types@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.56.0.tgz#b03f0bfd6fa2afff4e67c5795930aff398cbd834" + integrity sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w== -"@typescript-eslint/typescript-estree@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.55.0.tgz#8db7c8e47ecc03d49b05362b8db6f1345ee7b575" - integrity sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ== +"@typescript-eslint/typescript-estree@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz#48342aa2344649a03321e74cab9ccecb9af086c3" + integrity sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg== dependencies: - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/visitor-keys" "5.55.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/visitor-keys" "5.56.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.55.0.tgz#34e97322e7ae5b901e7a870aabb01dad90023341" - integrity sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw== +"@typescript-eslint/utils@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.56.0.tgz#db64705409b9a15546053fb4deb2888b37df1f41" + integrity sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/typescript-estree" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/typescript-estree" "5.56.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.55.0.tgz#01ad414fca8367706d76cdb94adf788dc5b664a2" - integrity sha512-q2dlHHwWgirKh1D3acnuApXG+VNXpEY5/AwRxDVuEQpxWaB0jCDe0jFMVMALJ3ebSfuOVE8/rMS+9ZOYGg1GWw== +"@typescript-eslint/visitor-keys@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz#f19eb297d972417eb13cb69b35b3213e13cc214f" + integrity sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q== dependencies: - "@typescript-eslint/types" "5.55.0" + "@typescript-eslint/types" "5.56.0" eslint-visitor-keys "^3.3.0" "@webassemblyjs/ast@1.11.1": @@ -2416,10 +2421,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.6.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.7.0.tgz#f1cc58a8afebc50980bd53475451df146c13182d" - integrity sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== +eslint-config-prettier@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== eslint-plugin-prettier@^4.0.0: version "4.2.1" @@ -3649,10 +3654,10 @@ jest@28.1.3: import-local "^3.0.2" jest-cli "^28.1.3" -joi@^17.8.4: - version "17.8.4" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.8.4.tgz#f2d91ab8acd3cca4079ba70669c65891739234aa" - integrity sha512-jjdRHb5WtL+KgSHvOULQEPPv4kcl+ixd1ybOFQq3rWLgEEqc03QMmilodL0GVJE14U/SQDXkUhQUSZANGDH/AA== +joi@^17.9.1: + version "17.9.1" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.9.1.tgz#74899b9fa3646904afa984a11df648eca66c9018" + integrity sha512-FariIi9j6QODKATGBrEX7HZcja8Bsh3rfdGYy/Sb65sGlZWK/QWesU1ghk7aJWDj95knjXlQfSmzFSPPkLVsfw== dependencies: "@hapi/hoek" "^9.0.0" "@hapi/topo" "^5.0.0" @@ -4547,7 +4552,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@4.4.0, rimraf@^4.4.0: +rimraf@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.0.tgz#c7a9f45bb2ec058d2e60ef9aca5167974313d605" integrity sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ== @@ -4561,6 +4566,13 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.1.tgz#bd33364f67021c5b79e93d7f4fa0568c7c21b755" + integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== + dependencies: + glob "^9.2.0" + run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" From 664fe080bcb910450fddbeff39c75a8cf5fd42a9 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 17:09:51 +0200 Subject: [PATCH 19/55] =?UTF-8?q?=F0=9F=9A=91=20Fix=20missing=20dependenci?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d38dfa..a8f2790 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@discord-nestjs/common": "^5.2.2", "@discord-nestjs/core": "^5.3.4", - "@discordjs/opus": "^0.9.0", + "@discordjs/opus": "discordjs/opus", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.10", diff --git a/yarn.lock b/yarn.lock index ad509fd..669a0d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -424,6 +424,13 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" +"@discordjs/opus@discordjs/opus": + version "0.9.0" + resolved "https://codeload.github.com/discordjs/opus/tar.gz/814e500c2785c5207ace19650192629beba2728b" + dependencies: + "@discordjs/node-pre-gyp" "^0.4.5" + node-addon-api "^5.0.0" + "@discordjs/rest@^1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" From 361ed78c8c4d46dc10b14e655c00178b183a109d Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 17:19:00 +0200 Subject: [PATCH 20/55] =?UTF-8?q?=E2=9E=96=20Remove=20invalid=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- yarn.lock | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a8f2790..f8be408 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "@discord-nestjs/common": "^5.2.2", "@discord-nestjs/core": "^5.3.4", - "@discordjs/opus": "discordjs/opus", + "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.10", @@ -38,6 +38,7 @@ "discord.js": "^14.8.0", "joi": "^17.8.4", "libsodium-wrappers": "^0.7.10", + "opusscript": "^0.0.8", "reflect-metadata": "^0.1.13", "rimraf": "^4.4.0", "rxjs": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index 669a0d2..dfb9615 100644 --- a/yarn.lock +++ b/yarn.lock @@ -424,13 +424,6 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" -"@discordjs/opus@discordjs/opus": - version "0.9.0" - resolved "https://codeload.github.com/discordjs/opus/tar.gz/814e500c2785c5207ace19650192629beba2728b" - dependencies: - "@discordjs/node-pre-gyp" "^0.4.5" - node-addon-api "^5.0.0" - "@discordjs/rest@^1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" @@ -4162,6 +4155,11 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +opusscript@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/opusscript/-/opusscript-0.0.8.tgz#00b49e81281b4d99092d013b1812af8654bd0a87" + integrity sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ== + ora@5.4.1, ora@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" From a28dc8d1a01ca786071546eb49be80d8429393d1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 26 Mar 2023 18:30:46 +0200 Subject: [PATCH 21/55] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20dependenci?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 26 ++++---- yarn.lock | 184 +++++++++++++++++++++++++++------------------------ 2 files changed, 111 insertions(+), 99 deletions(-) diff --git a/package.json b/package.json index f8be408..275bca8 100644 --- a/package.json +++ b/package.json @@ -21,26 +21,26 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { - "@discord-nestjs/common": "^5.2.2", - "@discord-nestjs/core": "^5.3.4", + "@discord-nestjs/common": "^5.2.3", + "@discord-nestjs/core": "^5.3.5", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.15.0", "@jellyfin/sdk": "^0.7.0", - "@nestjs/common": "^9.3.10", + "@nestjs/common": "^9.3.12", "@nestjs/config": "^2.2.0", - "@nestjs/core": "^9.3.11", + "@nestjs/core": "^9.3.12", "@nestjs/event-emitter": "^1.3.1", - "@nestjs/platform-express": "^9.3.10", + "@nestjs/platform-express": "^9.3.12", "@nestjs/schedule": "^2.1.0", "@nestjs/serve-static": "^3.0.1", "@nestjs/terminus": "^9.1.4", "date-fns": "^2.29.3", "discord.js": "^14.8.0", - "joi": "^17.8.4", + "joi": "^17.9.1", "libsodium-wrappers": "^0.7.10", "opusscript": "^0.0.8", "reflect-metadata": "^0.1.13", - "rimraf": "^4.4.0", + "rimraf": "^4.4.1", "rxjs": "^7.2.0", "uuid": "^9.0.0", "ws": "^8.13.0" @@ -48,16 +48,16 @@ "devDependencies": { "@nestjs/cli": "^9.3.0", "@nestjs/schematics": "^9.0.0", - "@nestjs/testing": "^9.3.10", - "@types/cron": "^2.0.0", + "@nestjs/testing": "^9.3.12", + "@types/cron": "^2.0.1", "@types/express": "^4.17.13", "@types/jest": "28.1.8", - "@types/node": "^18.15.0", + "@types/node": "^18.15.10", "@types/supertest": "^2.0.11", - "@typescript-eslint/eslint-plugin": "^5.53.0", - "@typescript-eslint/parser": "^5.55.0", + "@typescript-eslint/eslint-plugin": "^5.56.0", + "@typescript-eslint/parser": "^5.56.0", "eslint": "^8.35.0", - "eslint-config-prettier": "^8.6.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", "prettier": "^2.8.4", diff --git a/yarn.lock b/yarn.lock index dfb9615..c7826fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -360,19 +360,19 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@discord-nestjs/common@^5.2.2": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@discord-nestjs/common/-/common-5.2.2.tgz#668ea808c849181e22be439996712bb8d4cf3545" - integrity sha512-TvONNjWXCywjUqZTJfJRHpyt202+zuyxZPj0iMBFYQ6aCtlKrwNOCsVSxINYOcta+Kl6I+/Cn1cbYYZ9NSSRKQ== +"@discord-nestjs/common@^5.2.3": + version "5.2.3" + resolved "https://registry.yarnpkg.com/@discord-nestjs/common/-/common-5.2.3.tgz#28e001b6c037eb319acfb323d805da91fb9fc871" + integrity sha512-IpA8RAGNloTdqa/tngph4PXIMUCY1evD3MXZ0pRqCMAAUJarqVIuv+itc9jDCuHBUgE9mLJjNPiLGvK7W8i4mw== dependencies: "@nestjs/mapped-types" "1.2.2" class-transformer "0.5.1" class-validator "0.14.0" -"@discord-nestjs/core@^5.3.4": - version "5.3.4" - resolved "https://registry.yarnpkg.com/@discord-nestjs/core/-/core-5.3.4.tgz#d683fe613b32e59a318771f2631abf5e108e75f2" - integrity sha512-e0dG6jk+9QLs0OiTvv1xeM3lo9iOtt7LfIeb2gaYU3eN1rkDfpzxrrqCa3B933LytGLCQNDZyeGQpeFcGmSyJg== +"@discord-nestjs/core@^5.3.5": + version "5.3.5" + resolved "https://registry.yarnpkg.com/@discord-nestjs/core/-/core-5.3.5.tgz#3f10a0f06a64e2e9140fa4cd0f67aa4a163cf383" + integrity sha512-/9Sv3fHi+G/yO9MeRo69RcID8P/AnSfi18Dzi6RaBmQgrQU5iRwi8BmfBJDotddcR0J4jJlWRrEgqt/pL3Ie+w== dependencies: class-transformer "0.5.1" @@ -823,10 +823,10 @@ webpack "5.76.2" webpack-node-externals "3.0.0" -"@nestjs/common@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.10.tgz#c137402cad41123eaf5c74c2404e92490f9bbd50" - integrity sha512-wj2bM9TXBlAvzgznkID0s7bN/niVn90sZIDtRFDnvaB1qagEpkWA0Bt39qilIuqdReluIaCjeEW106U0oyz+mQ== +"@nestjs/common@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.12.tgz#9b3a9e162fe73c830ffa588fd3d921fd8a9f174a" + integrity sha512-NtrUG2VgCbhmZEO1yRt/Utq16uFRV+xeHAOtdYIsfHGG0ssAV2lVLlvFFAQYh0SQ+KuYY1Gsxd3GK2JFoJCNqQ== dependencies: uid "2.0.1" iterare "1.2.1" @@ -842,10 +842,10 @@ lodash "4.17.21" uuid "9.0.0" -"@nestjs/core@^9.3.11": - version "9.3.11" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.11.tgz#1be65db0e889f8f12b87aec12c9cf66ea6043205" - integrity sha512-CI27a2JFd5rvvbgkalWqsiwQNhcP4EAG5BUK8usjp29wVp1kx30ghfBT8FLqIgmkRVo65A0IcEnWsxeXMntkxQ== +"@nestjs/core@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.12.tgz#b1c06b56ff5c8ad41e841688c6763aa9748a2395" + integrity sha512-Qe0ZjJo7bOlfudn7KHLppYrt5i4k1nR1+9d5ppYat2bb5knCIT4kIqblj666n+22/2zvsHRiTo015cLyLKsLRQ== dependencies: uid "2.0.1" "@nuxtjs/opencollective" "0.3.2" @@ -866,10 +866,10 @@ resolved "https://registry.yarnpkg.com/@nestjs/mapped-types/-/mapped-types-1.2.2.tgz#d9ddb143776e309dbc1a518ac1607fddac1e140e" integrity sha512-3dHxLXs3M0GPiriAcCFFJQHoDFUuzTD5w6JDhE7TyfT89YKpe6tcCCIqOZWdXmt9AZjjK30RkHRSFF+QEnWFQg== -"@nestjs/platform-express@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.10.tgz#5493bd4dc3f5f28e3224afd56d113017b746f3d6" - integrity sha512-5aWokr8s0pipD5c/n40xC1iv3cMXfWrOhciX430p53cy4uyTAE+sTBk0PhB6tdG8NpK33aNqqHz/tyKlauQu/Q== +"@nestjs/platform-express@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/platform-express/-/platform-express-9.3.12.tgz#ad47eba72ec55cf3f4633afb19c01e6413bd77b0" + integrity sha512-iQToH9rnZHmm3a2YDKLEN7weU2qC/EVOBnuwTf1lIkqB48yLxlykSJu3KmgtlUUNDt2/HY527QIo+GZSZfCLyg== dependencies: body-parser "1.20.2" cors "2.8.5" @@ -911,10 +911,10 @@ boxen "5.1.2" check-disk-space "3.3.1" -"@nestjs/testing@^9.3.10": - version "9.3.10" - resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.10.tgz#d0229d4d338806758dae824bdbeb935e097d4901" - integrity sha512-TGspJkzDx1YmJzlmNG5WrhFa7IGgXbCVt4UXvBVqEk2QRPmJFZnqd0T9waKZ+SxwH4gY5sdw2niTFvOgqGVfJw== +"@nestjs/testing@^9.3.12": + version "9.3.12" + resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.12.tgz#e02ed34c9a267ba9495ba7f5e3d83d4956e3414f" + integrity sha512-nH274IXEqU4hr4bcb71POe58hYLONt9RcfKKM5ZvOS7wYMnybMpKKR8DkC1WcfE1P2k2GQmQoHeSH5emPtYrBA== dependencies: tslib "2.5.0" @@ -1080,10 +1080,10 @@ resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8" integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog== -"@types/cron@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/cron/-/cron-2.0.0.tgz#4fe75f2720a3b69a1f7b80e656749f4c2c96d727" - integrity sha512-xZM08fqvwIXgghtPVkSPKNgC+JoMQ2OHazEvyTKnNf7aWu1aB6/4lBbQFrb03Td2cUGG7ITzMv3mFYnMu6xRaQ== +"@types/cron@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/cron/-/cron-2.0.1.tgz#d8bf7a24475f64197c7ac868c362b41be596e5f8" + integrity sha512-WHa/1rtNtD2Q/H0+YTTZoty+/5rcE66iAFX2IY+JuUoOACsevYyFkSYu/2vdw+G5LrmO7Lxowrqm0av4k3qWNQ== dependencies: "@types/luxon" "*" "@types/node" "*" @@ -1182,11 +1182,16 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== -"@types/node@*", "@types/node@^18.15.0": +"@types/node@*": version "18.15.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.3.tgz#f0b991c32cfc6a4e7f3399d6cb4b8cf9a0315014" integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== +"@types/node@^18.15.10": + version "18.15.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.10.tgz#4ee2171c3306a185d1208dad5f44dae3dee4cfe3" + integrity sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -1264,15 +1269,15 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.53.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.55.0.tgz#bc2400c3a23305e8c9a9c04aa40933868aaaeb47" - integrity sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg== +"@typescript-eslint/eslint-plugin@^5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz#e4fbb4d6dd8dab3e733485c1a44a02189ae75364" + integrity sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/type-utils" "5.55.0" - "@typescript-eslint/utils" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/type-utils" "5.56.0" + "@typescript-eslint/utils" "5.56.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1280,72 +1285,72 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.55.0.tgz#8c96a0b6529708ace1dcfa60f5e6aec0f5ed2262" - integrity sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw== +"@typescript-eslint/parser@^5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.56.0.tgz#42eafb44b639ef1dbd54a3dbe628c446ca753ea6" + integrity sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg== dependencies: - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/typescript-estree" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/typescript-estree" "5.56.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.55.0.tgz#e863bab4d4183ddce79967fe10ceb6c829791210" - integrity sha512-OK+cIO1ZGhJYNCL//a3ROpsd83psf4dUJ4j7pdNVzd5DmIk+ffkuUIX2vcZQbEW/IR41DYsfJTB19tpCboxQuw== +"@typescript-eslint/scope-manager@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz#62b4055088903b5254fa20403010e1c16d6ab725" + integrity sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw== dependencies: - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/visitor-keys" "5.55.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/visitor-keys" "5.56.0" -"@typescript-eslint/type-utils@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.55.0.tgz#74bf0233523f874738677bb73cb58094210e01e9" - integrity sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA== +"@typescript-eslint/type-utils@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz#e6f004a072f09c42e263dc50e98c70b41a509685" + integrity sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A== dependencies: - "@typescript-eslint/typescript-estree" "5.55.0" - "@typescript-eslint/utils" "5.55.0" + "@typescript-eslint/typescript-estree" "5.56.0" + "@typescript-eslint/utils" "5.56.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.55.0.tgz#9830f8d3bcbecf59d12f821e5bc6960baaed41fd" - integrity sha512-M4iRh4AG1ChrOL6Y+mETEKGeDnT7Sparn6fhZ5LtVJF1909D5O4uqK+C5NPbLmpfZ0XIIxCdwzKiijpZUOvOug== +"@typescript-eslint/types@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.56.0.tgz#b03f0bfd6fa2afff4e67c5795930aff398cbd834" + integrity sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w== -"@typescript-eslint/typescript-estree@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.55.0.tgz#8db7c8e47ecc03d49b05362b8db6f1345ee7b575" - integrity sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ== +"@typescript-eslint/typescript-estree@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz#48342aa2344649a03321e74cab9ccecb9af086c3" + integrity sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg== dependencies: - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/visitor-keys" "5.55.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/visitor-keys" "5.56.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.55.0.tgz#34e97322e7ae5b901e7a870aabb01dad90023341" - integrity sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw== +"@typescript-eslint/utils@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.56.0.tgz#db64705409b9a15546053fb4deb2888b37df1f41" + integrity sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.55.0" - "@typescript-eslint/types" "5.55.0" - "@typescript-eslint/typescript-estree" "5.55.0" + "@typescript-eslint/scope-manager" "5.56.0" + "@typescript-eslint/types" "5.56.0" + "@typescript-eslint/typescript-estree" "5.56.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.55.0": - version "5.55.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.55.0.tgz#01ad414fca8367706d76cdb94adf788dc5b664a2" - integrity sha512-q2dlHHwWgirKh1D3acnuApXG+VNXpEY5/AwRxDVuEQpxWaB0jCDe0jFMVMALJ3ebSfuOVE8/rMS+9ZOYGg1GWw== +"@typescript-eslint/visitor-keys@5.56.0": + version "5.56.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz#f19eb297d972417eb13cb69b35b3213e13cc214f" + integrity sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q== dependencies: - "@typescript-eslint/types" "5.55.0" + "@typescript-eslint/types" "5.56.0" eslint-visitor-keys "^3.3.0" "@webassemblyjs/ast@1.11.1": @@ -2416,10 +2421,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.6.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.7.0.tgz#f1cc58a8afebc50980bd53475451df146c13182d" - integrity sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== +eslint-config-prettier@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== eslint-plugin-prettier@^4.0.0: version "4.2.1" @@ -3649,10 +3654,10 @@ jest@28.1.3: import-local "^3.0.2" jest-cli "^28.1.3" -joi@^17.8.4: - version "17.8.4" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.8.4.tgz#f2d91ab8acd3cca4079ba70669c65891739234aa" - integrity sha512-jjdRHb5WtL+KgSHvOULQEPPv4kcl+ixd1ybOFQq3rWLgEEqc03QMmilodL0GVJE14U/SQDXkUhQUSZANGDH/AA== +joi@^17.9.1: + version "17.9.1" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.9.1.tgz#74899b9fa3646904afa984a11df648eca66c9018" + integrity sha512-FariIi9j6QODKATGBrEX7HZcja8Bsh3rfdGYy/Sb65sGlZWK/QWesU1ghk7aJWDj95knjXlQfSmzFSPPkLVsfw== dependencies: "@hapi/hoek" "^9.0.0" "@hapi/topo" "^5.0.0" @@ -4547,7 +4552,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@4.4.0, rimraf@^4.4.0: +rimraf@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.0.tgz#c7a9f45bb2ec058d2e60ef9aca5167974313d605" integrity sha512-X36S+qpCUR0HjXlkDe4NAOhS//aHH0Z+h8Ckf2auGJk3PTnx5rLmrHkwNdbVQuCSUhOyFrlRvFEllZOYE+yZGQ== @@ -4561,6 +4566,13 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.1.tgz#bd33364f67021c5b79e93d7f4fa0568c7c21b755" + integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== + dependencies: + glob "^9.2.0" + run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" From 091ca0b65ff8e6b061b11db0267e13e2d361b3c5 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 27 Mar 2023 22:45:23 +0200 Subject: [PATCH 22/55] =?UTF-8?q?=F0=9F=90=9B=20Fix=20case=20sensitive=20v?= =?UTF-8?q?alidation=20for=20LOGLEVEL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.module.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app.module.ts b/src/app.module.ts index f860303..8773310 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -28,6 +28,7 @@ import { UpdatesModule } from './updates/updates.module'; UPDATER_DISABLE_NOTIFICATIONS: Joi.boolean(), LOG_LEVEL: Joi.string() .valid('error', 'warn', 'log', 'debug', 'verbose') + .insensitive() .default('log'), PORT: Joi.number().min(1), }), From acf4cf19f6545277161af2529c00cbe574ec980c Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Tue, 28 Mar 2023 20:58:58 +0200 Subject: [PATCH 23/55] =?UTF-8?q?=E2=9C=A8=20Add=20playback=20reporting=20?= =?UTF-8?q?at=20Jellyfin=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.voice.service.ts | 11 +++++---- .../jellyfin/jellyfin.playstate.service.ts | 23 ++++++++++++++++--- src/commands/stop.command.ts | 2 +- src/models/shared/Playlist.ts | 18 ++++++++++++++- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index 615fbc9..1e92493 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -41,7 +41,7 @@ export class DiscordVoiceService { private readonly eventEmitter: EventEmitter2, ) {} - @OnEvent('internal.audio.announce') + @OnEvent('internal.audio.track.announce') handleOnNewTrack(track: Track) { const resource = createAudioResource( track.getStreamUrl(this.jellyfinStreamBuilder), @@ -264,9 +264,12 @@ export class DiscordVoiceService { this.logger.debug(`Audio player finished playing old resource`); - const hasNextTrack = this.playbackService - .getPlaylistOrDefault() - .hasNextTrackInPlaylist(); + const playlist = this.playbackService.getPlaylistOrDefault(); + const finishedTrack = playlist.getActiveTrack(); + + this.eventEmitter.emit('internal.audio.track.finish', finishedTrack); + + const hasNextTrack = playlist.hasNextTrackInPlaylist(); this.logger.debug( `Playlist has next track: ${hasNextTrack ? 'yes' : 'no'}`, diff --git a/src/clients/jellyfin/jellyfin.playstate.service.ts b/src/clients/jellyfin/jellyfin.playstate.service.ts index 57b1483..c38221b 100644 --- a/src/clients/jellyfin/jellyfin.playstate.service.ts +++ b/src/clients/jellyfin/jellyfin.playstate.service.ts @@ -10,9 +10,9 @@ import { getSessionApi } from '@jellyfin/sdk/lib/utils/api/session-api'; import { Injectable, Logger } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; +import { Track } from 'src/models/shared/Track'; import { PlaybackService } from '../../playback/playback.service'; -import { Track } from '../../types/track'; @Injectable() export class JellyinPlaystateService { @@ -46,11 +46,28 @@ export class JellyinPlaystateService { this.logger.debug('Reported playback capabilities sucessfully'); } - @OnEvent('playback.newTrack') + @OnEvent('internal.audio.track.announce') private async onPlaybackNewTrack(track: Track) { + this.logger.debug(`Reporting playback start on track '${track.id}'`); await this.playstateApi.reportPlaybackStart({ playbackStartInfo: { - ItemId: track.jellyfinId, + ItemId: track.id, + }, + }); + } + + @OnEvent('internal.audio.track.finish') + private async onPlaybackFinished(track: Track) { + if (!track) { + this.logger.error( + `Unable to report playback because finished track was undefined`, + ); + return; + } + this.logger.debug(`Reporting playback finish on track '${track.id}'`); + await this.playstateApi.reportPlaybackStopped({ + playbackStopInfo: { + ItemId: track.id, }, }); } diff --git a/src/commands/stop.command.ts b/src/commands/stop.command.ts index d9d1579..b57b129 100644 --- a/src/commands/stop.command.ts +++ b/src/commands/stop.command.ts @@ -30,8 +30,8 @@ export class StopPlaybackCommand { ? 'In addition, your playlist has been cleared' : 'There is no active track in the queue'; if (hasActiveTrack) { - this.playbackService.getPlaylistOrDefault().clear(); this.discordVoiceService.stop(false); + // this.playbackService.getPlaylistOrDefault().clear(); } await interaction.reply({ diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index f96ebea..bac225b 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -49,6 +49,8 @@ export class Playlist { * @returns if the track has been changed successfully */ setNextTrackAsActiveTrack(): boolean { + this.announceTrackFinishIfSet(); + if (this.activeTrackIndex >= this.tracks.length) { return false; } @@ -66,6 +68,8 @@ export class Playlist { * @returns if the track has been changed successfully */ setPreviousTrackAsActiveTrack(): boolean { + this.announceTrackFinishIfSet(); + if (this.activeTrackIndex <= 0) { return false; } @@ -124,12 +128,24 @@ export class Playlist { this.activeTrackIndex = undefined; } + private announceTrackFinishIfSet() { + if (this.activeTrackIndex === undefined) { + return; + } + + const currentTrack = this.getActiveTrack(); + this.eventEmitter.emit('internal.audio.track.finish', currentTrack); + } + private announceTrackChange() { if (!this.activeTrackIndex) { this.activeTrackIndex = 0; } - this.eventEmitter.emit('internal.audio.announce', this.getActiveTrack()); + this.eventEmitter.emit( + 'internal.audio.track.announce', + this.getActiveTrack(), + ); } private isActiveTrackOutOfSync(): boolean { From 28a32033c4b1b7e2b35125c3b97fe7d56ff2f2c0 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 28 Mar 2023 21:04:10 +0200 Subject: [PATCH 24/55] =?UTF-8?q?=E2=9C=A8=20Add=20playing=20attribute=20f?= =?UTF-8?q?or=20track?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/shared/Playlist.ts | 4 +++- src/models/shared/Track.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index f96ebea..9ca749a 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -129,7 +129,9 @@ export class Playlist { this.activeTrackIndex = 0; } - this.eventEmitter.emit('internal.audio.announce', this.getActiveTrack()); + const activeTrack = this.getActiveTrack(); + activeTrack.playing = true; + this.eventEmitter.emit('internal.audio.announce', activeTrack); } private isActiveTrackOutOfSync(): boolean { diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index b93875f..1965890 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -27,6 +27,8 @@ export class Track { */ remoteImages?: RemoteImageResult; + playing: boolean; + constructor( id: string, name: string, From 00e58dcc8d213da9ff97cb9b680d9f309cd405e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 04:06:20 +0000 Subject: [PATCH 25/55] :arrow_up:(deps-dev): Bump prettier from 2.8.4 to 2.8.7 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.4 to 2.8.7. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.4...2.8.7) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 275bca8..83f7cad 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", - "prettier": "^2.8.4", + "prettier": "^2.8.7", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "ts-jest": "28.0.8", diff --git a/yarn.lock b/yarn.lock index c7826fd..6994cd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4340,10 +4340,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.8.4: - version "2.8.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" - integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== +prettier@^2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== pretty-format@^28.0.0, pretty-format@^28.1.3: version "28.1.3" From b940ca98e225dce6f3481a3013c49d4abce3e5c1 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 28 Mar 2023 22:17:59 +0200 Subject: [PATCH 26/55] =?UTF-8?q?=F0=9F=90=9B=20Fix=20track=20state=20on?= =?UTF-8?q?=20finishing=20track?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.voice.service.ts | 1 + src/clients/jellyfin/jellyfin.playstate.service.ts | 2 +- src/models/shared/Playlist.ts | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index 1e92493..ba5775f 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -266,6 +266,7 @@ export class DiscordVoiceService { const playlist = this.playbackService.getPlaylistOrDefault(); const finishedTrack = playlist.getActiveTrack(); + finishedTrack.playing = false; this.eventEmitter.emit('internal.audio.track.finish', finishedTrack); diff --git a/src/clients/jellyfin/jellyfin.playstate.service.ts b/src/clients/jellyfin/jellyfin.playstate.service.ts index c38221b..e394926 100644 --- a/src/clients/jellyfin/jellyfin.playstate.service.ts +++ b/src/clients/jellyfin/jellyfin.playstate.service.ts @@ -10,7 +10,7 @@ import { getSessionApi } from '@jellyfin/sdk/lib/utils/api/session-api'; import { Injectable, Logger } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; -import { Track } from 'src/models/shared/Track'; +import { Track } from '../../models/shared/Track'; import { PlaybackService } from '../../playback/playback.service'; diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index d86d0ae..76cfbab 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -92,12 +92,21 @@ export class Playlist { return 0; } + const previousTrackLength = this.tracks.length; + this.eventEmitter.emit('controls.playlist.tracks.enqueued', { count: tracks.length, activeTrack: this.activeTrackIndex, }); const length = this.tracks.push(...tracks); + // existing tracks are in the playlist, but none are playing. play the first track out of the new tracks + if (!this.hasAnyPlaying() && tracks.length > 0) { + this.activeTrackIndex = previousTrackLength; + this.announceTrackChange(); + return length; + } + // emit a track change if there is no item if (this.activeTrackIndex === undefined) { this.announceTrackChange(); @@ -128,6 +137,10 @@ export class Playlist { this.activeTrackIndex = undefined; } + private hasAnyPlaying() { + return this.tracks.some((track) => track.playing); + } + private announceTrackFinishIfSet() { if (this.activeTrackIndex === undefined) { return; From c1faa46700f42ddaa2c981ffe2a9a23b43b6e25f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:54:34 +0000 Subject: [PATCH 27/55] :arrow_up:(deps-dev): Bump eslint from 8.36.0 to 8.37.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.36.0 to 8.37.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.36.0...v8.37.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 83f7cad..426cf42 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", - "eslint": "^8.35.0", + "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", diff --git a/yarn.lock b/yarn.lock index 6994cd3..be6c0ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -466,14 +466,14 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.4.0.tgz#3e61c564fcd6b921cb789838631c5ee44df09403" integrity sha512-A9983Q0LnDGdLPjxyXQ00sbV+K+O+ko2Dr+CZigbHWtX9pNfxlaBkMR8X1CztI73zuEyEBXTVjx7CE+/VSwDiQ== -"@eslint/eslintrc@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.1.tgz#7888fe7ec8f21bc26d646dbd2c11cd776e21192d" - integrity sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw== +"@eslint/eslintrc@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" + integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.0" + espree "^9.5.1" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -481,10 +481,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.36.0": - version "8.36.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.36.0.tgz#9837f768c03a1e4a30bd304a64fb8844f0e72efe" - integrity sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg== +"@eslint/js@8.37.0": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" + integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== "@hapi/hoek@^9.0.0": version "9.3.0" @@ -2449,20 +2449,20 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== -eslint@^8.35.0: - version "8.36.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.36.0.tgz#1bd72202200a5492f91803b113fb8a83b11285cf" - integrity sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw== +eslint@^8.37.0: + version "8.37.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" + integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.1" - "@eslint/js" "8.36.0" + "@eslint/eslintrc" "^2.0.2" + "@eslint/js" "8.37.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -2473,8 +2473,8 @@ eslint@^8.35.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.1.1" - eslint-visitor-keys "^3.3.0" - espree "^9.5.0" + eslint-visitor-keys "^3.4.0" + espree "^9.5.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -2500,14 +2500,14 @@ eslint@^8.35.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.0: - version "9.5.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.0.tgz#3646d4e3f58907464edba852fa047e6a27bdf113" - integrity sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw== +espree@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" + integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.0" esprima@^4.0.0: version "4.0.1" From d2890a5f0e5835c95fb3d17d45aac5ddac449d00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:55:16 +0000 Subject: [PATCH 28/55] :arrow_up:(deps): Bump @nestjs/terminus from 9.2.1 to 9.2.2 Bumps [@nestjs/terminus](https://github.com/nestjs/terminus) from 9.2.1 to 9.2.2. - [Release notes](https://github.com/nestjs/terminus/releases) - [Changelog](https://github.com/nestjs/terminus/blob/master/CHANGELOG.md) - [Commits](https://github.com/nestjs/terminus/compare/9.2.1...9.2.2) --- updated-dependencies: - dependency-name: "@nestjs/terminus" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 426cf42..d1588ee 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@nestjs/platform-express": "^9.3.12", "@nestjs/schedule": "^2.1.0", "@nestjs/serve-static": "^3.0.1", - "@nestjs/terminus": "^9.1.4", + "@nestjs/terminus": "^9.2.2", "date-fns": "^2.29.3", "discord.js": "^14.8.0", "joi": "^17.9.1", diff --git a/yarn.lock b/yarn.lock index be6c0ee..b913db9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -903,10 +903,10 @@ dependencies: path-to-regexp "0.2.5" -"@nestjs/terminus@^9.1.4": - version "9.2.1" - resolved "https://registry.yarnpkg.com/@nestjs/terminus/-/terminus-9.2.1.tgz#f173ba807bbab6ed2ee892e859455553274a725e" - integrity sha512-bPJsxKzqLl1BIs1YFIji20h42VG4ElGqc+lyw7nW+as0DkfjpRYUdyEBQJo6dTAcqRrVxSN2m3wKweBknK3Nxw== +"@nestjs/terminus@^9.2.2": + version "9.2.2" + resolved "https://registry.yarnpkg.com/@nestjs/terminus/-/terminus-9.2.2.tgz#88c78061307eaf19308b1f6a6055aa6c33750195" + integrity sha512-AWUA8XLcgxWUjUFYHDqi42M7CZn2e+DEWxP+MqNAbMzz4ybB5jGcFK5Fy8qwaNBoWg6KMF1JiXOOygGXgk9ydg== dependencies: boxen "5.1.2" check-disk-space "3.3.1" From b0069796d7ae147e23d10c6ff55ac9ec77c01c8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 19:03:22 +0000 Subject: [PATCH 29/55] :arrow_up:(deps-dev): Bump @types/node from 18.15.10 to 18.15.11 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.15.10 to 18.15.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d1588ee..ea8d70d 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/cron": "^2.0.1", "@types/express": "^4.17.13", "@types/jest": "28.1.8", - "@types/node": "^18.15.10", + "@types/node": "^18.15.11", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/parser": "^5.56.0", diff --git a/yarn.lock b/yarn.lock index b913db9..1f0145c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1182,15 +1182,10 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== -"@types/node@*": - version "18.15.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.3.tgz#f0b991c32cfc6a4e7f3399d6cb4b8cf9a0315014" - integrity sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== - -"@types/node@^18.15.10": - version "18.15.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.10.tgz#4ee2171c3306a185d1208dad5f44dae3dee4cfe3" - integrity sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ== +"@types/node@*", "@types/node@^18.15.11": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== "@types/parse-json@^4.0.0": version "4.0.0" From 2b8170cc1e6e46bd480cce78385738dd963d38db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:56:30 +0000 Subject: [PATCH 30/55] :arrow_up:(deps-dev): Bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.56.0 to 5.57.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.57.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 74 ++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index ea8d70d..2076134 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@types/jest": "28.1.8", "@types/node": "^18.15.11", "@types/supertest": "^2.0.11", - "@typescript-eslint/eslint-plugin": "^5.56.0", + "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.56.0", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", diff --git a/yarn.lock b/yarn.lock index 1f0145c..fd9a9c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1264,15 +1264,15 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz#e4fbb4d6dd8dab3e733485c1a44a02189ae75364" - integrity sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg== +"@typescript-eslint/eslint-plugin@^5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.0.tgz#52c8a7a4512f10e7249ca1e2e61f81c62c34365c" + integrity sha512-itag0qpN6q2UMM6Xgk6xoHa0D0/P+M17THnr4SVgqn9Rgam5k/He33MA7/D7QoJcdMxHFyX7U9imaBonAX/6qA== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.56.0" - "@typescript-eslint/type-utils" "5.56.0" - "@typescript-eslint/utils" "5.56.0" + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/type-utils" "5.57.0" + "@typescript-eslint/utils" "5.57.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1298,13 +1298,21 @@ "@typescript-eslint/types" "5.56.0" "@typescript-eslint/visitor-keys" "5.56.0" -"@typescript-eslint/type-utils@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz#e6f004a072f09c42e263dc50e98c70b41a509685" - integrity sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A== +"@typescript-eslint/scope-manager@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz#79ccd3fa7bde0758059172d44239e871e087ea36" + integrity sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw== dependencies: - "@typescript-eslint/typescript-estree" "5.56.0" - "@typescript-eslint/utils" "5.56.0" + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/visitor-keys" "5.57.0" + +"@typescript-eslint/type-utils@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.0.tgz#98e7531c4e927855d45bd362de922a619b4319f2" + integrity sha512-kxXoq9zOTbvqzLbdNKy1yFrxLC6GDJFE2Yuo3KqSwTmDOFjUGeWSakgoXT864WcK5/NAJkkONCiKb1ddsqhLXQ== + dependencies: + "@typescript-eslint/typescript-estree" "5.57.0" + "@typescript-eslint/utils" "5.57.0" debug "^4.3.4" tsutils "^3.21.0" @@ -1313,6 +1321,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.56.0.tgz#b03f0bfd6fa2afff4e67c5795930aff398cbd834" integrity sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w== +"@typescript-eslint/types@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.0.tgz#727bfa2b64c73a4376264379cf1f447998eaa132" + integrity sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ== + "@typescript-eslint/typescript-estree@5.56.0": version "5.56.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz#48342aa2344649a03321e74cab9ccecb9af086c3" @@ -1326,17 +1339,30 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.56.0.tgz#db64705409b9a15546053fb4deb2888b37df1f41" - integrity sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA== +"@typescript-eslint/typescript-estree@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz#ebcd0ee3e1d6230e888d88cddf654252d41e2e40" + integrity sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw== + dependencies: + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/visitor-keys" "5.57.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.0.tgz#eab8f6563a2ac31f60f3e7024b91bf75f43ecef6" + integrity sha512-ps/4WohXV7C+LTSgAL5CApxvxbMkl9B9AUZRtnEFonpIxZDIT7wC1xfvuJONMidrkB9scs4zhtRyIwHh4+18kw== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.56.0" - "@typescript-eslint/types" "5.56.0" - "@typescript-eslint/typescript-estree" "5.56.0" + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/typescript-estree" "5.57.0" eslint-scope "^5.1.1" semver "^7.3.7" @@ -1348,6 +1374,14 @@ "@typescript-eslint/types" "5.56.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz#e2b2f4174aff1d15eef887ce3d019ecc2d7a8ac1" + integrity sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g== + dependencies: + "@typescript-eslint/types" "5.57.0" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 32afd480e82be9f790612173b364a7373625ed25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 19:13:51 +0000 Subject: [PATCH 31/55] :arrow_up:(deps-dev): Bump @typescript-eslint/parser Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.56.0 to 5.57.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.57.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 48 +++++++----------------------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 2076134..a95f8cd 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@types/node": "^18.15.11", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.57.0", - "@typescript-eslint/parser": "^5.56.0", + "@typescript-eslint/parser": "^5.57.0", "eslint": "^8.37.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index fd9a9c3..1cd51a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1280,24 +1280,16 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.56.0.tgz#42eafb44b639ef1dbd54a3dbe628c446ca753ea6" - integrity sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg== +"@typescript-eslint/parser@^5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.0.tgz#f675bf2cd1a838949fd0de5683834417b757e4fa" + integrity sha512-orrduvpWYkgLCyAdNtR1QIWovcNZlEm6yL8nwH/eTxWLd8gsP+25pdLHYzL2QdkqrieaDwLpytHqycncv0woUQ== dependencies: - "@typescript-eslint/scope-manager" "5.56.0" - "@typescript-eslint/types" "5.56.0" - "@typescript-eslint/typescript-estree" "5.56.0" + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/typescript-estree" "5.57.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz#62b4055088903b5254fa20403010e1c16d6ab725" - integrity sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw== - dependencies: - "@typescript-eslint/types" "5.56.0" - "@typescript-eslint/visitor-keys" "5.56.0" - "@typescript-eslint/scope-manager@5.57.0": version "5.57.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz#79ccd3fa7bde0758059172d44239e871e087ea36" @@ -1316,29 +1308,11 @@ debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.56.0.tgz#b03f0bfd6fa2afff4e67c5795930aff398cbd834" - integrity sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w== - "@typescript-eslint/types@5.57.0": version "5.57.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.0.tgz#727bfa2b64c73a4376264379cf1f447998eaa132" integrity sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ== -"@typescript-eslint/typescript-estree@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz#48342aa2344649a03321e74cab9ccecb9af086c3" - integrity sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg== - dependencies: - "@typescript-eslint/types" "5.56.0" - "@typescript-eslint/visitor-keys" "5.56.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.57.0": version "5.57.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz#ebcd0ee3e1d6230e888d88cddf654252d41e2e40" @@ -1366,14 +1340,6 @@ eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.56.0": - version "5.56.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz#f19eb297d972417eb13cb69b35b3213e13cc214f" - integrity sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q== - dependencies: - "@typescript-eslint/types" "5.56.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.57.0": version "5.57.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz#e2b2f4174aff1d15eef887ce3d019ecc2d7a8ac1" From 8c5739a9e547835b238463aefd7042e97a85a212 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 29 Mar 2023 21:14:48 +0200 Subject: [PATCH 32/55] =?UTF-8?q?=F0=9F=90=9B=20Items=20in=20album=20rever?= =?UTF-8?q?sed=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/jellyfin/jellyfin.search.service.ts | 6 +++--- src/models/search/AlbumSearchHint.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index 626d73f..a5733a9 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -104,9 +104,9 @@ export class JellyfinSearchService { return []; } - return axiosResponse.data.SearchHints.map((hint) => - SearchHint.constructFromHint(hint), - ); + return [...axiosResponse.data.SearchHints] + .reverse() + .map((hint) => SearchHint.constructFromHint(hint)); } async getById( diff --git a/src/models/search/AlbumSearchHint.ts b/src/models/search/AlbumSearchHint.ts index dd4b440..c65d9bb 100644 --- a/src/models/search/AlbumSearchHint.ts +++ b/src/models/search/AlbumSearchHint.ts @@ -18,7 +18,6 @@ export class AlbumSearchHint extends SearchHint { searchService: JellyfinSearchService, ): Promise { const remoteImages = await searchService.getRemoteImageById(this.id); - const albumItems = await searchService.getAlbumItems(this.id); const tracks = await Promise.all( albumItems.map(async (x) => From fc74d1b4f374ba3e12506133a82926c2e6f0049f Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 29 Mar 2023 21:57:49 +0200 Subject: [PATCH 33/55] =?UTF-8?q?=E2=9C=A8=20Reimplement=20websocket=20con?= =?UTF-8?q?trols?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.voice.service.ts | 3 ++ .../jellyfin/jellyfin.playstate.service.ts | 19 +++++++++++ .../jellyfin/jellyfin.search.service.ts | 21 ++++++++++++ .../jellyfin/jellyfin.websocket.service.ts | 32 +++++++++++++------ src/models/shared/Playlist.ts | 2 +- src/models/shared/Track.ts | 1 + 6 files changed, 68 insertions(+), 10 deletions(-) diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index ba5775f..fe86177 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -116,6 +116,7 @@ export class DiscordVoiceService { /** * Pauses the current audio player */ + @OnEvent('internal.voice.controls.pause') pause() { this.createAndReturnOrGetAudioPlayer().pause(); this.eventEmitter.emit('playback.state.pause', true); @@ -124,6 +125,7 @@ export class DiscordVoiceService { /** * Stops the audio player */ + @OnEvent('internal.voice.controls.stop') stop(force: boolean): boolean { const stopped = this.createAndReturnOrGetAudioPlayer().stop(force); this.eventEmitter.emit('playback.state.stop'); @@ -161,6 +163,7 @@ export class DiscordVoiceService { * Checks if the current state is paused or not and toggles the states to the opposite. * @returns The new paused state - true: paused, false: unpaused */ + @OnEvent('internal.voice.controls.togglePause') togglePaused(): boolean { if (this.isPaused()) { this.unpause(); diff --git a/src/clients/jellyfin/jellyfin.playstate.service.ts b/src/clients/jellyfin/jellyfin.playstate.service.ts index e394926..2d75cd2 100644 --- a/src/clients/jellyfin/jellyfin.playstate.service.ts +++ b/src/clients/jellyfin/jellyfin.playstate.service.ts @@ -71,4 +71,23 @@ export class JellyinPlaystateService { }, }); } + + @OnEvent('playback.state.pause') + private async onPlaybackPause(paused: boolean) { + const track = this.playbackService.getPlaylistOrDefault().getActiveTrack(); + + if (!track) { + this.logger.error( + `Unable to report changed playstate to Jellyfin because no track was active`, + ); + return; + } + + this.playstateApi.reportPlaybackProgress({ + playbackProgressInfo: { + IsPaused: paused, + ItemId: track.id, + }, + }); + } } diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index a5733a9..ffe755e 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -130,6 +130,27 @@ export class JellyfinSearchService { return this.transformToSearchHint(data.Items[0]); } + async getAllById( + ids: string[], + includeItemTypes: BaseItemKind[] = [BaseItemKind.Audio], + ): Promise | undefined { + const api = this.jellyfinService.getApi(); + + const searchApi = getItemsApi(api); + const { data } = await searchApi.getItems({ + ids: ids, + userId: this.jellyfinService.getUserId(), + includeItemTypes: includeItemTypes, + }); + + if (data.Items.length !== 1) { + this.logger.warn(`Failed to retrieve item via id '${ids}'`); + return null; + } + + return data.Items.map((item) => this.transformToSearchHint(item)); + } + async getRemoteImageById(id: string, limit = 20): Promise { const api = this.jellyfinService.getApi(); const remoteImageApi = getRemoteImageApi(api); diff --git a/src/clients/jellyfin/jellyfin.websocket.service.ts b/src/clients/jellyfin/jellyfin.websocket.service.ts index 21bb8d6..4d22d37 100644 --- a/src/clients/jellyfin/jellyfin.websocket.service.ts +++ b/src/clients/jellyfin/jellyfin.websocket.service.ts @@ -1,11 +1,13 @@ import { PlaystateCommand, SessionMessageType, + UserItemDataDto, } from '@jellyfin/sdk/lib/generated-client/models'; import { Injectable, Logger, OnModuleDestroy } from '@nestjs/common'; -import { Cron } from '@nestjs/schedule'; import { EventEmitter2 } from '@nestjs/event-emitter'; +import { Cron } from '@nestjs/schedule'; +import { Session } from 'inspector'; import { WebSocket } from 'ws'; @@ -14,11 +16,9 @@ import { PlayNowCommand, SessionApiSendPlaystateCommandRequest, } from '../../types/websocket'; -import { Track } from '../../models/shared/Track'; import { JellyfinSearchService } from './jellyfin.search.service'; import { JellyfinService } from './jellyfin.service'; -import { JellyfinStreamBuilderService } from './jellyfin.stream.builder.service'; @Injectable() export class JellyfinWebSocketService implements OnModuleDestroy { @@ -28,9 +28,8 @@ export class JellyfinWebSocketService implements OnModuleDestroy { constructor( private readonly jellyfinService: JellyfinService, - private readonly jellyfinSearchService: JellyfinSearchService, private readonly playbackService: PlaybackService, - private readonly jellyfinStreamBuilderService: JellyfinStreamBuilderService, + private readonly jellyfinSearchService: JellyfinSearchService, private readonly eventEmitter: EventEmitter2, ) {} @@ -103,14 +102,29 @@ export class JellyfinWebSocketService implements OnModuleDestroy { data.hasSelection = PlayNowCommand.prototype.hasSelection; data.getSelection = PlayNowCommand.prototype.getSelection; const ids = data.getSelection(); + this.logger.log( + `Processing ${ids.length} ids received via websocket and adding them to the queue`, + ); + const searchHints = await this.jellyfinSearchService.getAllById(ids); - // TODO: Implement this again + const tracks = await Promise.all( + searchHints.map(async (x) => + ( + await x.toTracks(this.jellyfinSearchService) + ).find((x) => x !== null), + ), + ); + + this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); break; case SessionMessageType[SessionMessageType.Playstate]: const sendPlaystateCommandRequest = msg.Data as SessionApiSendPlaystateCommandRequest; this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest); break; + case SessionMessageType[SessionMessageType.UserDataChanged]: + this.logger.debug(`Received update for user session data`); + break; default: this.logger.warn( `Received a package from the socket of unknown type: ${msg.MessageType}`, @@ -124,13 +138,13 @@ export class JellyfinWebSocketService implements OnModuleDestroy { ) { switch (request.Command) { case PlaystateCommand.PlayPause: - this.eventEmitter.emitAsync('playback.control.togglePause'); + this.eventEmitter.emitAsync('internal.voice.controls.togglePause'); break; case PlaystateCommand.Pause: - this.eventEmitter.emitAsync('playback.control.pause'); + this.eventEmitter.emitAsync('internal.voice.controls.pause'); break; case PlaystateCommand.Stop: - this.eventEmitter.emitAsync('playback.control.stop'); + this.eventEmitter.emitAsync('internal.voice.controls.stop'); break; default: this.logger.warn( diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index 76cfbab..c16a5b5 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -1,4 +1,4 @@ -import { EventEmitter2 } from '@nestjs/event-emitter'; +import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; import { Track } from './Track'; diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index 1965890..0e7cb2d 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -39,6 +39,7 @@ export class Track { this.name = name; this.duration = duration; this.remoteImages = remoteImages; + this.playing = false; } getDuration() { From 7b9a33419bbe2a17ba2e8c7342bf28da4fa8609c Mon Sep 17 00:00:00 2001 From: "deepsource-io[bot]" <42547082+deepsource-io[bot]@users.noreply.github.com> Date: Fri, 31 Mar 2023 21:21:30 +0000 Subject: [PATCH 34/55] ci: Add .deepsource.toml --- .deepsource.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..2dfc466 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,13 @@ +version = 1 + +[[analyzers]] +name = "javascript" + + [analyzers.meta] + plugins = ["react"] + +[[analyzers]] +name = "docker" + +[[analyzers]] +name = "test-coverage" \ No newline at end of file From 621f3c5118a1771f4d4d3bff1cfca050086eaaff Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 29 Mar 2023 21:58:49 +0200 Subject: [PATCH 35/55] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Strict=20Typescript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.config.service.ts | 2 +- src/clients/discord/discord.voice.service.ts | 31 +++++++- .../jellyfin/jellyfin.search.service.ts | 74 +++++++++++++++---- src/clients/jellyfin/jellyfin.service.ts | 11 ++- .../jellyfin/jellyfin.websocket.service.ts | 13 +--- src/commands/play/play.comands.ts | 20 +++-- .../playlist.interaction-collector.ts | 7 +- src/commands/status.command.ts | 2 +- src/main.ts | 4 + src/models/search/AlbumSearchHint.ts | 8 +- src/models/search/PlaylistSearchHint.ts | 12 ++- src/models/search/SearchHint.ts | 10 +++ src/models/shared/Playlist.ts | 24 ++++-- src/models/shared/Track.ts | 2 +- src/types/websocket.ts | 2 +- src/updates/updates.service.ts | 14 +++- src/utils/trackConverter.ts | 15 ++++ tsconfig.json | 2 +- 18 files changed, 194 insertions(+), 59 deletions(-) create mode 100644 src/utils/trackConverter.ts diff --git a/src/clients/discord/discord.config.service.ts b/src/clients/discord/discord.config.service.ts index 870d5ee..b73cf52 100644 --- a/src/clients/discord/discord.config.service.ts +++ b/src/clients/discord/discord.config.service.ts @@ -9,7 +9,7 @@ import { GatewayIntentBits } from 'discord.js'; export class DiscordConfigService implements DiscordOptionsFactory { createDiscordOptions(): DiscordModuleOption { return { - token: process.env.DISCORD_CLIENT_TOKEN, + token: process.env.DISCORD_CLIENT_TOKEN ?? '', discordClientOptions: { intents: [ GatewayIntentBits.Guilds, diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index fe86177..5b59abc 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -104,6 +104,10 @@ export class DiscordVoiceService { } changeVolume(volume: number) { + if (!this.audioResource || !this.audioResource.volume) { + this.logger.error(`AudioResource or volume was undefined`); + return; + } this.audioResource.volume.setVolume(volume); } @@ -236,6 +240,20 @@ export class DiscordVoiceService { } private attachEventListenersToAudioPlayer() { + if (!this.voiceConnection) { + this.logger.error( + `Unable to attach listener events, because the VoiceConnection was undefined`, + ); + return; + } + + if (!this.audioPlayer) { + this.logger.error( + `Unable to attach listener events, because the AudioPlayer was undefined`, + ); + return; + } + this.voiceConnection.on('debug', (message) => { if (process.env.DEBUG?.toLowerCase() !== 'true') { return; @@ -253,6 +271,13 @@ export class DiscordVoiceService { this.logger.error(message); }); this.audioPlayer.on('stateChange', (previousState) => { + if (!this.audioPlayer) { + this.logger.error( + `Unable to process state change from audio player, because the current audio player in the callback was undefined`, + ); + return; + } + this.logger.debug( `Audio player changed state from ${previousState.status} to ${this.audioPlayer.state.status}`, ); @@ -269,9 +294,11 @@ export class DiscordVoiceService { const playlist = this.playbackService.getPlaylistOrDefault(); const finishedTrack = playlist.getActiveTrack(); - finishedTrack.playing = false; - this.eventEmitter.emit('internal.audio.track.finish', finishedTrack); + if (finishedTrack) { + finishedTrack.playing = false; + this.eventEmitter.emit('internal.audio.track.finish', finishedTrack); + } const hasNextTrack = playlist.hasNextTrackInPlaylist(); diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index ffe755e..0aefa99 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -1,4 +1,5 @@ import { + BaseItemDto, BaseItemKind, RemoteImageResult, SearchHint as JellyfinSearchHint, @@ -57,9 +58,13 @@ export class JellyfinSearchService { const { SearchHints } = data; - return SearchHints.map((hint) => this.transformToSearchHint(hint)).filter( - (x) => x !== null, - ); + if (!SearchHints) { + throw new Error('SearchHints were undefined'); + } + + return SearchHints.map((hint) => + this.transformToSearchHintFromHint(hint), + ).filter((x) => x !== null) as SearchHint[]; } catch (err) { this.logger.error(`Failed to search on Jellyfin: ${err}`); return []; @@ -82,8 +87,15 @@ export class JellyfinSearchService { return []; } + if (!axiosResponse.data.Items) { + this.logger.error( + `Jellyfin search returned no items: ${axiosResponse.data}`, + ); + return []; + } + return axiosResponse.data.Items.map((hint) => - SearchHint.constructFromHint(hint), + SearchHint.constructFromBaseItem(hint), ); } @@ -104,6 +116,13 @@ export class JellyfinSearchService { return []; } + if (!axiosResponse.data.SearchHints) { + this.logger.error( + `Received an unexpected empty list but expected a list of tracks of the album`, + ); + return []; + } + return [...axiosResponse.data.SearchHints] .reverse() .map((hint) => SearchHint.constructFromHint(hint)); @@ -112,7 +131,7 @@ export class JellyfinSearchService { async getById( id: string, includeItemTypes: BaseItemKind[], - ): Promise | undefined { + ): Promise { const api = this.jellyfinService.getApi(); const searchApi = getItemsApi(api); @@ -122,18 +141,18 @@ export class JellyfinSearchService { includeItemTypes: includeItemTypes, }); - if (data.Items.length !== 1) { + if (!data.Items || data.Items.length !== 1) { this.logger.warn(`Failed to retrieve item via id '${id}'`); - return null; + return undefined; } - return this.transformToSearchHint(data.Items[0]); + return this.transformToSearchHintFromBaseItemDto(data.Items[0]); } async getAllById( ids: string[], includeItemTypes: BaseItemKind[] = [BaseItemKind.Audio], - ): Promise | undefined { + ): Promise { const api = this.jellyfinService.getApi(); const searchApi = getItemsApi(api); @@ -143,12 +162,14 @@ export class JellyfinSearchService { includeItemTypes: includeItemTypes, }); - if (data.Items.length !== 1) { + if (!data.Items || data.Items.length !== 1) { this.logger.warn(`Failed to retrieve item via id '${ids}'`); - return null; + return []; } - return data.Items.map((item) => this.transformToSearchHint(item)); + return data.Items.map((item) => + this.transformToSearchHintFromBaseItemDto(item), + ).filter((searchHint) => searchHint !== undefined) as SearchHint[]; } async getRemoteImageById(id: string, limit = 20): Promise { @@ -204,18 +225,25 @@ export class JellyfinSearchService { recursive: true, }); + if (!response.data.Items) { + this.logger.error( + `Received empty list of items but expected a random list of tracks`, + ); + return []; + } + return response.data.Items.map((item) => { return SearchHint.constructFromBaseItem(item); }); } catch (err) { this.logger.error( - `Unabele to retrieve random items from Jellyfin: ${err}`, + `Unable to retrieve random items from Jellyfin: ${err}`, ); return []; } } - private transformToSearchHint(jellyifnHint: JellyfinSearchHint) { + private transformToSearchHintFromHint(jellyifnHint: JellyfinSearchHint) { switch (jellyifnHint.Type) { case BaseItemKind[BaseItemKind.Audio]: return SearchHint.constructFromHint(jellyifnHint); @@ -227,7 +255,23 @@ export class JellyfinSearchService { this.logger.warn( `Received unexpected item type from Jellyfin search: ${jellyifnHint.Type}`, ); - return null; + return undefined; + } + } + + private transformToSearchHintFromBaseItemDto(baseItemDto: BaseItemDto) { + switch (baseItemDto.Type) { + case BaseItemKind[BaseItemKind.Audio]: + return SearchHint.constructFromBaseItem(baseItemDto); + case BaseItemKind[BaseItemKind.MusicAlbum]: + return AlbumSearchHint.constructFromBaseItem(baseItemDto); + case BaseItemKind[BaseItemKind.Playlist]: + return PlaylistSearchHint.constructFromBaseItem(baseItemDto); + default: + this.logger.warn( + `Received unexpected item type from Jellyfin search: ${baseItemDto.Type}`, + ); + return undefined; } } } diff --git a/src/clients/jellyfin/jellyfin.service.ts b/src/clients/jellyfin/jellyfin.service.ts index 3051f12..83d173d 100644 --- a/src/clients/jellyfin/jellyfin.service.ts +++ b/src/clients/jellyfin/jellyfin.service.ts @@ -33,18 +33,23 @@ export class JellyfinService { }, }); - this.api = this.jellyfin.createApi(process.env.JELLYFIN_SERVER_ADDRESS); + this.api = this.jellyfin.createApi( + process.env.JELLYFIN_SERVER_ADDRESS ?? '', + ); this.logger.debug('Created Jellyfin Client and Api'); } authenticate() { this.api .authenticateUserByName( - process.env.JELLYFIN_AUTHENTICATION_USERNAME, + process.env.JELLYFIN_AUTHENTICATION_USERNAME ?? '', process.env.JELLYFIN_AUTHENTICATION_PASSWORD, ) .then(async (response) => { - if (response.data.SessionInfo === undefined) { + if ( + response.data.SessionInfo === undefined || + response.data.SessionInfo.UserId === undefined + ) { this.logger.error( `Failed to authenticate with response code ${response.status}: '${response.data}'`, ); diff --git a/src/clients/jellyfin/jellyfin.websocket.service.ts b/src/clients/jellyfin/jellyfin.websocket.service.ts index 4d22d37..277eb9e 100644 --- a/src/clients/jellyfin/jellyfin.websocket.service.ts +++ b/src/clients/jellyfin/jellyfin.websocket.service.ts @@ -1,13 +1,12 @@ import { PlaystateCommand, SessionMessageType, - UserItemDataDto, } from '@jellyfin/sdk/lib/generated-client/models'; import { Injectable, Logger, OnModuleDestroy } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { Cron } from '@nestjs/schedule'; -import { Session } from 'inspector'; +import { convertToTracks } from 'src/utils/trackConverter'; import { WebSocket } from 'ws'; @@ -106,15 +105,7 @@ export class JellyfinWebSocketService implements OnModuleDestroy { `Processing ${ids.length} ids received via websocket and adding them to the queue`, ); const searchHints = await this.jellyfinSearchService.getAllById(ids); - - const tracks = await Promise.all( - searchHints.map(async (x) => - ( - await x.toTracks(this.jellyfinSearchService) - ).find((x) => x !== null), - ), - ); - + const tracks = convertToTracks(searchHints, this.jellyfinSearchService); this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); break; case SessionMessageType[SessionMessageType.Playstate]: diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 0e72eb4..a82ab47 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -48,12 +48,12 @@ export class PlayItemCommand { async handler( @InteractionEvent(SlashCommandPipe) dto: PlayCommandParams, @IA() interaction: CommandInteraction, - ): Promise { + ) { await interaction.deferReply({ ephemeral: true }); const baseItems = PlayCommandParams.getBaseItemKinds(dto.type); - let item: SearchHint; + let item: SearchHint | undefined; if (dto.name.startsWith('native-')) { item = await this.jellyfinSearchService.getById( dto.name.replace('native-', ''), @@ -105,8 +105,8 @@ export class PlayItemCommand { this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); const remoteImage: RemoteImageInfo | undefined = tracks - .flatMap((x) => x.getRemoteImages()) - .find((x) => true); + .flatMap((track) => track.getRemoteImages()) + .find(() => true); await interaction.followUp({ embeds: [ @@ -120,7 +120,7 @@ export class PlayItemCommand { if (!remoteImage) { return embedBuilder; } - return embedBuilder.setThumbnail(remoteImage.Url); + return embedBuilder.setThumbnail(remoteImage.Url ?? ''); }, }), ], @@ -135,7 +135,15 @@ export class PlayItemCommand { } const focusedAutoCompleteAction = interaction.options.getFocused(true); - const typeIndex: number | null = interaction.options.getInteger('type'); + const typeIndex = interaction.options.getInteger('type'); + + if (typeIndex === null) { + this.logger.error( + `Failed to get type integer from play command interaction autocomplete`, + ); + return; + } + const type = Object.values(SearchType)[typeIndex] as SearchType; const searchQuery = focusedAutoCompleteAction.value; diff --git a/src/commands/playlist/playlist.interaction-collector.ts b/src/commands/playlist/playlist.interaction-collector.ts index 462ad16..f308cfb 100644 --- a/src/commands/playlist/playlist.interaction-collector.ts +++ b/src/commands/playlist/playlist.interaction-collector.ts @@ -30,7 +30,10 @@ export class PlaylistInteractionCollector { @Filter() filter(interaction: ButtonInteraction): boolean { - return this.causeInteraction.id === interaction.message.interaction.id; + return ( + interaction.message.interaction !== null && + this.causeInteraction.id === interaction.message.interaction.id + ); } @On('collect') @@ -55,7 +58,7 @@ export class PlaylistInteractionCollector { await interaction.update(reply as InteractionUpdateOptions); } - private getInteraction(interaction: ButtonInteraction): number | null { + private getInteraction(interaction: ButtonInteraction): number | undefined { const current = this.playlistCommand.pageData.get(this.causeInteraction.id); if (current === undefined) { diff --git a/src/commands/status.command.ts b/src/commands/status.command.ts index a868546..5412dc2 100644 --- a/src/commands/status.command.ts +++ b/src/commands/status.command.ts @@ -39,7 +39,7 @@ export class StatusCommand { const status = Status[this.client.ws.status]; const interval = intervalToDuration({ - start: this.client.uptime, + start: this.client.uptime ?? 0, end: 0, }); const formattedDuration = formatDuration(interval); diff --git a/src/main.ts b/src/main.ts index 088755b..4fc280c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,10 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; function getLoggingLevels(): LogLevel[] { + if (!process.env.LOG_LEVEL) { + return ['error', 'warn', 'log']; + } + switch (process.env.LOG_LEVEL.toLowerCase()) { case 'error': return ['error']; diff --git a/src/models/search/AlbumSearchHint.ts b/src/models/search/AlbumSearchHint.ts index c65d9bb..b51a57e 100644 --- a/src/models/search/AlbumSearchHint.ts +++ b/src/models/search/AlbumSearchHint.ts @@ -11,6 +11,12 @@ export class AlbumSearchHint extends SearchHint { } static constructFromHint(hint: JellyfinSearchHint) { + if (hint.Id === undefined || !hint.Name || !hint.RunTimeTicks) { + throw new Error( + 'Unable to construct playlist search hint, required properties were undefined', + ); + } + return new AlbumSearchHint(hint.Id, hint.Name, hint.RunTimeTicks / 10000); } @@ -24,7 +30,7 @@ export class AlbumSearchHint extends SearchHint { (await x.toTracks(searchService)).find((x) => x !== null), ), ); - return tracks.map((track): Track => { + return tracks.map((track: Track): Track => { track.remoteImages = remoteImages; return track; }); diff --git a/src/models/search/PlaylistSearchHint.ts b/src/models/search/PlaylistSearchHint.ts index dd308c4..b1099f9 100644 --- a/src/models/search/PlaylistSearchHint.ts +++ b/src/models/search/PlaylistSearchHint.ts @@ -4,6 +4,7 @@ import { Track } from '../shared/Track'; import { JellyfinSearchService } from '../../clients/jellyfin/jellyfin.search.service'; import { SearchHint } from './SearchHint'; +import { convertToTracks } from 'src/utils/trackConverter'; export class PlaylistSearchHint extends SearchHint { override toString(): string { @@ -11,6 +12,12 @@ export class PlaylistSearchHint extends SearchHint { } static constructFromHint(hint: JellyfinSearchHint) { + if (hint.Id === undefined || !hint.Name || !hint.RunTimeTicks) { + throw new Error( + 'Unable to construct playlist search hint, required properties were undefined', + ); + } + return new PlaylistSearchHint( hint.Id, hint.Name, @@ -22,9 +29,6 @@ export class PlaylistSearchHint extends SearchHint { searchService: JellyfinSearchService, ): Promise { const playlistItems = await searchService.getPlaylistitems(this.id); - const tracks = playlistItems.map(async (x) => - (await x.toTracks(searchService)).find((x) => x !== null), - ); - return await Promise.all(tracks); + return convertToTracks(playlistItems, searchService); } } diff --git a/src/models/search/SearchHint.ts b/src/models/search/SearchHint.ts index 016acc4..b1355bd 100644 --- a/src/models/search/SearchHint.ts +++ b/src/models/search/SearchHint.ts @@ -26,10 +26,20 @@ export class SearchHint { } static constructFromHint(hint: JellyfinSearchHint) { + if (hint.Id === undefined || !hint.Name || !hint.RunTimeTicks) { + throw new Error( + 'Unable to construct search hint, required properties were undefined', + ); + } return new SearchHint(hint.Id, hint.Name, hint.RunTimeTicks / 10000); } static constructFromBaseItem(baseItem: BaseItemDto) { + if (baseItem.Id === undefined || !baseItem.Name || !baseItem.RunTimeTicks) { + throw new Error( + 'Unable to construct search hint from base item, required properties were undefined', + ); + } return new SearchHint( baseItem.Id, baseItem.Name, diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index c16a5b5..d6a4ede 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -1,4 +1,4 @@ -import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; +import { EventEmitter2 } from '@nestjs/event-emitter'; import { Track } from './Track'; @@ -24,7 +24,7 @@ export class Playlist { * @returns active track or undefined if there's none */ getActiveTrack(): Track | undefined { - if (this.isActiveTrackOutOfSync()) { + if (this.isActiveTrackOutOfSync() || this.activeTrackIndex === undefined) { return undefined; } return this.tracks[this.activeTrackIndex]; @@ -51,7 +51,10 @@ export class Playlist { setNextTrackAsActiveTrack(): boolean { this.announceTrackFinishIfSet(); - if (this.activeTrackIndex >= this.tracks.length) { + if ( + this.activeTrackIndex === undefined || + this.activeTrackIndex >= this.tracks.length + ) { return false; } @@ -70,7 +73,7 @@ export class Playlist { setPreviousTrackAsActiveTrack(): boolean { this.announceTrackFinishIfSet(); - if (this.activeTrackIndex <= 0) { + if (this.activeTrackIndex === undefined || this.activeTrackIndex <= 0) { return false; } @@ -120,7 +123,7 @@ export class Playlist { * @returns if there is a track next in the playlist */ hasNextTrackInPlaylist() { - return this.activeTrackIndex + 1 < this.tracks.length; + return (this.activeTrackIndex ?? 0) + 1 < this.tracks.length; } /** @@ -128,7 +131,7 @@ export class Playlist { * @returns if there is a previous track in the playlist */ hasPreviousTrackInPlaylist() { - return this.activeTrackIndex > 0; + return this.activeTrackIndex !== undefined && this.activeTrackIndex > 0; } clear() { @@ -156,13 +159,20 @@ export class Playlist { } const activeTrack = this.getActiveTrack(); + + if (!activeTrack) { + return; + } + activeTrack.playing = true; this.eventEmitter.emit('internal.audio.track.announce', activeTrack); } private isActiveTrackOutOfSync(): boolean { return ( - this.activeTrackIndex < 0 || this.activeTrackIndex >= this.tracks.length + this.activeTrackIndex === undefined || + this.activeTrackIndex < 0 || + this.activeTrackIndex >= this.tracks.length ); } } diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index 0e7cb2d..0168f61 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -51,6 +51,6 @@ export class Track { } getRemoteImages(): RemoteImageInfo[] { - return this.remoteImages.Images; + return this.remoteImages?.Images ?? []; } } diff --git a/src/types/websocket.ts b/src/types/websocket.ts index ee4aa8f..43c4edf 100644 --- a/src/types/websocket.ts +++ b/src/types/websocket.ts @@ -30,7 +30,7 @@ export class PlayNowCommand { } getSelection(): string[] { - if (this.hasSelection()) { + if (this.hasSelection() && this.StartIndex !== undefined) { return [this.ItemIds[this.StartIndex]]; } diff --git a/src/updates/updates.service.ts b/src/updates/updates.service.ts index cdc3a88..6c90b3e 100644 --- a/src/updates/updates.service.ts +++ b/src/updates/updates.service.ts @@ -30,6 +30,14 @@ export class UpdatesService { this.logger.debug('Checking for available updates...'); const latestGitHubRelease = await this.fetchLatestGithubRelease(); + + if (!latestGitHubRelease) { + this.logger.warn( + `Aborting update check because api request failed. Please check your internet connection or disable the check`, + ); + return; + } + const currentVersion = Constants.Metadata.Version.All(); if (latestGitHubRelease.tag_name <= currentVersion) { @@ -95,21 +103,21 @@ export class UpdatesService { }); } - private async fetchLatestGithubRelease(): Promise { + private async fetchLatestGithubRelease(): Promise { return axios({ method: 'GET', url: Constants.Links.Api.GetLatestRelease, }) .then((response) => { if (response.status !== 200) { - return null; + return undefined; } return response.data as GithubRelease; }) .catch((err) => { this.logger.error('Error while checking for updates', err); - return null; + return undefined; }); } } diff --git a/src/utils/trackConverter.ts b/src/utils/trackConverter.ts new file mode 100644 index 0000000..4754a96 --- /dev/null +++ b/src/utils/trackConverter.ts @@ -0,0 +1,15 @@ +import { JellyfinSearchService } from 'src/clients/jellyfin/jellyfin.search.service'; +import { SearchHint } from 'src/models/search/SearchHint'; +import { Track } from 'src/models/shared/Track'; + +export const convertToTracks = ( + hints: SearchHint[], + jellyfinSearchService: JellyfinSearchService, +): Track[] => { + let tracks: Track[] = []; + hints.forEach(async (hint) => { + const searchedTracks = await hint.toTracks(jellyfinSearchService); + tracks = [...tracks, ...searchedTracks]; + }); + return tracks; +}; diff --git a/tsconfig.json b/tsconfig.json index efc026f..1e9efef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "baseUrl": "./", "incremental": true, "skipLibCheck": true, - "strictNullChecks": false, + "strictNullChecks": true, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, From affe51bddb0a95010a052fcd7ceb0e0f594e7356 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 31 Mar 2023 23:50:47 +0200 Subject: [PATCH 36/55] =?UTF-8?q?=F0=9F=91=B7=20Remove=20Sonarcloud=20from?= =?UTF-8?q?=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .deepsource.toml | 5 +- .github/workflows/sonarcloud.yml | 85 -------------------------------- 2 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 .github/workflows/sonarcloud.yml diff --git a/.deepsource.toml b/.deepsource.toml index 2dfc466..2ebcef1 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -7,7 +7,4 @@ name = "javascript" plugins = ["react"] [[analyzers]] -name = "docker" - -[[analyzers]] -name = "test-coverage" \ No newline at end of file +name = "docker" \ No newline at end of file diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index efaed3a..0000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,85 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow helps you trigger a SonarCloud analysis of your code and populates -# GitHub Code Scanning alerts with the vulnerabilities found. -# Free for open source project. - -# 1. Login to SonarCloud.io using your GitHub account - -# 2. Import your project on SonarCloud -# * Add your GitHub organization first, then add your repository as a new project. -# * Please note that many languages are eligible for automatic analysis, -# which means that the analysis will start automatically without the need to set up GitHub Actions. -# * This behavior can be changed in Administration > Analysis Method. -# -# 3. Follow the SonarCloud in-product tutorial -# * a. Copy/paste the Project Key and the Organization Key into the args parameter below -# (You'll find this information in SonarCloud. Click on "Information" at the bottom left) -# -# * b. Generate a new token and add it to your Github repository's secrets using the name SONAR_TOKEN -# (On SonarCloud, click on your avatar on top-right > My account > Security -# or go directly to https://sonarcloud.io/account/security/) - -# Feel free to take a look at our documentation (https://docs.sonarcloud.io/getting-started/github/) -# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/help/sc/9) - -name: SonarCloud analysis - -on: - push: - branches: [ "master", "dev" ] - pull_request: - branches: [ "master", "dev" ] - workflow_dispatch: - -permissions: - pull-requests: read # allows SonarCloud to decorate PRs with analysis results - -jobs: - Analysis: - runs-on: ubuntu-latest - - steps: - - name: Setup - uses: actions/setup-node@v3 - - name: Checkout - uses: actions/checkout@v3 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install --immutable - - run: yarn test:cov - - name: Analyze with SonarCloud - - # You can pin the exact commit or the version. - # uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 - uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) - with: - # Additional arguments for the sonarcloud scanner - args: - # Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu) - # mandatory - -Dsonar.projectKey=manuel-rw_jellyfin-discord-music-bot - -Dsonar.organization=manuel-rw - -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info - # Comma-separated paths to directories containing main source files. - #-Dsonar.sources= # optional, default is project base directory - # When you need the analysis to take place in a directory other than the one from which it was launched - #-Dsonar.projectBaseDir= # optional, default is . - # Comma-separated paths to directories containing test source files. - #-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/ - # Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing. - #-Dsonar.verbose= # optional, default is false From 23fbfdc6bee4f7cd6d6a1197f002ab8aa6502602 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 1 Apr 2023 12:21:37 +0200 Subject: [PATCH 37/55] =?UTF-8?q?=F0=9F=91=B7=20Add=20test=20coverage=20fo?= =?UTF-8?q?r=20deepsource?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .deepsource.toml | 6 ++- .github/workflows/deepsource-tests.yml | 58 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deepsource-tests.yml diff --git a/.deepsource.toml b/.deepsource.toml index 2ebcef1..0c1cb01 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -7,4 +7,8 @@ name = "javascript" plugins = ["react"] [[analyzers]] -name = "docker" \ No newline at end of file +name = "docker" + +[[analyzers]] +name = "test-coverage" +enabled = true \ No newline at end of file diff --git a/.github/workflows/deepsource-tests.yml b/.github/workflows/deepsource-tests.yml new file mode 100644 index 0000000..703f3fa --- /dev/null +++ b/.github/workflows/deepsource-tests.yml @@ -0,0 +1,58 @@ +name: Deepsource report test coverage +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +on: + push: + branches: [dev,master] + paths-ignore: + - '.github/**' + - 'images/' + - '*.md' + pull_request: + branches: + - master + - dev + + workflow_dispatch: + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + report-test-coverage: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Setup + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - run: yarn install --immutable + - run: yarn test:cov + - run: curl https://deepsource.io/cli | sh + - name: Report test-coverage to DeepSource + run: | + # Install the CLI + curl https://deepsource.io/cli | sh + + # Send the report to DeepSource + ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/clover.xml + env: + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} \ No newline at end of file From 7cb730186db7ac7dca9d78e76b6f0a1df77d688a Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 1 Apr 2023 12:56:06 +0200 Subject: [PATCH 38/55] =?UTF-8?q?=F0=9F=93=9D=20Add=20deepsource=20badge?= =?UTF-8?q?=20in=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a6316aa..2a04b8b 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@

+


From 41c98a3c9c7ae125a56bbf4f70bec94e4c39a762 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 1 Apr 2023 13:02:59 +0200 Subject: [PATCH 39/55] =?UTF-8?q?=F0=9F=91=B7=20Fix=20coverage=20file=20fo?= =?UTF-8?q?r=20deepsource?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deepsource-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deepsource-tests.yml b/.github/workflows/deepsource-tests.yml index 703f3fa..7b8b523 100644 --- a/.github/workflows/deepsource-tests.yml +++ b/.github/workflows/deepsource-tests.yml @@ -53,6 +53,6 @@ jobs: curl https://deepsource.io/cli | sh # Send the report to DeepSource - ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/clover.xml + ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/lcov.info env: DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} \ No newline at end of file From f033790420607df2ecc66560388f4c452adf024f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 11:22:32 +0000 Subject: [PATCH 40/55] refactor: Replace template strings with regular string literals Template literals are useful when you need: 1. [Interpolated strings](https://en.wikipedia.org/wiki/String_interpolation). --- src/clients/discord/discord.voice.service.ts | 6 +++--- src/clients/jellyfin/jellyfin.playstate.service.ts | 4 ++-- src/clients/jellyfin/jellyfin.search.service.ts | 2 +- src/clients/jellyfin/jellyfin.websocket.service.ts | 2 +- src/commands/play/play.comands.ts | 2 +- src/commands/playlist/playlist.interaction-collector.ts | 2 +- src/commands/volume/volume.command.ts | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index fe86177..56bef4a 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -219,7 +219,7 @@ export class DiscordVoiceService { if (this.audioPlayer === undefined) { this.logger.debug( - `Initialized new instance of AudioPlayer because it has not been defined yet`, + "Initialized new instance of AudioPlayer because it has not been defined yet", ); this.audioPlayer = createAudioPlayer({ debug: process.env.DEBUG?.toLowerCase() === 'true', @@ -265,7 +265,7 @@ export class DiscordVoiceService { return; } - this.logger.debug(`Audio player finished playing old resource`); + this.logger.debug("Audio player finished playing old resource"); const playlist = this.playbackService.getPlaylistOrDefault(); const finishedTrack = playlist.getActiveTrack(); @@ -280,7 +280,7 @@ export class DiscordVoiceService { ); if (!hasNextTrack) { - this.logger.debug(`Reached the end of the playlist`); + this.logger.debug("Reached the end of the playlist"); return; } diff --git a/src/clients/jellyfin/jellyfin.playstate.service.ts b/src/clients/jellyfin/jellyfin.playstate.service.ts index 2d75cd2..465322c 100644 --- a/src/clients/jellyfin/jellyfin.playstate.service.ts +++ b/src/clients/jellyfin/jellyfin.playstate.service.ts @@ -60,7 +60,7 @@ export class JellyinPlaystateService { private async onPlaybackFinished(track: Track) { if (!track) { this.logger.error( - `Unable to report playback because finished track was undefined`, + "Unable to report playback because finished track was undefined", ); return; } @@ -78,7 +78,7 @@ export class JellyinPlaystateService { if (!track) { this.logger.error( - `Unable to report changed playstate to Jellyfin because no track was active`, + "Unable to report changed playstate to Jellyfin because no track was active", ); return; } diff --git a/src/clients/jellyfin/jellyfin.search.service.ts b/src/clients/jellyfin/jellyfin.search.service.ts index ffe755e..0a4b62f 100644 --- a/src/clients/jellyfin/jellyfin.search.service.ts +++ b/src/clients/jellyfin/jellyfin.search.service.ts @@ -37,7 +37,7 @@ export class JellyfinSearchService { if (includeItemTypes.length === 0) { this.logger.warn( - `Included item types are empty. This may lead to unwanted results`, + "Included item types are empty. This may lead to unwanted results", ); } diff --git a/src/clients/jellyfin/jellyfin.websocket.service.ts b/src/clients/jellyfin/jellyfin.websocket.service.ts index 4d22d37..49ff445 100644 --- a/src/clients/jellyfin/jellyfin.websocket.service.ts +++ b/src/clients/jellyfin/jellyfin.websocket.service.ts @@ -123,7 +123,7 @@ export class JellyfinWebSocketService implements OnModuleDestroy { this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest); break; case SessionMessageType[SessionMessageType.UserDataChanged]: - this.logger.debug(`Received update for user session data`); + this.logger.debug("Received update for user session data"); break; default: this.logger.warn( diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 0e72eb4..85ab999 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -70,7 +70,7 @@ export class PlayItemCommand { embeds: [ this.discordMessageService.buildMessage({ title: 'No results found', - description: `- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters`, + description: "- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters", }), ], ephemeral: true, diff --git a/src/commands/playlist/playlist.interaction-collector.ts b/src/commands/playlist/playlist.interaction-collector.ts index 462ad16..75ba468 100644 --- a/src/commands/playlist/playlist.interaction-collector.ts +++ b/src/commands/playlist/playlist.interaction-collector.ts @@ -80,7 +80,7 @@ export class PlaylistInteractionCollector { return current - 1; default: this.logger.error( - `Unable to map button interaction from collector to target page`, + "Unable to map button interaction from collector to target page", ); return undefined; } diff --git a/src/commands/volume/volume.command.ts b/src/commands/volume/volume.command.ts index 3bbe4ab..a777d9c 100644 --- a/src/commands/volume/volume.command.ts +++ b/src/commands/volume/volume.command.ts @@ -36,7 +36,7 @@ export class VolumeCommand { await interaction.editReply({ embeds: [ this.discordMessageService.buildMessage({ - title: `Unable to change your volume`, + title: "Unable to change your volume", description: 'The bot is not playing any music or is not straming to a channel', }), From 128cf2fd3d7384faa155f5fee166ca6054daccca Mon Sep 17 00:00:00 2001 From: Manuel Date: Sat, 1 Apr 2023 13:27:02 +0200 Subject: [PATCH 41/55] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20deepsource=20warning?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clients/discord/discord.voice.service.ts | 9 ++++----- src/clients/jellyfin/jellyfin.websocket.service.ts | 2 -- src/commands/play/play.comands.ts | 10 +++++----- src/models/shared/Playlist.ts | 2 +- src/updates/updates.service.spec.ts | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index 56bef4a..870dfb4 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -9,7 +9,6 @@ import { joinVoiceChannel, NoSubscriberBehavior, VoiceConnection, - VoiceConnectionStatus, } from '@discordjs/voice'; import { Injectable } from '@nestjs/common'; @@ -18,11 +17,11 @@ import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; import { GuildMember } from 'discord.js'; +import { GenericTryHandler } from '../../models/generic-try-handler'; +import { Track } from '../../models/shared/Track'; +import { PlaybackService } from '../../playback/playback.service'; import { JellyfinStreamBuilderService } from '../jellyfin/jellyfin.stream.builder.service'; import { JellyfinWebSocketService } from '../jellyfin/jellyfin.websocket.service'; -import { GenericTryHandler } from '../../models/generic-try-handler'; -import { PlaybackService } from '../../playback/playback.service'; -import { Track } from '../../models/shared/Track'; import { DiscordMessageService } from './discord.message.service'; @@ -93,7 +92,7 @@ export class DiscordVoiceService { this.jellyfinWebSocketService.initializeAndConnect(); - if (this.voiceConnection == undefined) { + if (this.voiceConnection === undefined) { this.voiceConnection = getVoiceConnection(member.guild.id); } diff --git a/src/clients/jellyfin/jellyfin.websocket.service.ts b/src/clients/jellyfin/jellyfin.websocket.service.ts index 49ff445..45fe2d2 100644 --- a/src/clients/jellyfin/jellyfin.websocket.service.ts +++ b/src/clients/jellyfin/jellyfin.websocket.service.ts @@ -1,13 +1,11 @@ import { PlaystateCommand, SessionMessageType, - UserItemDataDto, } from '@jellyfin/sdk/lib/generated-client/models'; import { Injectable, Logger, OnModuleDestroy } from '@nestjs/common'; import { EventEmitter2 } from '@nestjs/event-emitter'; import { Cron } from '@nestjs/schedule'; -import { Session } from 'inspector'; import { WebSocket } from 'ws'; diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 85ab999..3c5fd2e 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -20,14 +20,14 @@ import { InteractionReplyOptions, } from 'discord.js'; -import { PlaybackService } from '../../playback/playback.service'; -import { formatMillisecondsAsHumanReadable } from '../../utils/timeUtils'; import { DiscordMessageService } from '../../clients/discord/discord.message.service'; import { DiscordVoiceService } from '../../clients/discord/discord.voice.service'; import { JellyfinSearchService } from '../../clients/jellyfin/jellyfin.search.service'; import { SearchHint } from '../../models/search/SearchHint'; +import { PlaybackService } from '../../playback/playback.service'; +import { formatMillisecondsAsHumanReadable } from '../../utils/timeUtils'; -import { SearchType, PlayCommandParams } from './play.params.ts'; +import { PlayCommandParams, SearchType } from './play.params.ts'; @Injectable() @Command({ @@ -105,8 +105,8 @@ export class PlayItemCommand { this.playbackService.getPlaylistOrDefault().enqueueTracks(tracks); const remoteImage: RemoteImageInfo | undefined = tracks - .flatMap((x) => x.getRemoteImages()) - .find((x) => true); + .flatMap((track) => track.getRemoteImages()) + .find(() => true); await interaction.followUp({ embeds: [ diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index c16a5b5..76cfbab 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -1,4 +1,4 @@ -import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; +import { EventEmitter2 } from '@nestjs/event-emitter'; import { Track } from './Track'; diff --git a/src/updates/updates.service.spec.ts b/src/updates/updates.service.spec.ts index 911aa04..74f25ab 100644 --- a/src/updates/updates.service.spec.ts +++ b/src/updates/updates.service.spec.ts @@ -33,7 +33,7 @@ describe('UpdatesService', () => { } as DiscordMessageService; } - if (token === Client || token == '__inject_discord_client__') { + if (token === Client || token === '__inject_discord_client__') { return { guilds: { cache: [ From 606c10ec6d12fa3718b98f91a908718aa3b1a522 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 2 Apr 2023 16:54:24 +0200 Subject: [PATCH 42/55] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20build=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/health/health.controller.spec.ts | 9 +++++++-- src/health/indicators/jeyllfin.indicator.spec.ts | 3 ++- src/updates/updates.service.spec.ts | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/health/health.controller.spec.ts b/src/health/health.controller.spec.ts index 7de55d4..7d1cf84 100644 --- a/src/health/health.controller.spec.ts +++ b/src/health/health.controller.spec.ts @@ -1,3 +1,4 @@ +import { InjectionToken } from '@nestjs/common'; import { HealthCheckResult, HealthCheckService, @@ -42,10 +43,14 @@ describe('HealthController', () => { } if (token === HealthCheckService) { - return new HealthCheckService(new HealthCheckExecutor(), null, null); + return new HealthCheckService( + new HealthCheckExecutor(), + { getErrorMessage: jest.fn() }, + { log: jest.fn(), error: jest.fn(), warn: jest.fn() }, + ); } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile(); diff --git a/src/health/indicators/jeyllfin.indicator.spec.ts b/src/health/indicators/jeyllfin.indicator.spec.ts index 38b12c7..dcebe2d 100644 --- a/src/health/indicators/jeyllfin.indicator.spec.ts +++ b/src/health/indicators/jeyllfin.indicator.spec.ts @@ -1,3 +1,4 @@ +import { InjectionToken } from '@nestjs/common'; import { HealthIndicatorResult } from '@nestjs/terminus'; import { Test } from '@nestjs/testing'; import { JellyfinService } from '../../clients/jellyfin/jellyfin.service'; @@ -16,7 +17,7 @@ describe('JellyfinHealthIndicator', () => { if (token === JellyfinService) { return { isConnected: jest.fn() }; } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile(); diff --git a/src/updates/updates.service.spec.ts b/src/updates/updates.service.spec.ts index 74f25ab..a72d899 100644 --- a/src/updates/updates.service.spec.ts +++ b/src/updates/updates.service.spec.ts @@ -6,6 +6,7 @@ import { DiscordMessageService } from '../clients/discord/discord.message.servic import { GithubRelease } from '../models/github-release'; import { useDefaultMockerToken } from '../utils/tests/defaultMockerToken'; import { UpdatesService } from './updates.service'; +import { InjectionToken } from '@nestjs/common'; // mock axios: https://stackoverflow.com/questions/51275434/type-of-axios-mock-using-jest-typescript/55351900#55351900 jest.mock('axios'); @@ -49,7 +50,7 @@ describe('UpdatesService', () => { }; } - return useDefaultMockerToken(token); + return useDefaultMockerToken(token as InjectionToken); }) .compile(); From 831e03a77f70ae0642add845595b3d5fe5108f68 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 2 Apr 2023 20:43:12 +0200 Subject: [PATCH 43/55] =?UTF-8?q?=E2=9C=A8=20Add=20websocket=20playback=20?= =?UTF-8?q?control=20for=20next=20and=20previous?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jellyfin/jellyfin.websocket.service.ts | 15 +++++++++------ src/models/shared/Playlist.ts | 2 +- src/playback/playback.service.ts | 12 +++++++++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/clients/jellyfin/jellyfin.websocket.service.ts b/src/clients/jellyfin/jellyfin.websocket.service.ts index e13946b..136cc69 100644 --- a/src/clients/jellyfin/jellyfin.websocket.service.ts +++ b/src/clients/jellyfin/jellyfin.websocket.service.ts @@ -113,9 +113,6 @@ export class JellyfinWebSocketService implements OnModuleDestroy { msg.Data as SessionApiSendPlaystateCommandRequest; this.handleSendPlaystateCommandRequest(sendPlaystateCommandRequest); break; - case SessionMessageType[SessionMessageType.UserDataChanged]: - this.logger.debug("Received update for user session data"); - break; default: this.logger.warn( `Received a package from the socket of unknown type: ${msg.MessageType}`, @@ -129,13 +126,19 @@ export class JellyfinWebSocketService implements OnModuleDestroy { ) { switch (request.Command) { case PlaystateCommand.PlayPause: - this.eventEmitter.emitAsync('internal.voice.controls.togglePause'); + this.eventEmitter.emit('internal.voice.controls.togglePause'); break; case PlaystateCommand.Pause: - this.eventEmitter.emitAsync('internal.voice.controls.pause'); + this.eventEmitter.emit('internal.voice.controls.pause'); break; case PlaystateCommand.Stop: - this.eventEmitter.emitAsync('internal.voice.controls.stop'); + this.eventEmitter.emit('internal.voice.controls.stop'); + break; + case PlaystateCommand.NextTrack: + this.eventEmitter.emit('internal.audio.track.next'); + break; + case PlaystateCommand.PreviousTrack: + this.eventEmitter.emit('internal.audio.track.previous'); break; default: this.logger.warn( diff --git a/src/models/shared/Playlist.ts b/src/models/shared/Playlist.ts index d6a4ede..c93bf5d 100644 --- a/src/models/shared/Playlist.ts +++ b/src/models/shared/Playlist.ts @@ -1,4 +1,4 @@ -import { EventEmitter2 } from '@nestjs/event-emitter'; +import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; import { Track } from './Track'; diff --git a/src/playback/playback.service.ts b/src/playback/playback.service.ts index 067ecf9..df96f2d 100644 --- a/src/playback/playback.service.ts +++ b/src/playback/playback.service.ts @@ -1,5 +1,5 @@ import { Injectable, Logger } from '@nestjs/common'; -import { EventEmitter2 } from '@nestjs/event-emitter'; +import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; import { Playlist } from '../models/shared/Playlist'; @@ -18,4 +18,14 @@ export class PlaybackService { this.playlist = new Playlist(this.eventEmitter); return this.playlist; } + + @OnEvent('internal.audio.track.previous') + private handlePreviousTrackEvent() { + this.getPlaylistOrDefault().setPreviousTrackAsActiveTrack(); + } + + @OnEvent('internal.audio.track.next') + private handleNextTrackEvent() { + this.getPlaylistOrDefault().setNextTrackAsActiveTrack(); + } } From d1fc61c6fec0b38a7366a342cff00dee9bc79293 Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 2 Apr 2023 19:31:01 +0200 Subject: [PATCH 44/55] =?UTF-8?q?=E2=9C=A8=20Add=20time=20tracking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- src/clients/discord/discord.voice.service.ts | 39 ++++++++- .../jellyfin/jellyfin.playstate.service.ts | 28 ++++++- src/commands/play/play.comands.ts | 14 +--- src/commands/playlist/playlist.command.ts | 80 ++++++++++++++----- .../playlist.interaction-collector.ts | 23 ++++-- src/commands/playlist/playlist.types.ts | 6 ++ src/models/search/SearchHint.ts | 22 ++++- src/models/shared/Track.ts | 11 +++ src/utils/stringUtils/stringUtils.ts | 3 + yarn.lock | 5 ++ 11 files changed, 190 insertions(+), 44 deletions(-) create mode 100644 src/commands/playlist/playlist.types.ts diff --git a/package.json b/package.json index a95f8cd..0794b9e 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "rimraf": "^4.4.1", "rxjs": "^7.2.0", "uuid": "^9.0.0", - "ws": "^8.13.0" + "ws": "^8.13.0", + "zod": "^3.21.4" }, "devDependencies": { "@nestjs/cli": "^9.3.0", diff --git a/src/clients/discord/discord.voice.service.ts b/src/clients/discord/discord.voice.service.ts index 0b350ba..db81906 100644 --- a/src/clients/discord/discord.voice.service.ts +++ b/src/clients/discord/discord.voice.service.ts @@ -14,6 +14,7 @@ import { import { Injectable } from '@nestjs/common'; import { Logger } from '@nestjs/common/services'; import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; +import { Interval } from '@nestjs/schedule'; import { GuildMember } from 'discord.js'; @@ -224,7 +225,7 @@ export class DiscordVoiceService { if (this.audioPlayer === undefined) { this.logger.debug( - "Initialized new instance of AudioPlayer because it has not been defined yet", + 'Initialized new instance of AudioPlayer because it has not been defined yet', ); this.audioPlayer = createAudioPlayer({ debug: process.env.DEBUG?.toLowerCase() === 'true', @@ -291,7 +292,7 @@ export class DiscordVoiceService { return; } - this.logger.debug("Audio player finished playing old resource"); + this.logger.debug('Audio player finished playing old resource'); const playlist = this.playbackService.getPlaylistOrDefault(); const finishedTrack = playlist.getActiveTrack(); @@ -308,11 +309,43 @@ export class DiscordVoiceService { ); if (!hasNextTrack) { - this.logger.debug("Reached the end of the playlist"); + this.logger.debug('Reached the end of the playlist'); return; } this.playbackService.getPlaylistOrDefault().setNextTrackAsActiveTrack(); }); } + + @Interval(500) + private checkAudioResourcePlayback() { + if (!this.audioResource) { + return; + } + + const progress = this.audioResource.playbackDuration; + + const playlist = this.playbackService.getPlaylistOrDefault(); + + if (!playlist) { + this.logger.error( + `Failed to update ellapsed audio time because playlist was unexpectitly undefined`, + ); + return; + } + + const activeTrack = playlist.getActiveTrack(); + + if (!activeTrack) { + this.logger.error( + `Failed to update ellapsed audio time because active track was unexpectitly undefined`, + ); + return; + } + + activeTrack.updatePlaybackProgress(progress); + this.logger.verbose( + `Reporting progress: ${progress} on track ${activeTrack.id}`, + ); + } } diff --git a/src/clients/jellyfin/jellyfin.playstate.service.ts b/src/clients/jellyfin/jellyfin.playstate.service.ts index 465322c..ae56dc2 100644 --- a/src/clients/jellyfin/jellyfin.playstate.service.ts +++ b/src/clients/jellyfin/jellyfin.playstate.service.ts @@ -10,6 +10,7 @@ import { getSessionApi } from '@jellyfin/sdk/lib/utils/api/session-api'; import { Injectable, Logger } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; +import { Interval } from '@nestjs/schedule'; import { Track } from '../../models/shared/Track'; import { PlaybackService } from '../../playback/playback.service'; @@ -52,6 +53,7 @@ export class JellyinPlaystateService { await this.playstateApi.reportPlaybackStart({ playbackStartInfo: { ItemId: track.id, + PositionTicks: 0, }, }); } @@ -60,7 +62,7 @@ export class JellyinPlaystateService { private async onPlaybackFinished(track: Track) { if (!track) { this.logger.error( - "Unable to report playback because finished track was undefined", + 'Unable to report playback because finished track was undefined', ); return; } @@ -68,6 +70,7 @@ export class JellyinPlaystateService { await this.playstateApi.reportPlaybackStopped({ playbackStopInfo: { ItemId: track.id, + PositionTicks: track.playbackProgress * 10000, }, }); } @@ -78,7 +81,7 @@ export class JellyinPlaystateService { if (!track) { this.logger.error( - "Unable to report changed playstate to Jellyfin because no track was active", + 'Unable to report changed playstate to Jellyfin because no track was active', ); return; } @@ -87,7 +90,28 @@ export class JellyinPlaystateService { playbackProgressInfo: { IsPaused: paused, ItemId: track.id, + PositionTicks: track.playbackProgress * 10000, }, }); } + + @Interval(1000) + private async onPlaybackProgress() { + const track = this.playbackService.getPlaylistOrDefault().getActiveTrack(); + + if (!track) { + return; + } + + await this.playstateApi.reportPlaybackProgress({ + playbackProgressInfo: { + ItemId: track.id, + PositionTicks: track.playbackProgress * 10000, + }, + }); + + this.logger.verbose( + `Reported playback progress ${track.playbackProgress} to Jellyfin for item ${track.id}`, + ); + } } diff --git a/src/commands/play/play.comands.ts b/src/commands/play/play.comands.ts index 41ae5b0..94acf84 100644 --- a/src/commands/play/play.comands.ts +++ b/src/commands/play/play.comands.ts @@ -70,7 +70,8 @@ export class PlayItemCommand { embeds: [ this.discordMessageService.buildMessage({ title: 'No results found', - description: "- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters", + description: + '- Check for any misspellings\n- Grant me access to your desired libraries\n- Avoid special characters', }), ], ephemeral: true, @@ -136,15 +137,8 @@ export class PlayItemCommand { const focusedAutoCompleteAction = interaction.options.getFocused(true); const typeIndex = interaction.options.getInteger('type'); - - if (typeIndex === null) { - this.logger.error( - `Failed to get type integer from play command interaction autocomplete`, - ); - return; - } - - const type = Object.values(SearchType)[typeIndex] as SearchType; + const type = + typeIndex !== null ? Object.values(SearchType)[typeIndex] : undefined; const searchQuery = focusedAutoCompleteAction.value; if (!searchQuery || searchQuery.length < 1) { diff --git a/src/commands/playlist/playlist.command.ts b/src/commands/playlist/playlist.command.ts index d244041..2cd41cf 100644 --- a/src/commands/playlist/playlist.command.ts +++ b/src/commands/playlist/playlist.command.ts @@ -22,16 +22,19 @@ import { InteractionUpdateOptions, } from 'discord.js'; -import { PlaybackService } from '../../playback/playback.service'; -import { chunkArray } from '../../utils/arrayUtils'; -import { Constants } from '../../utils/constants'; -import { formatMillisecondsAsHumanReadable } from '../../utils/timeUtils'; import { DiscordMessageService } from '../../clients/discord/discord.message.service'; import { Track } from '../../models/shared/Track'; -import { trimStringToFixedLength } from '../../utils/stringUtils/stringUtils'; +import { PlaybackService } from '../../playback/playback.service'; +import { chunkArray } from '../../utils/arrayUtils'; +import { trimStringToFixedLength, zeroPad } from '../../utils/stringUtils/stringUtils'; +import { Interval } from '@nestjs/schedule'; +import { lightFormat } from 'date-fns'; import { PlaylistInteractionCollector } from './playlist.interaction-collector'; import { PlaylistCommandParams } from './playlist.params'; +import { PlaylistTempCommandData } from './playlist.types'; +import { tr } from 'date-fns/locale'; +import { takeCoverage } from 'v8'; @Injectable() @Command({ @@ -41,7 +44,7 @@ import { PlaylistCommandParams } from './playlist.params'; @UseInterceptors(CollectorInterceptor) @UseCollectors(PlaylistInteractionCollector) export class PlaylistCommand { - public pageData: Map = new Map(); + public pageData: Map = new Map(); private readonly logger = new Logger(PlaylistCommand.name); constructor( @@ -61,7 +64,10 @@ export class PlaylistCommand { this.getReplyForPage(page) as InteractionReplyOptions, ); - this.pageData.set(interaction.id, page); + this.pageData.set(interaction.id, { + page, + interaction, + }); this.logger.debug( `Added '${interaction.id}' as a message id for page storage`, ); @@ -82,6 +88,36 @@ export class PlaylistCommand { return chunkArray(playlist.tracks, 10); } + private createInterval(interaction: CommandInteraction) { + return setInterval(async () => { + const tempData = this.pageData.get(interaction.id); + + if (!tempData) { + this.logger.warn( + `Failed to update from interval, because temp data was not found`, + ); + return; + } + + await interaction.editReply(this.getReplyForPage(tempData.page)); + }, 2000); + } + + @Interval(2 * 1000) + private async updatePlaylists() { + if (this.pageData.size === 0) { + return; + } + + this.logger.verbose( + `Updating playlist for ${this.pageData.size} playlist datas`, + ); + + this.pageData.forEach(async (value) => { + await value.interaction.editReply(this.getReplyForPage(value.page)); + }); + } + public getReplyForPage( page: number, ): InteractionReplyOptions | InteractionUpdateOptions { @@ -176,26 +212,34 @@ export class PlaylistCommand { ); } + const paddingNumber = playlist.getLength() >= 100 ? 3 : 2; + const content = chunk .map((track, index) => { const isCurrent = track === playlist.getActiveTrack(); - // use the offset for the page, add the current index and offset by one because the array index is used - let point = `${offset + index + 1}. `; - point += `**${trimStringToFixedLength(track.name, 30)}**`; - + let line = `\`\`${zeroPad(offset + index + 1, paddingNumber)}.\`\` `; + line += this.getTrackName(track, isCurrent) + ' • '; if (isCurrent) { - point += ' :loud_sound:'; + line += lightFormat(track.getPlaybackProgress(), 'mm:ss') + ' / '; } - - point += '\n'; - point += Constants.Design.InvisibleSpace.repeat(2); - point += formatMillisecondsAsHumanReadable(track.getDuration()); - - return point; + line += lightFormat(track.getDuration(), 'mm:ss'); + if (isCurrent) { + line += ' • (:play_pause:)'; + } + return line; }) .join('\n'); return new EmbedBuilder().setTitle('Your playlist').setDescription(content); } + + private getTrackName(track: Track, active: boolean) { + const trimmedTitle = trimStringToFixedLength(track.name, 30); + if (active) { + return `**${trimmedTitle}**`; + } + + return trimmedTitle; + } } diff --git a/src/commands/playlist/playlist.interaction-collector.ts b/src/commands/playlist/playlist.interaction-collector.ts index 0619c3e..49e3ca8 100644 --- a/src/commands/playlist/playlist.interaction-collector.ts +++ b/src/commands/playlist/playlist.interaction-collector.ts @@ -15,6 +15,7 @@ import { } from 'discord.js'; import { PlaylistCommand } from './playlist.command'; +import { PlaylistTempCommandData } from './playlist.types'; @Injectable({ scope: Scope.REQUEST }) @InteractionEventCollector({ time: 60 * 1000 }) @@ -40,7 +41,7 @@ export class PlaylistInteractionCollector { async onCollect(interaction: ButtonInteraction): Promise { const targetPage = this.getInteraction(interaction); this.logger.verbose( - `Extracted the target page ${targetPage} from the button interaction`, + `Extracted the target page '${targetPage?.page}' from the button interaction`, ); if (targetPage === undefined) { @@ -51,14 +52,16 @@ export class PlaylistInteractionCollector { } this.logger.debug( - `Updating current page for interaction ${this.causeInteraction.id} to ${targetPage}`, + `Updating current page for interaction ${this.causeInteraction.id} to ${targetPage.page}`, ); this.playlistCommand.pageData.set(this.causeInteraction.id, targetPage); - const reply = this.playlistCommand.getReplyForPage(targetPage); + const reply = this.playlistCommand.getReplyForPage(targetPage.page); await interaction.update(reply as InteractionUpdateOptions); } - private getInteraction(interaction: ButtonInteraction): number | undefined { + private getInteraction( + interaction: ButtonInteraction, + ): PlaylistTempCommandData | undefined { const current = this.playlistCommand.pageData.get(this.causeInteraction.id); if (current === undefined) { @@ -78,12 +81,18 @@ export class PlaylistInteractionCollector { switch (interaction.customId) { case 'playlist-controls-next': - return current + 1; + return { + ...current, + page: current.page + 1, + }; case 'playlist-controls-previous': - return current - 1; + return { + ...current, + page: current.page - 1, + }; default: this.logger.error( - "Unable to map button interaction from collector to target page", + 'Unable to map button interaction from collector to target page', ); return undefined; } diff --git a/src/commands/playlist/playlist.types.ts b/src/commands/playlist/playlist.types.ts new file mode 100644 index 0000000..1858151 --- /dev/null +++ b/src/commands/playlist/playlist.types.ts @@ -0,0 +1,6 @@ +import { CommandInteraction } from 'discord.js'; + +export type PlaylistTempCommandData = { + page: number; + interaction: CommandInteraction; +}; diff --git a/src/models/search/SearchHint.ts b/src/models/search/SearchHint.ts index b1355bd..09a382e 100644 --- a/src/models/search/SearchHint.ts +++ b/src/models/search/SearchHint.ts @@ -2,6 +2,7 @@ import { BaseItemDto, SearchHint as JellyfinSearchHint, } from '@jellyfin/sdk/lib/generated-client/models'; +import { z } from 'zod'; import { JellyfinSearchService } from '../../clients/jellyfin/jellyfin.search.service'; import { Track } from '../shared/Track'; @@ -26,12 +27,27 @@ export class SearchHint { } static constructFromHint(hint: JellyfinSearchHint) { - if (hint.Id === undefined || !hint.Name || !hint.RunTimeTicks) { + const schema = z.object({ + Id: z.string(), + Name: z.string(), + RunTimeTicks: z.number(), + }); + + const result = schema.safeParse(hint); + + if (!result.success) { throw new Error( - 'Unable to construct search hint, required properties were undefined', + `Unable to construct search hint, required properties were undefined: ${JSON.stringify( + hint, + )}`, ); } - return new SearchHint(hint.Id, hint.Name, hint.RunTimeTicks / 10000); + + return new SearchHint( + result.data.Id, + result.data.Name, + result.data.RunTimeTicks / 10000, + ); } static constructFromBaseItem(baseItem: BaseItemDto) { diff --git a/src/models/shared/Track.ts b/src/models/shared/Track.ts index 0168f61..c3cfd8d 100644 --- a/src/models/shared/Track.ts +++ b/src/models/shared/Track.ts @@ -29,6 +29,8 @@ export class Track { playing: boolean; + playbackProgress: number; + constructor( id: string, name: string, @@ -40,6 +42,7 @@ export class Track { this.duration = duration; this.remoteImages = remoteImages; this.playing = false; + this.playbackProgress = 0; } getDuration() { @@ -53,4 +56,12 @@ export class Track { getRemoteImages(): RemoteImageInfo[] { return this.remoteImages?.Images ?? []; } + + getPlaybackProgress() { + return this.playbackProgress; + } + + updatePlaybackProgress(progress: number) { + this.playbackProgress = progress; + } } diff --git a/src/utils/stringUtils/stringUtils.ts b/src/utils/stringUtils/stringUtils.ts index b9637a3..18fb29e 100644 --- a/src/utils/stringUtils/stringUtils.ts +++ b/src/utils/stringUtils/stringUtils.ts @@ -11,3 +11,6 @@ export const trimStringToFixedLength = (value: string, maxLength: number) => { return value.substring(0, upperBound) + '...'; }; + +export const zeroPad = (num: number, places: number) => + String(num).padStart(places, '0'); diff --git a/yarn.lock b/yarn.lock index 1cd51a4..9e9bebc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5403,3 +5403,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zod@^3.21.4: + version "3.21.4" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" + integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== From 18972dda89cb93149d0e05b77ceb86c1d09c8e3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:07:41 +0000 Subject: [PATCH 45/55] :arrow_up:(deps-dev): Bump tsconfig-paths from 4.1.2 to 4.2.0 Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 4.1.2 to 4.2.0. - [Release notes](https://github.com/dividab/tsconfig-paths/releases) - [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md) - [Commits](https://github.com/dividab/tsconfig-paths/compare/v4.1.2...v4.2.0) --- updated-dependencies: - dependency-name: tsconfig-paths dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0794b9e..e9441c6 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "ts-jest": "28.0.8", "ts-loader": "^9.2.3", "ts-node": "^10.0.0", - "tsconfig-paths": "4.1.2", + "tsconfig-paths": "4.2.0", "typescript": "^4.7.4" }, "jest": { diff --git a/yarn.lock b/yarn.lock index 9e9bebc..a620f01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5072,7 +5072,7 @@ tsconfig-paths-webpack-plugin@4.0.1: enhanced-resolve "^5.7.0" tsconfig-paths "^4.1.2" -tsconfig-paths@4.1.2, tsconfig-paths@^4.1.2: +tsconfig-paths@4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz#4819f861eef82e6da52fb4af1e8c930a39ed979a" integrity sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw== @@ -5081,6 +5081,15 @@ tsconfig-paths@4.1.2, tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" +tsconfig-paths@4.2.0, tsconfig-paths@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" + integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== + dependencies: + json5 "^2.2.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@2.5.0, tslib@^2.1.0, tslib@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" From 32231b80850635835b3393e397c3e441cc07fc46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:05:13 +0000 Subject: [PATCH 46/55] :arrow_up:(deps): Bump discord.js from 14.8.0 to 14.9.0 Bumps [discord.js](https://github.com/discordjs/discord.js) from 14.8.0 to 14.9.0. - [Release notes](https://github.com/discordjs/discord.js/releases) - [Commits](https://github.com/discordjs/discord.js/compare/14.8.0...14.9.0) --- updated-dependencies: - dependency-name: discord.js dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 76 ++++++++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index e9441c6..6c99101 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@nestjs/serve-static": "^3.0.1", "@nestjs/terminus": "^9.2.2", "date-fns": "^2.29.3", - "discord.js": "^14.8.0", + "discord.js": "^14.9.0", "joi": "^17.9.1", "libsodium-wrappers": "^0.7.10", "opusscript": "^0.0.8", diff --git a/yarn.lock b/yarn.lock index a620f01..003537c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -376,30 +376,30 @@ dependencies: class-transformer "0.5.1" -"@discordjs/builders@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.5.0.tgz#f6dd4684e46707eb600eabdfdacd3b44c9e924cd" - integrity sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA== +"@discordjs/builders@^1.6.0": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.6.1.tgz#5b1447cfa493bc1306671ef18ce3aae13c0af0ba" + integrity sha512-CCcLwn/8ANhlAbhlE18fcaN0hfXTen53/JiwZs1t9oE/Cqa9maA8ZRarkCIsXF4J7J/MYnd0J6IsxeKsq+f6mw== dependencies: - "@discordjs/formatters" "^0.2.0" + "@discordjs/formatters" "^0.3.0" "@discordjs/util" "^0.2.0" "@sapphire/shapeshift" "^3.8.1" - discord-api-types "^0.37.35" + discord-api-types "^0.37.37" fast-deep-equal "^3.1.3" ts-mixer "^6.0.3" tslib "^2.5.0" -"@discordjs/collection@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.4.0.tgz#6b5d5429db0691a3f5a962c21f6bc7859eef3333" - integrity sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ== +"@discordjs/collection@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.5.0.tgz#478acd5d510cb5996c5101f47b24959ac7499cc2" + integrity sha512-suyVndkEAAWrGxyw/CPGdtXoRRU6AUNkibtnbJevQzpelkJh3Q1gQqWDpqf5i39CnAn5+LrN0YS+cULeEjq2Yw== -"@discordjs/formatters@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.2.0.tgz#a861d9c385dfc6c7294e44c5441beee933820a4f" - integrity sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA== +"@discordjs/formatters@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.0.tgz#8313d158c5e974597eec43b1f381d870a507d133" + integrity sha512-Fc4MomalbP8HMKEMor3qUiboAKDtR7PSBoPjwm7WYghVRwgJlj5WYvUsriLsxeKk8+Qq2oy+HJlGTUkGvX0YnA== dependencies: - discord-api-types "^0.37.35" + discord-api-types "^0.37.37" "@discordjs/node-pre-gyp@^0.4.5": version "0.4.5" @@ -424,19 +424,19 @@ "@discordjs/node-pre-gyp" "^0.4.5" node-addon-api "^5.0.0" -"@discordjs/rest@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" - integrity sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA== +"@discordjs/rest@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.7.0.tgz#c61fcd14e810b44e4821df5dfb5e74fa5fcb6e5d" + integrity sha512-r2HzmznRIo8IDGYBWqQfkEaGN1LrFfWQd3dSyC4tOpMU8nuVvFUEw6V/lwnG44jyOq+vgyDny2fxeUDMt9I4aQ== dependencies: - "@discordjs/collection" "^1.4.0" + "@discordjs/collection" "^1.5.0" "@discordjs/util" "^0.2.0" "@sapphire/async-queue" "^1.5.0" "@sapphire/snowflake" "^3.4.0" - discord-api-types "^0.37.35" + discord-api-types "^0.37.37" file-type "^18.2.1" tslib "^2.5.0" - undici "^5.20.0" + undici "^5.21.0" "@discordjs/util@^0.2.0": version "0.2.0" @@ -2298,29 +2298,29 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -discord-api-types@^0.37.35: - version "0.37.36" - resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.36.tgz#650a8f66dce2c5e54a8c2275db74a0bb7936430d" - integrity sha512-Nlxmp10UpVr/utgZ9uODQvG2Or+5w7LFrvFMswyeKC9l/+UaqGT6H0OVgEFhu9GEO4U6K7NNO5W8Carv7irnCA== +discord-api-types@^0.37.35, discord-api-types@^0.37.37: + version "0.37.37" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.37.tgz#49bc42a36124c85f06297f1548f130329ed5aeb0" + integrity sha512-LDMBKzl/zbvHO/yCzno5hevuA6lFIXJwdKSJZQrB+1ToDpFfN9thK+xxgZNR4aVkI7GHRDja0p4Sl2oYVPnHYg== -discord.js@^14.8.0: - version "14.8.0" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.8.0.tgz#0e5def8a95a22018844cdfc0f63b9806392da79b" - integrity sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ== +discord.js@^14.9.0: + version "14.9.0" + resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.9.0.tgz#61e26c4a7a27f91fd669b4c46892868420a5be43" + integrity sha512-ygGms5xP4hG+QrrY9k7d/OYCzMltSMtdl/2Snzq/nLCiZo+Sna91Ulv9l0+B5Jd/Czcq37B7wJAnmja7GOa+bg== dependencies: - "@discordjs/builders" "^1.5.0" - "@discordjs/collection" "^1.4.0" - "@discordjs/formatters" "^0.2.0" - "@discordjs/rest" "^1.6.0" + "@discordjs/builders" "^1.6.0" + "@discordjs/collection" "^1.5.0" + "@discordjs/formatters" "^0.3.0" + "@discordjs/rest" "^1.7.0" "@discordjs/util" "^0.2.0" "@sapphire/snowflake" "^3.4.0" "@types/ws" "^8.5.4" - discord-api-types "^0.37.35" + discord-api-types "^0.37.37" fast-deep-equal "^3.1.3" lodash.snakecase "^4.1.1" tslib "^2.5.0" - undici "^5.20.0" - ws "^8.12.1" + undici "^5.21.0" + ws "^8.13.0" doctrine@^3.0.0: version "3.0.0" @@ -5154,7 +5154,7 @@ uid@2.0.1: dependencies: "@lukeed/csprng" "^1.0.0" -undici@^5.20.0: +undici@^5.21.0: version "5.21.0" resolved "https://registry.yarnpkg.com/undici/-/undici-5.21.0.tgz#b00dfc381f202565ab7f52023222ab862bb2494f" integrity sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA== From 0a2086266c5a13190e30e3ead03a7792d45b5116 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:04:01 +0000 Subject: [PATCH 47/55] :arrow_up:(deps): Bump @discordjs/voice from 0.15.0 to 0.16.0 Bumps [@discordjs/voice](https://github.com/discordjs/discord.js) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/discordjs/discord.js/releases) - [Commits](https://github.com/discordjs/discord.js/compare/@discordjs/voice@0.15.0...@discordjs/voice@0.16.0) --- updated-dependencies: - dependency-name: "@discordjs/voice" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6c99101..0ca8e30 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@discord-nestjs/common": "^5.2.3", "@discord-nestjs/core": "^5.3.5", "@discordjs/opus": "^0.9.0", - "@discordjs/voice": "^0.15.0", + "@discordjs/voice": "^0.16.0", "@jellyfin/sdk": "^0.7.0", "@nestjs/common": "^9.3.12", "@nestjs/config": "^2.2.0", diff --git a/yarn.lock b/yarn.lock index 003537c..ac99a0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -443,16 +443,16 @@ resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-0.2.0.tgz#91b590dae3934ffa5fe34530afc5212c569d6751" integrity sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg== -"@discordjs/voice@^0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@discordjs/voice/-/voice-0.15.0.tgz#774febb2a1623b23e234744fefb60544858db77d" - integrity sha512-YEvrRchDhjB0QbI9QYOF/qgDwvGb9sNGUyks5d3Srl+VRoMoKkMzWY+wcEfVbAgdMIAdLi5vyrTKP/gLND26jA== +"@discordjs/voice@^0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@discordjs/voice/-/voice-0.16.0.tgz#9df1e492c8fea95113236a3de3ac52702c587729" + integrity sha512-ToGCvHD1cBscuW3p+C7zOF5+L7MJmU4GjdOARfNk9mkHyFFZq4grK+Sxr3QXKbp27DtfDBc9uqD4GUOYgxngfA== dependencies: "@types/ws" "^8.5.4" - discord-api-types "^0.37.35" + discord-api-types "^0.37.37" prism-media "^1.3.5" tslib "^2.5.0" - ws "^8.12.1" + ws "^8.13.0" "@eslint-community/eslint-utils@^4.2.0": version "4.2.0" From d285ea73f72188b2b10cd5deaadd69196f97d13c Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 3 Apr 2023 20:48:12 +0200 Subject: [PATCH 48/55] =?UTF-8?q?=F0=9F=94=96=20Tag=20to=20version=200.0.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- yarn.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0ca8e30..ec51819 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jellyfin-discord-music-bot", - "version": "0.0.6", - "description": "", + "version": "0.0.7", + "description": "A simple and leightweight Discord Bot, that integrates with your Jellyfin Media server and enables you to listen to your favourite music directly from discord.", "author": "manuel-rw", "private": true, "license": "MIT", diff --git a/yarn.lock b/yarn.lock index ac99a0a..16a3f29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2298,7 +2298,7 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -discord-api-types@^0.37.35, discord-api-types@^0.37.37: +discord-api-types@^0.37.37: version "0.37.37" resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.37.tgz#49bc42a36124c85f06297f1548f130329ed5aeb0" integrity sha512-LDMBKzl/zbvHO/yCzno5hevuA6lFIXJwdKSJZQrB+1ToDpFfN9thK+xxgZNR4aVkI7GHRDja0p4Sl2oYVPnHYg== @@ -5355,7 +5355,7 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@^8.12.1, ws@^8.13.0: +ws@^8.13.0: version "8.13.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== From 8ccf9e8c11ae88a55cb0506de8ad957a9a52fbb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:42:45 +0000 Subject: [PATCH 49/55] :arrow_up:(deps): Bump @jellyfin/sdk from 0.7.0 to 0.8.1 Bumps [@jellyfin/sdk](https://github.com/jellyfin/jellyfin-sdk-typescript) from 0.7.0 to 0.8.1. - [Release notes](https://github.com/jellyfin/jellyfin-sdk-typescript/releases) - [Commits](https://github.com/jellyfin/jellyfin-sdk-typescript/compare/v0.7.0...v0.8.1) --- updated-dependencies: - dependency-name: "@jellyfin/sdk" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 38 ++++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index ec51819..08468f5 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@discord-nestjs/core": "^5.3.5", "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.16.0", - "@jellyfin/sdk": "^0.7.0", + "@jellyfin/sdk": "^0.8.1", "@nestjs/common": "^9.3.12", "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.3.12", diff --git a/yarn.lock b/yarn.lock index 16a3f29..da7c161 100644 --- a/yarn.lock +++ b/yarn.lock @@ -533,13 +533,13 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jellyfin/sdk@^0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@jellyfin/sdk/-/sdk-0.7.0.tgz#34bcbe53acc089caa9f458e866ed5745726f5397" - integrity sha512-GNoGv+2qY+xK7WpO7sUUNpZvzgN7RwXMyOhIy9mE/LdDSr6bqZHwrzT1Pv0+vUW7Epw67bwIMWuYivyBYejEHw== +"@jellyfin/sdk@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@jellyfin/sdk/-/sdk-0.8.1.tgz#56491d671219bddf37d1d86cee7d7c7843d17386" + integrity sha512-DiyaUax4i2upDz4JS/PpWKyBnFcOoUyRc63GysUvqPWeOT9yPfnRsNFkmTzUV2oRTFIeO++od/INq5DfeUbs8g== dependencies: - axios "0.27.2" - compare-versions "5.0.1" + axios "1.3.4" + compare-versions "5.0.3" "@jest/console@^28.1.3": version "28.1.3" @@ -1667,13 +1667,14 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.4.tgz#f5760cefd9cfb51fd2481acf88c05f67c4523024" + integrity sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" babel-jest@^28.1.3: version "28.1.3" @@ -2090,10 +2091,10 @@ commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -compare-versions@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.1.tgz#14c6008436d994c3787aba38d4087fabe858555e" - integrity sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ== +compare-versions@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.3.tgz#a9b34fea217472650ef4a2651d905f42c28ebfd7" + integrity sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A== component-emitter@^1.3.0: version "1.3.0" @@ -2767,7 +2768,7 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== -follow-redirects@^1.14.9: +follow-redirects@^1.15.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== @@ -4376,6 +4377,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" From 237865a4513e7134561431ab8fab9e23801a21c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 04:06:03 +0000 Subject: [PATCH 50/55] :arrow_up:(deps-dev): Bump @nestjs/schematics from 9.0.4 to 9.1.0 Bumps [@nestjs/schematics](https://github.com/nestjs/schematics) from 9.0.4 to 9.1.0. - [Release notes](https://github.com/nestjs/schematics/releases) - [Changelog](https://github.com/nestjs/schematics/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/schematics/compare/9.0.4...9.1.0) --- updated-dependencies: - dependency-name: "@nestjs/schematics" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 66 +++++----------------------------------------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 08468f5..e09dd09 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@nestjs/cli": "^9.3.0", - "@nestjs/schematics": "^9.0.0", + "@nestjs/schematics": "^9.1.0", "@nestjs/testing": "^9.3.12", "@types/cron": "^2.0.1", "@types/express": "^4.17.13", diff --git a/yarn.lock b/yarn.lock index da7c161..7a62fec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,17 +10,6 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@angular-devkit/core@15.0.4": - version "15.0.4" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-15.0.4.tgz#257ba1d76cd106216d0150f480d0062e726af996" - integrity sha512-4ITpRAevd652SxB+qNesIQ9qfbm7wT5UBU5kJOPPwGL77I21g8CQpkmV1n5VSacPvC9Zbz90feOWexf7w7JzcA== - dependencies: - ajv "8.11.0" - ajv-formats "2.1.1" - jsonc-parser "3.2.0" - rxjs "6.6.7" - source-map "0.7.4" - "@angular-devkit/core@15.2.4": version "15.2.4" resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-15.2.4.tgz#f7696f09c66d01568a07f0e71672e887fdf57280" @@ -44,17 +33,6 @@ symbol-observable "4.0.0" yargs-parser "21.1.1" -"@angular-devkit/schematics@15.0.4": - version "15.0.4" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-15.0.4.tgz#64de42f9100d7080bc3c59bb06d1e4f6f15a088e" - integrity sha512-/gXiLFS0+xFdx6wPoBpe/c6/K9I5edMpaASqPf4XheKtrsSvL+qTlIi3nsbfItzOiDXbaBmlbxGfkMHz/yg0Ig== - dependencies: - "@angular-devkit/core" "15.0.4" - jsonc-parser "3.2.0" - magic-string "0.26.7" - ora "5.4.1" - rxjs "6.6.7" - "@angular-devkit/schematics@15.2.4": version "15.2.4" resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-15.2.4.tgz#85129ebabcdb362f4b65a6e290bb2ae846f3d64c" @@ -885,14 +863,13 @@ cron "2.2.0" uuid "9.0.0" -"@nestjs/schematics@^9.0.0", "@nestjs/schematics@^9.0.4": - version "9.0.4" - resolved "https://registry.yarnpkg.com/@nestjs/schematics/-/schematics-9.0.4.tgz#ab612f5a8e006ca1d617eddc8143ee00b766312b" - integrity sha512-egurCfAc4e5i1r2TmeAF0UrOKejFmT5oTdv4b7HcOVPupc3QGU7CbEfGleL3mkM5AjrixTQeMxU9bJ00ttAbGg== +"@nestjs/schematics@^9.0.4", "@nestjs/schematics@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@nestjs/schematics/-/schematics-9.1.0.tgz#8afc4b1e7c7988c18d3ab44cffe56773b7507272" + integrity sha512-/7CyMTnPJSK9/xD9CkCqwuHPOlHVlLC2RDnbdCJ7mIO07SdbBbY14msTqtYW9VRQtsjZPLh1GTChf7ryJUImwA== dependencies: - "@angular-devkit/core" "15.0.4" - "@angular-devkit/schematics" "15.0.4" - fs-extra "11.1.0" + "@angular-devkit/core" "15.2.4" + "@angular-devkit/schematics" "15.2.4" jsonc-parser "3.2.0" pluralize "8.0.0" @@ -1531,16 +1508,6 @@ ajv-keywords@^3.5.2: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@8.11.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ajv@8.12.0, ajv@^8.0.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" @@ -2820,15 +2787,6 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -fs-extra@11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.0.tgz#5784b102104433bb0e090f48bfc4a30742c357ed" - integrity sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" @@ -3846,13 +3804,6 @@ macos-release@^2.5.0: resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.5.1.tgz#bccac4a8f7b93163a8d163b8ebf385b3c5f55bf9" integrity sha512-DXqXhEM7gW59OjZO8NIjBCz9AQ1BEMrfiOAl4AYByHCtVHRF4KoGNO8mqQeM8lRCtQe/UnJ4imO/d2HdkKsd+A== -magic-string@0.26.7: - version "0.26.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f" - integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow== - dependencies: - sourcemap-codec "^1.4.8" - magic-string@0.29.0: version "0.29.0" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.29.0.tgz#f034f79f8c43dba4ae1730ffb5e8c4e084b16cf3" @@ -4753,11 +4704,6 @@ source-map@^0.6.0, source-map@^0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sourcemap-codec@^1.4.8: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" From 5d055698736923cfcbca677bcbb65d21d53c2143 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:35:10 +0200 Subject: [PATCH 51/55] :arrow_up:(deps): Bump @nestjs/common from 9.3.12 to 9.4.0 (#160) Bumps [@nestjs/common](https://github.com/nestjs/nest) from 9.3.12 to 9.4.0. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.12...v9.4.0) --- updated-dependencies: - dependency-name: "@nestjs/common" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: Manuel Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index e09dd09..42cc067 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@discordjs/opus": "^0.9.0", "@discordjs/voice": "^0.16.0", "@jellyfin/sdk": "^0.8.1", - "@nestjs/common": "^9.3.12", + "@nestjs/common": "^9.4.0", "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.3.12", "@nestjs/event-emitter": "^1.3.1", diff --git a/yarn.lock b/yarn.lock index 56f73a8..a36d810 100644 --- a/yarn.lock +++ b/yarn.lock @@ -801,12 +801,12 @@ webpack "5.76.2" webpack-node-externals "3.0.0" -"@nestjs/common@^9.3.12": - version "9.3.12" - resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.3.12.tgz#9b3a9e162fe73c830ffa588fd3d921fd8a9f174a" - integrity sha512-NtrUG2VgCbhmZEO1yRt/Utq16uFRV+xeHAOtdYIsfHGG0ssAV2lVLlvFFAQYh0SQ+KuYY1Gsxd3GK2JFoJCNqQ== +"@nestjs/common@^9.4.0": + version "9.4.0" + resolved "https://registry.yarnpkg.com/@nestjs/common/-/common-9.4.0.tgz#3597e4f3a1278486fc2e015c94e58bcbbb4f72ca" + integrity sha512-RUcVAQsEF4WPrmzFXEOUfZnPwrLTe1UVlzXTlSyfqfqbdWDPKDGlIPVelBLfc5/+RRUQ0I5iE4+CQvpCmkqldw== dependencies: - uid "2.0.1" + uid "2.0.2" iterare "1.2.1" tslib "2.5.0" @@ -5106,6 +5106,13 @@ uid@2.0.1: dependencies: "@lukeed/csprng" "^1.0.0" +uid@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/uid/-/uid-2.0.2.tgz#4b5782abf0f2feeefc00fa88006b2b3b7af3e3b9" + integrity sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g== + dependencies: + "@lukeed/csprng" "^1.0.0" + undici@^5.21.0: version "5.21.0" resolved "https://registry.yarnpkg.com/undici/-/undici-5.21.0.tgz#b00dfc381f202565ab7f52023222ab862bb2494f" From 1651fd6fefa8ee4776bdab9f4f4f3aafa3814828 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:35:31 +0200 Subject: [PATCH 52/55] :arrow_up:(deps-dev): Bump @nestjs/testing from 9.3.12 to 9.4.0 (#162) Bumps [@nestjs/testing](https://github.com/nestjs/nest) from 9.3.12 to 9.4.0. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.12...v9.4.0) --- updated-dependencies: - dependency-name: "@nestjs/testing" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: Manuel Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 42cc067..aed0019 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@nestjs/cli": "^9.3.0", "@nestjs/schematics": "^9.1.0", - "@nestjs/testing": "^9.3.12", + "@nestjs/testing": "^9.4.0", "@types/cron": "^2.0.1", "@types/express": "^4.17.13", "@types/jest": "28.1.8", diff --git a/yarn.lock b/yarn.lock index a36d810..11cc7bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -888,10 +888,10 @@ boxen "5.1.2" check-disk-space "3.3.1" -"@nestjs/testing@^9.3.12": - version "9.3.12" - resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.3.12.tgz#e02ed34c9a267ba9495ba7f5e3d83d4956e3414f" - integrity sha512-nH274IXEqU4hr4bcb71POe58hYLONt9RcfKKM5ZvOS7wYMnybMpKKR8DkC1WcfE1P2k2GQmQoHeSH5emPtYrBA== +"@nestjs/testing@^9.4.0": + version "9.4.0" + resolved "https://registry.yarnpkg.com/@nestjs/testing/-/testing-9.4.0.tgz#1e5d1e799413e996c9c2da02a89dfefa62c3b70e" + integrity sha512-xZWp363P4otcebg++gSjUcdCfTK0RorORzyFq3aLaSAQOlq8kxfFDRIKzEATR4aOUfqTMMsAA8lhnMJWf35N6A== dependencies: tslib "2.5.0" From c6320b7523041ce1f51cde99197eac4d4914926a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:35:40 +0200 Subject: [PATCH 53/55] :arrow_up:(deps-dev): Bump eslint from 8.37.0 to 8.38.0 (#163) Bumps [eslint](https://github.com/eslint/eslint) from 8.37.0 to 8.38.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.37.0...v8.38.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: Manuel Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index aed0019..3341166 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", - "eslint": "^8.37.0", + "eslint": "^8.38.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.0.0", "jest": "28.1.3", diff --git a/yarn.lock b/yarn.lock index 11cc7bb..c3861d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -459,10 +459,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.37.0": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" - integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== +"@eslint/js@8.38.0": + version "8.38.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" + integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== "@hapi/hoek@^9.0.0": version "9.3.0" @@ -2417,15 +2417,15 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== -eslint@^8.37.0: - version "8.37.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" - integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== +eslint@^8.38.0: + version "8.38.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" + integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.37.0" + "@eslint/js" "8.38.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" From 3d1ca1a5e40fe33b5b887efbbaa96e738f13a9f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:35:51 +0200 Subject: [PATCH 54/55] :arrow_up:(deps): Bump @nestjs/core from 9.3.12 to 9.4.0 (#164) Bumps [@nestjs/core](https://github.com/nestjs/nest) from 9.3.12 to 9.4.0. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/compare/v9.3.12...v9.4.0) --- updated-dependencies: - dependency-name: "@nestjs/core" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: Manuel Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3341166..daf5992 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@jellyfin/sdk": "^0.8.1", "@nestjs/common": "^9.4.0", "@nestjs/config": "^2.2.0", - "@nestjs/core": "^9.3.12", + "@nestjs/core": "^9.4.0", "@nestjs/event-emitter": "^1.3.1", "@nestjs/platform-express": "^9.3.12", "@nestjs/schedule": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index c3861d8..e7e5b23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -820,12 +820,12 @@ lodash "4.17.21" uuid "9.0.0" -"@nestjs/core@^9.3.12": - version "9.3.12" - resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.3.12.tgz#b1c06b56ff5c8ad41e841688c6763aa9748a2395" - integrity sha512-Qe0ZjJo7bOlfudn7KHLppYrt5i4k1nR1+9d5ppYat2bb5knCIT4kIqblj666n+22/2zvsHRiTo015cLyLKsLRQ== +"@nestjs/core@^9.4.0": + version "9.4.0" + resolved "https://registry.yarnpkg.com/@nestjs/core/-/core-9.4.0.tgz#bca5128138fcf9b4668bc524b578f3805a325183" + integrity sha512-yTLryCgFD0462wPe4HIzhyTcDgibt8Stfwb5YzcX7Ma0NM4m8uBIpcPG109KBubp8ZmV85e5mw4rl20qLQQVsQ== dependencies: - uid "2.0.1" + uid "2.0.2" "@nuxtjs/opencollective" "0.3.2" fast-safe-stringify "2.1.1" iterare "1.2.1" From 12febf55ac7db8e3f9247c62367d2cfe29e04f8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 10:36:28 +0200 Subject: [PATCH 55/55] :arrow_up:(deps): Bump rimraf from 4.4.1 to 5.0.0 (#161) Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.4.1 to 5.0.0. - [Release notes](https://github.com/isaacs/rimraf/releases) - [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/rimraf/compare/v4.4.1...v5.0.0) --- updated-dependencies: - dependency-name: rimraf dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index daf5992..a6b3e97 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "libsodium-wrappers": "^0.7.10", "opusscript": "^0.0.8", "reflect-metadata": "^0.1.13", - "rimraf": "^4.4.1", + "rimraf": "^5.0.0", "rxjs": "^7.2.0", "uuid": "^9.0.0", "ws": "^8.13.0", diff --git a/yarn.lock b/yarn.lock index e7e5b23..823b661 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2893,6 +2893,16 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +glob@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.0.0.tgz#034ab2e93644ba702e769c3e0558143d3fbd1612" + integrity sha512-zmp9ZDC6NpDNLujV2W2n+3lH+BafIVZ4/ct+Yj3BMZTH/+bgm/eVjHzeFLwxJrrIGgjjS2eiQLlpurHsNlEAtQ== + dependencies: + fs.realpath "^1.0.0" + minimatch "^9.0.0" + minipass "^5.0.0" + path-scurry "^1.6.4" + glob@^7.0.0, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -3794,6 +3804,11 @@ lru-cache@^7.14.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== +lru-cache@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.0.tgz#daece36a9fc332e93f8e75f3fcfd17900253567c" + integrity sha512-9AEKXzvOZc4BMacFnYiTOlDH/197LNnQIK9wZ6iMB5NXPzuv4bWR/Msv7iUMplkiMQ1qQL+KSv/JF1mZAB5Lrg== + luxon@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.3.0.tgz#d73ab5b5d2b49a461c47cedbc7e73309b4805b48" @@ -3911,6 +3926,13 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" + integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -3928,6 +3950,11 @@ minipass@^4.0.0, minipass@^4.0.2, minipass@^4.2.4: resolved "https://registry.yarnpkg.com/minipass/-/minipass-4.2.5.tgz#9e0e5256f1e3513f8c34691dd68549e85b2c8ceb" integrity sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q== +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + minizlib@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -4223,6 +4250,14 @@ path-scurry@^1.6.1: lru-cache "^7.14.1" minipass "^4.0.2" +path-scurry@^1.6.4: + version "1.6.4" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.4.tgz#020a9449e5382a4acb684f9c7e1283bc5695de66" + integrity sha512-Qp/9IHkdNiXJ3/Kon++At2nVpnhRiPq/aSvQN+H3U1WZbvNRK0RIQK/o4HMqPoXjpuGJUEWpHSs6Mnjxqh3TQg== + dependencies: + lru-cache "^9.0.0" + minipass "^5.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -4518,12 +4553,12 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.4.1.tgz#bd33364f67021c5b79e93d7f4fa0568c7c21b755" - integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== +rimraf@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.0.tgz#5bda14e410d7e4dd522154891395802ce032c2cb" + integrity sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g== dependencies: - glob "^9.2.0" + glob "^10.0.0" run-async@^2.4.0: version "2.4.1"