DawnbrandBots / bastion-bot

A Discord bot for displaying information about Yu-Gi-Oh! cards in all official languages.
https://discord.com/application-directory/383854640694820865
GNU Affero General Public License v3.0
10 stars 11 forks source link

/art, /rush-duel art: reduce calls to Yugipedia #436

Closed kevinlul closed 5 months ago

kevinlul commented 6 months ago

/art no longer calls Yugipedia by assuming the Master Duel redirect exists if there is Master Duel rarity data. /rush-duel art reduces calls to Yugipedia by skipping the redirect check when illustrations are already specified. Rework some illustration URL construction logic to create a common yugipediaFileRedirect helper, with unit testing. Add some unit tests for the ArtSwitcher.

Closes #443

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 59.61538% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 45.84%. Comparing base (d87c07b) to head (65b6bff).

Files Patch % Lines
src/commands/rush-duel.ts 40.74% 16 Missing :warning:
src/commands/art.ts 37.50% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #436 +/- ## ========================================== + Coverage 44.29% 45.84% +1.55% ========================================== Files 33 32 -1 Lines 4569 4541 -28 Branches 186 203 +17 ========================================== + Hits 2024 2082 +58 + Misses 2544 2459 -85 + Partials 1 0 -1 ``` | [Flag](https://app.codecov.io/gh/DawnbrandBots/bastion-bot/pull/436/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DawnbrandBots) | Coverage Δ | | |---|---|---| | [contract](https://app.codecov.io/gh/DawnbrandBots/bastion-bot/pull/436/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DawnbrandBots) | `?` | | | [unit](https://app.codecov.io/gh/DawnbrandBots/bastion-bot/pull/436/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DawnbrandBots) | `45.84% <59.61%> (+2.54%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DawnbrandBots#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.