Skip to content

Commit

Permalink
Automated code formatting
Browse files Browse the repository at this point in the history
Signed-off-by: jankarikiduniya <jankarikiduniya@users.noreply.github.com>
  • Loading branch information
TheTeamAlexa authored and jankarikiduniya committed Mar 6, 2023
1 parent d680108 commit a9115dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
1 change: 0 additions & 1 deletion AlexaMusic/utils/database/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# All rights reserved. © Alisha © Alexa © Yukki



from typing import Dict, List, Union
from AlexaMusic.core.mongo import mongodb

Expand Down
24 changes: 16 additions & 8 deletions AlexaMusic/utils/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,18 @@ async def gen_thumb(videoid, user_id, theme):

try:
wxyz = await app.get_profile_photos(user_id)
wxy = await app.download_media(wxyz[0]['file_id'], file_name=f'{user_id}.jpg')
wxy = await app.download_media(
wxyz[0]["file_id"], file_name=f"{user_id}.jpg"
)
except:
hehe = await app.get_profile_photos(app.id)
wxy = await app.download_media(hehe[0]['file_id'], file_name=f'{app.id}.jpg')
wxy = await app.download_media(
hehe[0]["file_id"], file_name=f"{app.id}.jpg"
)
xy = Image.open(wxy)
a = Image.new('L', [640, 640], 0)
a = Image.new("L", [640, 640], 0)
b = ImageDraw.Draw(a)
b.pieslice([(0, 0), (640,640)], 0, 360, fill = 255, outline = "white")
b.pieslice([(0, 0), (640, 640)], 0, 360, fill=255, outline="white")
c = np.array(xy)
d = np.array(a)
e = np.dstack((c, d))
Expand Down Expand Up @@ -212,14 +216,18 @@ async def gen_qthumb(videoid, user_id, theme):

try:
wxyz = await app.get_profile_photos(user_id)
wxy = await app.download_media(wxyz[0]['file_id'], file_name=f'{user_id}.jpg')
wxy = await app.download_media(
wxyz[0]["file_id"], file_name=f"{user_id}.jpg"
)
except:
hehe = await app.get_profile_photos(app.id)
wxy = await app.download_media(hehe[0]['file_id'], file_name=f'{app.id}.jpg')
wxy = await app.download_media(
hehe[0]["file_id"], file_name=f"{app.id}.jpg"
)
xy = Image.open(wxy)
a = Image.new('L', [640, 640], 0)
a = Image.new("L", [640, 640], 0)
b = ImageDraw.Draw(a)
b.pieslice([(0, 0), (640,640)], 0, 360, fill = 255, outline = "white")
b.pieslice([(0, 0), (640, 640)], 0, 360, fill=255, outline="white")
c = np.array(xy)
d = np.array(a)
e = np.dstack((c, d))
Expand Down

0 comments on commit a9115dc

Please sign in to comment.