Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue #523 allows a broader range of totalSeasons values #524

Merged
merged 3 commits into from
May 20, 2024

Conversation

ICEPrey
Copy link
Contributor

@ICEPrey ICEPrey commented Apr 27, 2024

What kind of change does this PR introduce?
This PR changes the findIdFromTitle method in the TMDB class. It updates the filtering logic for totalSeasons to allow for a range of +=2 seasons compared to the extraData.totalSeasons value. This change is to resolve the issue where the result demon slayer was not being returned due to strict matching of the totalSeasons value.

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?

no

Summary
This PR addresses an issue where the findIdFromTitle method in the TMDB class was not returning the desired result for the Demon Slayer anime. The issue was caused by strict matching of the totalSeasons value. The changes introduced in this PR update the totalSeasons filtering logic to allow for a range of +=2 seasons which should increase the flexibility in matching the seasons value. The comment describing the filtering logic has also been updated to reflect these changes.
#523 (comment)

Other information

Copy link
Contributor

@riimuru riimuru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test file name should be tmdb.test.ts to stay consistent.

@ICEPrey
Copy link
Contributor Author

ICEPrey commented Apr 29, 2024

oh should I just replace

test('returns a filled object of anime data', async () => {
  const data = await tmdb.fetchMediaInfo('60735', 'tv');
  expect(data).not.toBeNull();
  expect(data.episodes).not.toEqual([]);
  expect(data.description).not.toBeNull();
});

in the main tmdb.test.ts with

test('returns a filled object of anime data', async () => {
  const data = await tmdb.fetchMediaInfo('85937', 'tv');
  expect(data).not.toBeNull();
  expect(data.episodes).not.toEqual([]);
  expect(data.description).not.toBeNull();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected API Response: Internal Server Error
2 participants