From 8c449215a63095486bef7ff30e2054b8590e435f Mon Sep 17 00:00:00 2001 From: chrisk325 Date: Tue, 30 Dec 2025 04:12:32 +0530 Subject: [PATCH 1/2] attached addonId to search and discover --- src/services/catalogService.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/services/catalogService.ts b/src/services/catalogService.ts index 9c33266..221b883 100644 --- a/src/services/catalogService.ts +++ b/src/services/catalogService.ts @@ -87,6 +87,7 @@ export interface StreamingContent { imdb_id?: string; slug?: string; releaseInfo?: string; + addonId?: string; traktSource?: 'watchlist' | 'continue-watching' | 'watched'; addonCast?: Array<{ id: number; @@ -1155,7 +1156,10 @@ class CatalogService { const metas = await stremioService.getCatalog(manifest, type, catalog.id, 1, filters); if (metas && metas.length > 0) { - const items = metas.slice(0, limit).map(meta => this.convertMetaToStreamingContent(meta)); + const items = metas.slice(0, limit).map(meta => ({ + ...this.convertMetaToStreamingContent(meta), + addonId: addon.id // Attach addon ID to each result + })); return { addonName: addon.name, items @@ -1232,7 +1236,10 @@ class CatalogService { const metas = await stremioService.getCatalog(manifest, type, catalogId, page, filters); if (metas && metas.length > 0) { - return metas.map(meta => this.convertMetaToStreamingContent(meta)); + return metas.map(meta => ({ + ...this.convertMetaToStreamingContent(meta), + addonId: addonId + })); } return []; } catch (error) { @@ -1525,7 +1532,10 @@ class CatalogService { const metas = response.data?.metas || []; if (metas.length > 0) { - const items = metas.map(meta => this.convertMetaToStreamingContent(meta)); + const items = metas.map(meta => ({ + ...this.convertMetaToStreamingContent(meta), + addonId: addon.id + })); logger.log(`Found ${items.length} results from ${addon.name}`); return items; } @@ -1613,4 +1623,4 @@ class CatalogService { } export const catalogService = CatalogService.getInstance(); -export default catalogService; \ No newline at end of file +export default catalogService; From 42d4290acd9a42ea1d9a92f7cc8eb398d1890aa9 Mon Sep 17 00:00:00 2001 From: chrisk325 Date: Tue, 30 Dec 2025 04:19:19 +0530 Subject: [PATCH 2/2] modify onpress handler to pass addonId --- src/screens/SearchScreen.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screens/SearchScreen.tsx b/src/screens/SearchScreen.tsx index f86417a..9c37096 100644 --- a/src/screens/SearchScreen.tsx +++ b/src/screens/SearchScreen.tsx @@ -906,7 +906,11 @@ const SearchScreen = () => { isGrid && styles.discoverGridItem ]} onPress={() => { - navigation.navigate('Metadata', { id: item.id, type: item.type }); + navigation.navigate('Metadata', { + id: item.id, + type: item.type, + addonId: item.addonId + }); }} onLongPress={() => { setSelectedItem(item);