mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-10 17:10:15 +02:00
Add F-Droid changelogs (#1255)
This commit is contained in:
@@ -85,17 +85,30 @@ class FDroid extends AppSource {
|
|||||||
try {
|
try {
|
||||||
var res = await sourceRequest(
|
var res = await sourceRequest(
|
||||||
'https://gitlab.com/fdroid/fdroiddata/-/raw/master/metadata/$appId.yml');
|
'https://gitlab.com/fdroid/fdroiddata/-/raw/master/metadata/$appId.yml');
|
||||||
String author = res.body
|
var lines = res.body.split('\n');
|
||||||
.split('\n')
|
String author = lines
|
||||||
.where((l) => l.startsWith('AuthorName: '))
|
.where((l) => l.startsWith('AuthorName: '))
|
||||||
.first
|
.first
|
||||||
.split(': ')
|
.split(': ')
|
||||||
.sublist(1)
|
.sublist(1)
|
||||||
.join(': ');
|
.join(': ');
|
||||||
details.names.author = author;
|
details.names.author = author;
|
||||||
|
var changelogUrls = lines.where((l) => l.startsWith('Changelog: '));
|
||||||
|
if (changelogUrls.isNotEmpty) {
|
||||||
|
details.changeLog = changelogUrls.first;
|
||||||
|
details.changeLog = (await sourceRequest(details.changeLog!
|
||||||
|
.split(': ')
|
||||||
|
.sublist(1)
|
||||||
|
.join(': ')
|
||||||
|
.replaceFirst('/blob/', '/raw/')))
|
||||||
|
.body;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Fail silently
|
// Fail silently
|
||||||
}
|
}
|
||||||
|
if ((details.changeLog?.length ?? 0) > 1000) {
|
||||||
|
details.changeLog = '${details.changeLog!.substring(0, 2048)}...';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return details;
|
return details;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user