diff --git a/src/screens/AddonsScreen.tsx b/src/screens/AddonsScreen.tsx index 2f9fd8b..109f562 100644 --- a/src/screens/AddonsScreen.tsx +++ b/src/screens/AddonsScreen.tsx @@ -776,14 +776,6 @@ const AddonsScreen = () => { }; const handleRemoveAddon = (addon: ExtendedManifest) => { - // Check if this is a pre-installed addon - if (stremioService.isPreInstalledAddon(addon.id)) { - setAlertTitle('Cannot Remove Addon'); - setAlertMessage(`${addon.name} is a pre-installed addon and cannot be removed.`); - setAlertActions([{ label: 'OK', onPress: () => setAlertVisible(false) }]); - setAlertVisible(true); - return; - } setAlertTitle('Uninstall Addon'); setAlertMessage(`Are you sure you want to uninstall ${addon.name}?`); setAlertActions([ diff --git a/src/services/SyncService.ts b/src/services/SyncService.ts index d3582a2..3c4783a 100644 --- a/src/services/SyncService.ts +++ b/src/services/SyncService.ts @@ -932,7 +932,7 @@ class SyncService { .map(r => r.addon_id as string) .map(async id => { if (localIds.has(id)) return null; // Don't delete if still installed locally - if (id === 'com.linvo.cinemeta') return null; // Never delete Cinemeta + // If user removed Cinemeta locally, allow server deletion as well // If user explicitly removed this addon locally, prefer local removal and delete remotely if (removedList.includes(id)) return id; return id; // Delete other addons that are no longer installed locally diff --git a/src/services/stremioService.ts b/src/services/stremioService.ts index 71c8c2e..18dad88 100644 --- a/src/services/stremioService.ts +++ b/src/services/stremioService.ts @@ -539,11 +539,7 @@ class StremioService { } async removeAddon(id: string): Promise { - // Prevent removal of Cinemeta as it's a pre-installed addon - if (id === 'com.linvo.cinemeta') { - return; - } - + // Allow removal of any addon, including pre-installed ones like Cinemeta if (this.installedAddons.has(id)) { this.installedAddons.delete(id); // Remove from order @@ -568,25 +564,6 @@ class StremioService { const result = this.addonOrder .filter(id => this.installedAddons.has(id)) .map(id => this.installedAddons.get(id)!); - // Ensure pre-installed presence - const cinId = 'com.linvo.cinemeta'; - const osId = 'org.stremio.opensubtitlesv3'; - if (!result.find(a => a.id === cinId) && this.installedAddons.has(cinId)) { - result.unshift(this.installedAddons.get(cinId)!); - } - // Only include OpenSubtitles if user hasn't explicitly removed it - if (!result.find(a => a.id === osId) && this.installedAddons.has(osId)) { - // Check if user has removed OpenSubtitles (async check, but we'll handle it synchronously for now) - // For now, we'll rely on the fact that if user removed it, it shouldn't be in installedAddons - // Put OpenSubtitles right after Cinemeta if possible, else at start - const cinIdx = result.findIndex(a => a.id === cinId); - const osManifest = this.installedAddons.get(osId)!; - if (cinIdx >= 0) { - result.splice(cinIdx + 1, 0, osManifest); - } else { - result.unshift(osManifest); - } - } return result; } @@ -597,7 +574,8 @@ class StremioService { // Check if an addon is pre-installed and cannot be removed isPreInstalledAddon(id: string): boolean { - return id === 'com.linvo.cinemeta'; + // Allow removing all addons, including Cinemeta + return false; } // Check if user has explicitly removed an addon