| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -28,6 +28,7 @@ import kotlinx.coroutines.Job | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlinx.coroutines.delay | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.delay | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.catch | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.catch | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.conflate | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.conflate | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.flowOn | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.map | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.flow.map | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlinx.coroutines.launch | 
					 | 
					 | 
					 | 
					import kotlinx.coroutines.launch | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import kotlin.math.max | 
					 | 
					 | 
					 | 
					import kotlin.math.max | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -104,7 +105,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private fun upRecyclerData() { | 
					 | 
					 | 
					 | 
					    private fun upRecyclerData() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        booksFlowJob?.cancel() | 
					 | 
					 | 
					 | 
					        booksFlowJob?.cancel() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        booksFlowJob = launch(Dispatchers.Default) { | 
					 | 
					 | 
					 | 
					        booksFlowJob = launch { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            when (groupId) { | 
					 | 
					 | 
					 | 
					            when (groupId) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                AppConst.bookGroupAllId -> appDb.bookDao.flowAll() | 
					 | 
					 | 
					 | 
					                AppConst.bookGroupAllId -> appDb.bookDao.flowAll() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                AppConst.bookGroupLocalId -> appDb.bookDao.flowLocal() | 
					 | 
					 | 
					 | 
					                AppConst.bookGroupLocalId -> appDb.bookDao.flowLocal() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -120,7 +121,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    3 -> list.sortedBy { it.order } | 
					 | 
					 | 
					 | 
					                    3 -> list.sortedBy { it.order } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    else -> list.sortedByDescending { it.durChapterTime } | 
					 | 
					 | 
					 | 
					                    else -> list.sortedByDescending { it.durChapterTime } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }.catch { | 
					 | 
					 | 
					 | 
					            }.flowOn(Dispatchers.Default).catch { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                AppLog.put("书架更新出错", it) | 
					 | 
					 | 
					 | 
					                AppLog.put("书架更新出错", it) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }.conflate().collect { list -> | 
					 | 
					 | 
					 | 
					            }.conflate().collect { list -> | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                binding.tvEmptyMsg.isGone = list.isNotEmpty() | 
					 | 
					 | 
					 | 
					                binding.tvEmptyMsg.isGone = list.isNotEmpty() | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |