mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Download queue will now be reset if negative. (#485)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							6d0689fe6c
						
					
				
				
					commit
					2d2ff0a29d
				
			| @@ -96,6 +96,10 @@ class DownloadNotifier(private val context: Context) { | ||||
|             if (multipleDownloadThreads) { | ||||
|                 setContentTitle(context.getString(R.string.app_name)) | ||||
|  | ||||
|                 // Reset the queue size if the download progress is negative | ||||
|                 if ((initialQueueSize - queue.size) < 0) | ||||
|                     initialQueueSize = queue.size | ||||
|  | ||||
|                 setContentText(context.getString(R.string.chapter_downloading_progress) | ||||
|                         .format(initialQueueSize - queue.size, initialQueueSize)) | ||||
|                 setProgress(initialQueueSize, initialQueueSize - queue.size, false) | ||||
| @@ -161,6 +165,9 @@ class DownloadNotifier(private val context: Context) { | ||||
|             setProgress(0, 0, false) | ||||
|         } | ||||
|         context.notificationManager.notify(Constants.NOTIFICATION_DOWNLOAD_CHAPTER_ERROR_ID, notificationBuilder.build()) | ||||
|  | ||||
|         // Reset download information | ||||
|         onClear() | ||||
|         isDownloading = false | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user