@@ -43,22 +43,26 @@ export class SourceService {
4343 const media = await this . tmdbService . getMediaObject ( 'movie' , tmdbId )
4444
4545 // Try to get IMDB ID
46- media . imdbId = await this . tmdbService . getImdbId ( tmdbId , 'movie' ) ?? ''
46+ media . imdbId = ( await this . tmdbService . getImdbId ( tmdbId , 'movie' ) ) ?? ''
4747
4848 // Fetch from providers and Stremio addons concurrently
4949 const [ providerResults , stremioResult ] = await Promise . all ( [
5050 this . fetchFromProviders ( 'movie' , media ) ,
5151 this . stremioService ?. hasEnabledAddons ( )
52- ? this . stremioService . getMovieSources ( media ) . catch ( ( err ) : ProviderResult => ( {
53- sources : [ ] ,
54- subtitles : [ ] ,
55- diagnostics : [ {
56- code : 'PROVIDER_ERROR' ,
57- message : `Stremio integration failed: ${ err instanceof Error ? err . message : 'Unknown error' } ` ,
58- field : '' ,
59- severity : 'error' ,
60- } ] ,
61- } ) )
52+ ? this . stremioService . getMovieSources ( media ) . catch (
53+ ( err ) : ProviderResult => ( {
54+ sources : [ ] ,
55+ subtitles : [ ] ,
56+ diagnostics : [
57+ {
58+ code : 'PROVIDER_ERROR' ,
59+ message : `Stremio integration failed: ${ err instanceof Error ? err . message : 'Unknown error' } ` ,
60+ field : '' ,
61+ severity : 'error' ,
62+ } ,
63+ ] ,
64+ } )
65+ )
6266 : Promise . resolve ( null ) ,
6367 ] )
6468
@@ -107,22 +111,26 @@ export class SourceService {
107111 const media = await this . tmdbService . getMediaObject ( 'tv' , tmdbId , season , episode )
108112
109113 // Try to get IMDB ID
110- media . imdbId = await this . tmdbService . getImdbId ( tmdbId , 'tv' ) ?? ''
114+ media . imdbId = ( await this . tmdbService . getImdbId ( tmdbId , 'tv' ) ) ?? ''
111115
112116 // Fetch from providers and Stremio addons concurrently
113117 const [ providerResults , stremioResult ] = await Promise . all ( [
114118 this . fetchFromProviders ( 'tv' , media ) ,
115119 this . stremioService ?. hasEnabledAddons ( )
116- ? this . stremioService . getTVSources ( media ) . catch ( ( err ) : ProviderResult => ( {
117- sources : [ ] ,
118- subtitles : [ ] ,
119- diagnostics : [ {
120- code : 'PROVIDER_ERROR' ,
121- message : `Stremio integration failed: ${ err instanceof Error ? err . message : 'Unknown error' } ` ,
122- field : '' ,
123- severity : 'error' ,
124- } ] ,
125- } ) )
120+ ? this . stremioService . getTVSources ( media ) . catch (
121+ ( err ) : ProviderResult => ( {
122+ sources : [ ] ,
123+ subtitles : [ ] ,
124+ diagnostics : [
125+ {
126+ code : 'PROVIDER_ERROR' ,
127+ message : `Stremio integration failed: ${ err instanceof Error ? err . message : 'Unknown error' } ` ,
128+ field : '' ,
129+ severity : 'error' ,
130+ } ,
131+ ] ,
132+ } )
133+ )
126134 : Promise . resolve ( null ) ,
127135 ] )
128136
0 commit comments