Skip to content

Commit

Permalink
Remove unrelated plugins from search
Browse files Browse the repository at this point in the history
  • Loading branch information
justjam2013 authored and bwp91 committed Dec 13, 2024
1 parent 0f030be commit 77d8198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/plugins/plugins.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ export class PluginsService {
let searchResults: INpmSearchResults

try {
searchResults = (await firstValueFrom(this.httpService.get(`https://registry.npmjs.org/-/v1/search?text=${q}`))).data
searchResults = (await firstValueFrom(this.httpService.get(`https://api.npms.io/v2/search?q=${q}`))).data
} catch (e) {
this.logger.error(`Failed to search the npm registry - "${e.message}" - see https://homebridge.io/w/JJSz6 for help.`)
throw new InternalServerErrorException(`Failed to search the npm registry - "${e.message}" - see logs.`)
}

const result: HomebridgePlugin[] = searchResults.objects
const result: HomebridgePlugin[] = searchResults.results
.filter(x => x.package.name.indexOf('homebridge-') === 0 || this.isScopedPlugin(x.package.name))
.filter(x => !this.hiddenPlugins.includes(x.package.name))
.map((pkg) => {
Expand Down

0 comments on commit 77d8198

Please sign in to comment.