This repository was archived by the owner on Jan 31, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments