Skip to content

Commit

Permalink
Merge pull request #20 from FAYStarNext/dev
Browse files Browse the repository at this point in the history
Fix: bug cache
  • Loading branch information
EvarinDev authored Jul 27, 2024
2 parents 91825aa + 27c9152 commit 7760417
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 3 additions & 1 deletion src/structures/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ export class Manager extends TypedEmitter<ManagerEvents> {
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.");
Expand Down

0 comments on commit 7760417

Please sign in to comment.