mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
attached addonId to search and discover
This commit is contained in:
parent
4173786b12
commit
8c449215a6
1 changed files with 14 additions and 4 deletions
|
|
@ -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;
|
||||
export default catalogService;
|
||||
|
|
|
|||
Loading…
Reference in a new issue