mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-21 00:32:04 +00:00
fixes
This commit is contained in:
parent
b5b61d05f8
commit
a67c34f8f6
3 changed files with 4 additions and 34 deletions
|
|
@ -776,14 +776,6 @@ const AddonsScreen = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRemoveAddon = (addon: ExtendedManifest) => {
|
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');
|
setAlertTitle('Uninstall Addon');
|
||||||
setAlertMessage(`Are you sure you want to uninstall ${addon.name}?`);
|
setAlertMessage(`Are you sure you want to uninstall ${addon.name}?`);
|
||||||
setAlertActions([
|
setAlertActions([
|
||||||
|
|
|
||||||
|
|
@ -932,7 +932,7 @@ class SyncService {
|
||||||
.map(r => r.addon_id as string)
|
.map(r => r.addon_id as string)
|
||||||
.map(async id => {
|
.map(async id => {
|
||||||
if (localIds.has(id)) return null; // Don't delete if still installed locally
|
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 user explicitly removed this addon locally, prefer local removal and delete remotely
|
||||||
if (removedList.includes(id)) return id;
|
if (removedList.includes(id)) return id;
|
||||||
return id; // Delete other addons that are no longer installed locally
|
return id; // Delete other addons that are no longer installed locally
|
||||||
|
|
|
||||||
|
|
@ -539,11 +539,7 @@ class StremioService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeAddon(id: string): Promise<void> {
|
async removeAddon(id: string): Promise<void> {
|
||||||
// Prevent removal of Cinemeta as it's a pre-installed addon
|
// Allow removal of any addon, including pre-installed ones like Cinemeta
|
||||||
if (id === 'com.linvo.cinemeta') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.installedAddons.has(id)) {
|
if (this.installedAddons.has(id)) {
|
||||||
this.installedAddons.delete(id);
|
this.installedAddons.delete(id);
|
||||||
// Remove from order
|
// Remove from order
|
||||||
|
|
@ -568,25 +564,6 @@ class StremioService {
|
||||||
const result = this.addonOrder
|
const result = this.addonOrder
|
||||||
.filter(id => this.installedAddons.has(id))
|
.filter(id => this.installedAddons.has(id))
|
||||||
.map(id => this.installedAddons.get(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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -597,7 +574,8 @@ class StremioService {
|
||||||
|
|
||||||
// Check if an addon is pre-installed and cannot be removed
|
// Check if an addon is pre-installed and cannot be removed
|
||||||
isPreInstalledAddon(id: string): boolean {
|
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
|
// Check if user has explicitly removed an addon
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue