Skip to content

Commit

Permalink
some users have no large profile_image, others no rare badge (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmattingly authored Jan 4, 2025
1 parent 4814c6d commit 38711af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/agimus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: agimus
description: A helm chart for a discord bot that also runs a mysql db
type: application
version: v2.12.5
appVersion: v2.12.5
version: v2.12.6
appVersion: v2.12.6
22 changes: 11 additions & 11 deletions tasks/wrapped_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ async def wrapped_generation():
async def _generate_wrapped(user_discord_id):
user_member = await bot.current_guild.fetch_member(user_discord_id)
# Presave User's Avatar if needed
avatar = user_member.display_avatar.with_size(512)
await avatar.save(f"./images/profiles/{user_discord_id}_a_512.png")
avatar = user_member.display_avatar.with_size(128)
await avatar.save(f"./images/profiles/{user_discord_id}_a_128.png")

wrapped_data = {
'top_channels': await _generate_wrapped_top_channels(user_discord_id),
Expand Down Expand Up @@ -112,7 +112,7 @@ def _generate_wrapped_mp4(user_discord_id, user_display_name, wrapped_data):
scale_factor = video_width / profile_name_size
profile_name = profile_name.with_effects([Resize(scale_factor)])

profile_image = ImageClip(f"./images/profiles/{user_discord_id}_a_512.png")
profile_image = ImageClip(f"./images/profiles/{user_discord_id}_a_128.png")
profile_image = profile_image.with_effects([Resize(width=400), FadeIn(duration=0.4167)])
profile_image = profile_image.with_duration(4.375).with_start(5.1667).with_position(("center", 350))
profile_image = profile_image.with_mask(profile_image.mask.with_effects([FadeOut(duration=0.8333)]))
Expand Down Expand Up @@ -301,15 +301,15 @@ def _generate_wrapped_mp4(user_discord_id, user_display_name, wrapped_data):

# Rarest Badge
rarest_badge_image = ImageClip(f"./images/badges/{wrapped_data['rarest_badge']['badge_filename']}")
rarest_badge_image = rarest_badge_image.with_effects([Resize(width=500)])
rarest_badge_image = rarest_badge_image.with_duration(3.25).with_start(54.375).with_position(("center", "center"))
rarest_badge_image = rarest_badge_image.with_mask(
rarest_badge_image.mask.with_effects([
FadeOut(duration=0.625)
])
)

if rarest_badge_image:
rarest_badge_image = rarest_badge_image.with_effects([Resize(width=500)])
rarest_badge_image = rarest_badge_image.with_duration(3.25).with_start(54.375).with_position(("center", "center"))
rarest_badge_image = rarest_badge_image.with_mask(
rarest_badge_image.mask.with_effects([
FadeOut(duration=0.625)
])
)

rarest_badge_name = TextClip(text=f"{wrapped_data['rarest_badge']['badge_name']}", font_size=50, color="white", stroke_color="black", stroke_width=2, font="fonts/DS9_Credits.ttf", margin=(20, 20))
rarest_badge_name = rarest_badge_name.with_duration(3.25).with_start(54.375).with_position(("center", 200))
rarest_badge_name = rarest_badge_name.with_mask(
Expand Down

0 comments on commit 38711af

Please sign in to comment.