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