fix: Incorrect strings and logics (#1619)

This commit is contained in:
aAbed
2024-01-12 04:00:37 +05:45
committed by GitHub
parent 0d45fe4a97
commit 4f22e88e42
6 changed files with 26 additions and 19 deletions

View File

@ -52,12 +52,12 @@ class ManagerAPI {
String? integrationsVersion = '';
bool isDefaultPatchesRepo() {
return getPatchesRepo().toLowerCase() == 'revanced/revanced-patches';
return getPatchesRepo().toLowerCase() == defaultPatchesRepo;
}
bool isDefaultIntegrationsRepo() {
return getIntegrationsRepo().toLowerCase() ==
'revanced/revanced-integrations';
defaultIntegrationsRepo;
}
Future<void> initialize() async {

View File

@ -32,7 +32,7 @@ class RevancedAPI {
final response = await _dio.get('/contributors');
final List<dynamic> repositories = response.data['repositories'];
for (final Map<String, dynamic> repo in repositories) {
final String name = repo['name'];
final String name = repo['name'].toLowerCase();
contributors[name] = repo['contributors'];
}
} on Exception catch (e) {
@ -54,7 +54,7 @@ class RevancedAPI {
final List<dynamic> tools = response.data['tools'];
return tools.firstWhereOrNull(
(t) =>
t['repository'] == repoName &&
(t['repository'] as String).toLowerCase() == repoName.toLowerCase() &&
(t['name'] as String).endsWith(extension),
);
} on Exception catch (e) {