fixed type errors and syntax errors from merged PR.

This commit is contained in:
tapframe 2025-12-30 18:55:03 +05:30
parent 916eeaef4c
commit 154d034e8f
6 changed files with 43 additions and 43 deletions

View file

@ -678,8 +678,8 @@ const AppleTVHero: React.FC<AppleTVHeroProps> = ({
banner: currentItem.banner, banner: currentItem.banner,
releaseInfo: currentItem.releaseInfo, releaseInfo: currentItem.releaseInfo,
genres: currentItem.genres genres: currentItem.genres
} }
}; };
// Add resume data if we have progress that's not near completion // Add resume data if we have progress that's not near completion
if (shouldResume && watchProgress) { if (shouldResume && watchProgress) {

View file

@ -997,14 +997,14 @@ const ContinueWatchingSection = React.forwardRef<ContinueWatchingRef>((props, re
navigation.navigate('Streams', { navigation.navigate('Streams', {
id: item.id, id: item.id,
type: item.type, type: item.type,
episodeId: episodeId episodeId: episodeId,
addonId: item.addonId addonId: item.addonId
}); });
} else { } else {
// For movies or series without specific episode, navigate to main content // For movies or series without specific episode, navigate to main content
navigation.navigate('Streams', { navigation.navigate('Streams', {
id: item.id, id: item.id,
type: item.type type: item.type,
addonId: item.addonId addonId: item.addonId
}); });
} }

View file

@ -196,37 +196,37 @@ export const ThisWeekSection = React.memo(() => {
}, [calendarData]); }, [calendarData]);
const handleEpisodePress = (episode: ThisWeekEpisode) => { const handleEpisodePress = (episode: ThisWeekEpisode) => {
// For grouped episodes, always go to series details // For grouped episodes, always go to series details
if (episode.isGroup) { if (episode.isGroup) {
navigation.navigate('Metadata', { navigation.navigate('Metadata', {
id: episode.seriesId, id: episode.seriesId,
type: 'series', type: 'series',
addonId: episode.addonId, addonId: episode.addonId,
}); });
return; return;
} }
// For upcoming episodes, go to the metadata screen // For upcoming episodes, go to the metadata screen
if (!episode.isReleased) { if (!episode.isReleased) {
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Metadata', {
id: episode.seriesId,
type: 'series',
episodeId,
addonId: episode.addonId,
});
return;
}
// For released episodes, go to the streams screen
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`; const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Metadata', { navigation.navigate('Streams', {
id: episode.seriesId, id: episode.seriesId,
type: 'series', type: 'series',
episodeId, episodeId,
addonId: episode.addonId, addonId: episode.addonId,
}); });
return; };
}
// For released episodes, go to the streams screen
const episodeId = `${episode.seriesId}:${episode.season}:${episode.episode}`;
navigation.navigate('Streams', {
id: episode.seriesId,
type: 'series',
episodeId,
addonId: episode.addonId,
});
};
const handleViewAll = () => { const handleViewAll = () => {
navigation.navigate('Calendar' as any); navigation.navigate('Calendar' as any);

View file

@ -219,7 +219,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
overview: tmdbEpisode.overview || '', overview: tmdbEpisode.overview || '',
vote_average: tmdbEpisode.vote_average || 0, vote_average: tmdbEpisode.vote_average || 0,
still_path: tmdbEpisode.still_path || null, still_path: tmdbEpisode.still_path || null,
season_poster_path: tmdbEpisode.season_poster_path || null season_poster_path: tmdbEpisode.season_poster_path || null,
addonId: series.addonId, addonId: series.addonId,
}; };
@ -246,7 +246,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
overview: '', overview: '',
vote_average: 0, vote_average: 0,
still_path: null, still_path: null,
season_poster_path: null season_poster_path: null,
addonId: series.addonId, addonId: series.addonId,
} }
}; };
@ -267,7 +267,7 @@ export const useCalendarData = (): UseCalendarDataReturn => {
overview: '', overview: '',
vote_average: 0, vote_average: 0,
still_path: null, still_path: null,
season_poster_path: null season_poster_path: null,
addonId: series.addonId, addonId: series.addonId,
} }
}; };

View file

@ -123,6 +123,7 @@ export type RootStackParamList = {
}; };
resumeTime?: number; resumeTime?: number;
duration?: number; duration?: number;
addonId?: string;
}; };
PlayerIOS: { PlayerIOS: {
uri: string; uri: string;

View file

@ -88,7 +88,6 @@ export interface StreamingContent {
imdb_id?: string; imdb_id?: string;
slug?: string; slug?: string;
releaseInfo?: string; releaseInfo?: string;
addonId?: string;
traktSource?: 'watchlist' | 'continue-watching' | 'watched'; traktSource?: 'watchlist' | 'continue-watching' | 'watched';
addonCast?: Array<{ addonCast?: Array<{
id: number; id: number;
@ -376,7 +375,7 @@ class CatalogService {
if (metas && metas.length > 0) { if (metas && metas.length > 0) {
// Cap items per catalog to reduce memory and rendering load // Cap items per catalog to reduce memory and rendering load
const limited = metas.slice(0, 12); const limited = metas.slice(0, 12);
const items = limited.map(meta => this.convertMetaToStreamingContent(meta)); const items = limited.map(meta => this.convertMetaToStreamingContent(meta, addon.id));
// Get potentially custom display name; if customized, respect it as-is // Get potentially custom display name; if customized, respect it as-is
const originalName = catalog.name || catalog.id; const originalName = catalog.name || catalog.id;
@ -468,7 +467,7 @@ class CatalogService {
const metas = await stremioService.getCatalog(manifest, type, catalog.id, 1, filters); const metas = await stremioService.getCatalog(manifest, type, catalog.id, 1, filters);
if (metas && metas.length > 0) { if (metas && metas.length > 0) {
const items = metas.map(meta => this.convertMetaToStreamingContent(meta)); const items = metas.map(meta => this.convertMetaToStreamingContent(meta, addon.id));
// Get potentially custom display name // Get potentially custom display name
const displayName = await getCatalogDisplayName(addon.id, catalog.type, catalog.id, catalog.name); const displayName = await getCatalogDisplayName(addon.id, catalog.type, catalog.id, catalog.name);
@ -705,7 +704,7 @@ class CatalogService {
}); });
// Add to recent content using enhanced conversion for full metadata // Add to recent content using enhanced conversion for full metadata
const content = this.convertMetaToStreamingContentEnhanced(meta); const content = this.convertMetaToStreamingContentEnhanced(meta, preferredAddonId);
this.addToRecentContent(content); this.addToRecentContent(content);
// Check if it's in the library // Check if it's in the library
@ -799,7 +798,7 @@ class CatalogService {
if (meta) { if (meta) {
// Use basic conversion without enhanced metadata processing // Use basic conversion without enhanced metadata processing
const content = this.convertMetaToStreamingContent(meta); const content = this.convertMetaToStreamingContent(meta, preferredAddonId);
// Check if it's in the library // Check if it's in the library
content.inLibrary = this.library[`${type}:${id}`] !== undefined; content.inLibrary = this.library[`${type}:${id}`] !== undefined;
@ -818,7 +817,7 @@ class CatalogService {
} }
} }
private convertMetaToStreamingContent(meta: Meta): StreamingContent { private convertMetaToStreamingContent(meta: Meta, addonId?: string): StreamingContent {
// Basic conversion for catalog display - no enhanced metadata processing // Basic conversion for catalog display - no enhanced metadata processing
// Use addon's poster if available, otherwise use placeholder // Use addon's poster if available, otherwise use placeholder
let posterUrl = meta.poster; let posterUrl = meta.poster;
@ -853,7 +852,7 @@ class CatalogService {
} }
// Enhanced conversion for detailed metadata (used only when fetching individual content details) // Enhanced conversion for detailed metadata (used only when fetching individual content details)
private convertMetaToStreamingContentEnhanced(meta: Meta): StreamingContent { private convertMetaToStreamingContentEnhanced(meta: Meta, addonId?: string): StreamingContent {
// Enhanced conversion to utilize all available metadata from addons // Enhanced conversion to utilize all available metadata from addons
const converted: StreamingContent = { const converted: StreamingContent = {
id: meta.id, id: meta.id,
@ -1239,10 +1238,10 @@ class CatalogService {
const metas = await stremioService.getCatalog(manifest, type, catalogId, page, filters); const metas = await stremioService.getCatalog(manifest, type, catalogId, page, filters);
if (metas && metas.length > 0) { if (metas && metas.length > 0) {
return metas.map(meta => ({ return metas.map(meta => ({
...this.convertMetaToStreamingContent(meta), ...this.convertMetaToStreamingContent(meta),
addonId: addonId addonId: addonId
})); }));
} }
return []; return [];
} catch (error) { } catch (error) {
@ -1537,7 +1536,7 @@ class CatalogService {
if (metas.length > 0) { if (metas.length > 0) {
const items = metas.map(meta => ({ const items = metas.map(meta => ({
...this.convertMetaToStreamingContent(meta), ...this.convertMetaToStreamingContent(meta),
addonId: addon.id addonId: addon.id
})); }));
logger.log(`Found ${items.length} results from ${addon.name}`); logger.log(`Found ${items.length} results from ${addon.name}`);
return items; return items;