mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-11-03 14:53:28 +01:00 
			
		
		
		
	Add toggle for App ID inferring where optional
This commit is contained in:
		@@ -317,6 +317,7 @@ abstract class AppSource {
 | 
			
		||||
  late String name;
 | 
			
		||||
  bool enforceTrackOnly = false;
 | 
			
		||||
  bool changeLogIfAnyIsMarkDown = true;
 | 
			
		||||
  bool appIdInferIsOptional = false;
 | 
			
		||||
 | 
			
		||||
  AppSource() {
 | 
			
		||||
    name = runtimeType.toString();
 | 
			
		||||
@@ -552,7 +553,8 @@ class SourceProvider {
 | 
			
		||||
      AppSource source, String url, Map<String, dynamic> additionalSettings,
 | 
			
		||||
      {App? currentApp,
 | 
			
		||||
      bool trackOnlyOverride = false,
 | 
			
		||||
      String? overrideSource}) async {
 | 
			
		||||
      String? overrideSource,
 | 
			
		||||
      bool inferAppIdIfOptional = false}) async {
 | 
			
		||||
    if (trackOnlyOverride || source.enforceTrackOnly) {
 | 
			
		||||
      additionalSettings['trackOnly'] = true;
 | 
			
		||||
    }
 | 
			
		||||
@@ -592,8 +594,11 @@ class SourceProvider {
 | 
			
		||||
        : apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
 | 
			
		||||
    return App(
 | 
			
		||||
        currentApp?.id ??
 | 
			
		||||
            await source.tryInferringAppId(standardUrl,
 | 
			
		||||
                additionalSettings: additionalSettings) ??
 | 
			
		||||
            ((!source.appIdInferIsOptional ||
 | 
			
		||||
                    (source.appIdInferIsOptional && inferAppIdIfOptional))
 | 
			
		||||
                ? await source.tryInferringAppId(standardUrl,
 | 
			
		||||
                    additionalSettings: additionalSettings)
 | 
			
		||||
                : null) ??
 | 
			
		||||
            generateTempID(standardUrl, additionalSettings),
 | 
			
		||||
        standardUrl,
 | 
			
		||||
        apk.names.author[0].toUpperCase() + apk.names.author.substring(1),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user