do not update alias check progress on each iteration
This commit is contained in:
		
							
								
								
									
										4
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.py
									
									
									
									
									
								
							@@ -311,11 +311,13 @@ async def check_aliases(msg: Message):
 | 
				
			|||||||
        await resp.edit_text(f'Checking aliases {progress}/{len(tags)}\n\n{l}', parse_mode=ParseMode.HTML)
 | 
					        await resp.edit_text(f'Checking aliases {progress}/{len(tags)}\n\n{l}', parse_mode=ParseMode.HTML)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for sub in tags:
 | 
					    for sub in tags:
 | 
				
			||||||
 | 
					        replaced_tags = False
 | 
				
			||||||
        for subtag in sub.split():
 | 
					        for subtag in sub.split():
 | 
				
			||||||
            if replacements := await e621.get_tag_aliases(subtag):
 | 
					            if replacements := await e621.get_tag_aliases(subtag):
 | 
				
			||||||
                lines.append(f'- {subtag} -> {replacements[0]}, (<code>{sub}</code>)')
 | 
					                lines.append(f'- {subtag} -> {replacements[0]}, (<code>{sub}</code>)')
 | 
				
			||||||
 | 
					                replaced_tags = False
 | 
				
			||||||
        progress += 1
 | 
					        progress += 1
 | 
				
			||||||
        if progress % 20 == 0:
 | 
					        if replaced_tags:
 | 
				
			||||||
            await send_progress()
 | 
					            await send_progress()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await send_progress()
 | 
					    await send_progress()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user