Show currently aired episode in Anilist

This commit is contained in:
blank X 2020-10-18 12:45:43 +07:00
parent 8b47f2a3b4
commit 3d3c696065
1 changed files with 12 additions and 1 deletions

View File

@ -35,6 +35,12 @@ MEDIA_QUERY = '''query ($id: Int, $search: String) {
airingAt airingAt
timeUntilAiring timeUntilAiring
} }
airingSchedule(notYetAired: true) {
nodes {
airingAt
episode
}
}
siteUrl siteUrl
} }
} }
@ -105,7 +111,12 @@ async def generate_media(anilist):
if average_score is not None: if average_score is not None:
text += f'<b>Average Score:</b> {average_score}%\n' text += f'<b>Average Score:</b> {average_score}%\n'
if episodes: if episodes:
text += f'<b>Episodes:</b> {episodes}\n' text += f'<b>Episodes:</b> '
if anilist['airingSchedule']:
for i in anilist['airingSchedule']['nodes']:
if i['airingAt'] == anilist['nextAiringEpisode']['airingAt']:
text += f'{i["episode"] - 1}/'
text += f'{episodes}\n'
if duration: if duration:
text += f'<b>Duration:</b> {duration} minutes per episode\n' text += f'<b>Duration:</b> {duration} minutes per episode\n'
if chapters: if chapters: