Cap the amount of featured shows to be 5
This commit is contained in:
		
							parent
							
								
									3db00d9be5
								
							
						
					
					
						commit
						16a4b6850b
					
				| 
						 | 
				
			
			@ -171,7 +171,7 @@ async def generate_character(anilist):
 | 
			
		|||
        else:
 | 
			
		||||
            text += '\n'
 | 
			
		||||
        to_add = []
 | 
			
		||||
        for i in media:
 | 
			
		||||
        for i in media[:5]:
 | 
			
		||||
            atext = f'<a href="{i["siteUrl"]}">{i["title"]["romaji"]}</a>'
 | 
			
		||||
            if i['title']['english']:
 | 
			
		||||
                atext += f' ({i["title"]["english"]})'
 | 
			
		||||
| 
						 | 
				
			
			@ -181,8 +181,10 @@ async def generate_character(anilist):
 | 
			
		|||
                type = 'Light Novel'
 | 
			
		||||
            else:
 | 
			
		||||
                type = i['type'].capitalize()
 | 
			
		||||
            to_add.append(atext + f' [{type}]')
 | 
			
		||||
            to_add.append(f'{atext} [{type}]')
 | 
			
		||||
        text += '\n'.join(to_add)
 | 
			
		||||
        if len(media) > 5:
 | 
			
		||||
            text += f'\n(and {len(media) - 5} other{"" if len(media) == 6 else "s"})'
 | 
			
		||||
    if description:
 | 
			
		||||
        text += '\n'
 | 
			
		||||
        parser = pyrogram_html.HTML(None)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue