Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.

Commit 928b9a1

Browse files
committed
fix: tmdb right now fail requests for feature series
Signed-off-by: Igor Sachivka <juicy.igor@gmail.com>
1 parent 9bc528f commit 928b9a1

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

src/mcp/tmdb.tool.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,23 @@ export class TmdbTool {
5353
},
5454
],
5555
};
56-
} catch (error) {
56+
} catch {
5757
return {
5858
content: [
5959
{
6060
type: 'text',
61-
text: `Error getting season information: ${error.message}`,
61+
text: JSON.stringify(
62+
{
63+
showTitle: title,
64+
originalTitle: title,
65+
seasonNumber: seasonNumber,
66+
totalEpisodes: 0,
67+
airedEpisodes: 0,
68+
schedule: 'No information available',
69+
},
70+
null,
71+
2,
72+
),
6273
},
6374
],
6475
};

src/tmdb/tmdb.controller.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ export class TmdbController {
77

88
@Get('season-info')
99
async getSeasonInfo(@Query('title') title: string, @Query('seasonNumber') seasonNumber: number) {
10-
const show = await this.tmdbService.searchShow(title);
10+
try {
11+
const show = await this.tmdbService.searchShow(title);
1112

12-
if (!show) {
13-
throw new Error('TV show "Rick and Morty" not found in TMDB');
14-
}
13+
if (!show) {
14+
throw new Error('TV show "Rick and Morty" not found in TMDB');
15+
}
1516

16-
try {
1717
const seasonInfo = await this.tmdbService.getSeasonDetails(show.id, seasonNumber);
1818

1919
return {
@@ -27,8 +27,8 @@ export class TmdbController {
2727
} catch (error) {
2828
console.error(error);
2929
return {
30-
showTitle: show ? show.name : title,
31-
originalTitle: show ? show.original_name : seasonNumber,
30+
showTitle: title,
31+
originalTitle: title,
3232
seasonNumber: seasonNumber,
3333
totalEpisodes: 0,
3434
airedEpisodes: 0,

0 commit comments

Comments
 (0)