Skip to content

Commit

Permalink
feat: show a "lookup" link in multiple results warning
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Jun 11, 2024
1 parent bfb566c commit a45f324
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,11 @@ export abstract class ReleaseLookup<Provider extends MetadataProvider, RawReleas
* Expects a list of URLs pointing to the extra results from the provider.
*/
protected warnMultipleResults(urls: string[] | URL[]) {
const lines = urls.map((url) => `${url} ([lookup](/release?url=${encodeURIComponent(String(url))}))`);
this.addMessage(
`The API also returned ${
pluralWithCount(urls.length, 'other result, which was skipped', 'other results, which were skipped')
}:\n- ${urls.join('\n- ')}`,
}:\n- ${lines.join('\n- ')}`,
'warning',
);
}
Expand Down

0 comments on commit a45f324

Please sign in to comment.