From d867415f0aa8f2453dcdd5ae1a68e39b9d3b200f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?FAY=E3=82=B7?= <103030954+FAYStarNext@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:00:01 +0700 Subject: [PATCH 1/2] chore: Update babel.config.json and package.json dependencies --- babel.config.json | 3 --- package.json | 1 - 2 files changed, 4 deletions(-) diff --git a/babel.config.json b/babel.config.json index 5f611ff..3e7174a 100644 --- a/babel.config.json +++ b/babel.config.json @@ -2,8 +2,5 @@ "presets": [ "@babel/preset-env", "@babel/preset-typescript" - ], - "plugins": [ - "@babel/plugin-proposal-class-properties" ] } \ No newline at end of file diff --git a/package.json b/package.json index 99284cf..51bba42 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "typescript-eslint": "^7.17.0", "@babel/cli": "^7.24.8", "@babel/core": "^7.24.9", - "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.24.8", "@babel/preset-typescript": "^7.24.7" }, From 27c91527d9ab0a2ecbb80ffa8c86bfc1a60794d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?FAY=E3=82=B7?= <103030954+FAYStarNext@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:46:12 +0700 Subject: [PATCH 2/2] chore: Update search cache handling in Manager.ts --- src/structures/Manager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/structures/Manager.ts b/src/structures/Manager.ts index e34b02d..519e154 100644 --- a/src/structures/Manager.ts +++ b/src/structures/Manager.ts @@ -178,7 +178,9 @@ export class Manager extends TypedEmitter { let search = _query.query; let code = this.CheckURL(options.query); if (!/^https?:\/\//.test(search)) search = `${_source}:${search}`; - if (this.search_cache.get(code)) return this.search_cache.get(code); + if (options.cache !== false && this.options.cache.enabled !== false) { + if (this.search_cache.get(code)) return this.search_cache.get(code); + } try { const res = (await node.rest.get(`/v4/loadtracks?identifier=${encodeURIComponent(search)}`)) as LavalinkResponse; if (!res) throw new Error("Query not found.");