From 01d86198ba8261cbfa2d9e8139dab560b0bd1638 Mon Sep 17 00:00:00 2001 From: tapframe Date: Mon, 30 Jun 2025 19:40:51 +0530 Subject: [PATCH] Add Cinemeta addon to AddonsScreen and improve community addons loading logic This update introduces the Cinemeta addon with its details and ensures it is added to the community addons list while preventing duplication. Additionally, the loading logic has been adjusted to display Cinemeta even if the community addons fail to load, enhancing user experience and reliability. --- src/screens/AddonsScreen.tsx | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/screens/AddonsScreen.tsx b/src/screens/AddonsScreen.tsx index c9b39bb5..39804a0c 100644 --- a/src/screens/AddonsScreen.tsx +++ b/src/screens/AddonsScreen.tsx @@ -586,6 +586,22 @@ const createStyles = (colors: any) => StyleSheet.create({ }, }); +// Cinemeta addon details +const cinemetaAddon: CommunityAddon = { + transportUrl: 'https://v3-cinemeta.strem.io/manifest.json', + manifest: { + id: 'com.linvo.cinemeta', + version: '3.0.13', + name: 'Cinemeta', + description: 'Provides metadata for movies and series from TheTVDB, TheMovieDB, etc.', + logo: 'https://static.strem.io/addons/cinemeta.png', + types: ['movie', 'series'], + behaviorHints: { + configurable: false + } + } as ExtendedManifest, +}; + const AddonsScreen = () => { const navigation = useNavigation>(); const [addons, setAddons] = useState([]); @@ -653,11 +669,18 @@ const AddonsScreen = () => { try { const response = await axios.get('https://stremio-addons.com/catalog.json'); // Filter out addons without a manifest or transportUrl (basic validation) - const validAddons = response.data.filter(addon => addon.manifest && addon.transportUrl); - setCommunityAddons(validAddons); + let validAddons = response.data.filter(addon => addon.manifest && addon.transportUrl); + + // Filter out Cinemeta if it's already in the community list to avoid duplication + validAddons = validAddons.filter(addon => addon.manifest.id !== 'com.linvo.cinemeta'); + + // Add Cinemeta to the beginning of the list + setCommunityAddons([cinemetaAddon, ...validAddons]); } catch (error) { logger.error('Failed to load community addons:', error); setCommunityError('Failed to load community addons. Please try again later.'); + // Still show Cinemeta if the community list fails to load + setCommunityAddons([cinemetaAddon]); } finally { setCommunityLoading(false); }