mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 05:54:26 +02:00
feat: Merge integrations if a patch or any of its dependencies need them
This commit is contained in:
parent
9561153bfb
commit
d84230fa22
@ -87,10 +87,21 @@ class PatcherAPI {
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool dependencyNeedsIntegrations(String name) {
|
||||||
|
return name.contains('integrations') ||
|
||||||
|
_patches.any(
|
||||||
|
(patch) =>
|
||||||
|
patch.name == name &&
|
||||||
|
(patch.dependencies.any(
|
||||||
|
(dep) => dependencyNeedsIntegrations(dep),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.any(
|
(patch) => patch.dependencies.any(
|
||||||
(dep) => dep.contains('integrations'),
|
(dep) => dependencyNeedsIntegrations(dep),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user