mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-13 13:26:43 +02:00
Update GitLab for new uploads URL scheme (#1742)
This commit is contained in:
@ -131,6 +131,18 @@ class GitLab extends AppSource {
|
||||
|
||||
bool trackOnly = additionalSettings['trackOnly'] == true;
|
||||
|
||||
// Get project ID
|
||||
Response res0 = await sourceRequest(
|
||||
'https://${hosts[0]}/api/v4/projects/${names.author}%2F${names.name}?$optionalAuth',
|
||||
additionalSettings);
|
||||
if (res0.statusCode != 200) {
|
||||
throw getObtainiumHttpError(res0);
|
||||
}
|
||||
int? projectId = jsonDecode(res0.body)['id'];
|
||||
if (projectId == null) {
|
||||
throw NoReleasesError();
|
||||
}
|
||||
|
||||
// Request data from REST API
|
||||
Response res = await sourceRequest(
|
||||
'https://${hosts[0]}/api/v4/projects/${names.author}%2F${names.name}/${trackOnly ? 'repository/tags' : 'releases'}?$optionalAuth',
|
||||
@ -157,7 +169,7 @@ class GitLab extends AppSource {
|
||||
.join('.apk\n')
|
||||
.split('\n')
|
||||
.where((s) => s.startsWith('/uploads/') && s.endsWith('apk'))
|
||||
.map((s) => '$standardUrl$s')
|
||||
.map((s) => 'https://${hosts[0]}/-/project/$projectId$s')
|
||||
.toList();
|
||||
var apkUrlsSet = apkUrlsFromAssets.toSet();
|
||||
apkUrlsSet.addAll(uploadedAPKsFromDescription);
|
||||
|
Reference in New Issue
Block a user