| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -90,13 +90,14 @@ class ImportBookSourceViewModel(app: Application) : BaseViewModel(app) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            val mText = text.trim() | 
					 | 
					 | 
					 | 
					            val mText = text.trim() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            when { | 
					 | 
					 | 
					 | 
					            when { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mText.isJsonObject() -> { | 
					 | 
					 | 
					 | 
					                mText.isJsonObject() -> { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    val json = JsonPath.parse(mText) | 
					 | 
					 | 
					 | 
					                    kotlin.runCatching { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    val urls = json.read<List<String>>("$.sourceUrls") | 
					 | 
					 | 
					 | 
					                        val json = JsonPath.parse(mText) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!urls.isNullOrEmpty()) { | 
					 | 
					 | 
					 | 
					                        json.read<List<String>>("$.sourceUrls") | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        urls.forEach { | 
					 | 
					 | 
					 | 
					                    }.onSuccess { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        it.forEach { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            importSourceUrl(it) | 
					 | 
					 | 
					 | 
					                            importSourceUrl(it) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        } | 
					 | 
					 | 
					 | 
					                        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					 | 
					                    }.onFailure { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        BookSource.fromJson(mText).getOrThrow().let { | 
					 | 
					 | 
					 | 
					                        BookSource.fromJson(mText).getOrThrow().let { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            allSources.add(it) | 
					 | 
					 | 
					 | 
					                            allSources.add(it) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        } | 
					 | 
					 | 
					 | 
					                        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |