mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 21:15:37 +02:00
feat: Merge integrations if a patch or any of its dependencies need them
This commit is contained in:
parent
9561153bfb
commit
d84230fa22
1 changed files with 12 additions and 1 deletions
|
@ -87,10 +87,21 @@ class PatcherAPI {
|
|||
.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 {
|
||||
return selectedPatches.any(
|
||||
(patch) => patch.dependencies.any(
|
||||
(dep) => dep.contains('integrations'),
|
||||
(dep) => dependencyNeedsIntegrations(dep),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue