Skip to content

Commit

Permalink
fix npm search max character limit
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 30, 2024
1 parent 7d4506d commit 569b80c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
### Other Changes

- dependency updates
- fix npm search max character limit

## v4.63.0 (2024-11-17)

Expand Down
7 changes: 6 additions & 1 deletion src/modules/plugins/plugins.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ export class PluginsService {
await this.getInstalledPlugins()
}

const q = `${(!query || !query.length) ? '' : `${query}+`}keywords:homebridge-plugin+not:deprecated&size=30`
if ((query.indexOf('homebridge-') === 0 || this.isScopedPlugin(query)) && !this.hiddenPlugins.includes(query.toLowerCase())) {
return await this.searchNpmRegistrySingle(query.toLowerCase())
}

// There seems to be a new 64-character limit on the text query (which allows for 15 characters of query)
const q = `${(!query || !query.length) ? '' : `${query.substring(0, 15)}+`}keywords:homebridge-plugin+not:deprecated&size=30`
let searchResults: INpmSearchResults

try {
Expand Down

0 comments on commit 569b80c

Please sign in to comment.