Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions url1/event_today.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,23 @@
def set_current_community_photo():
"""As of June 2026, the first image seen when loading up Wii Room will be one uploaded by the community
in the Discord server. We cycle through selected images every 24h at random."""
photos = os.listdir(config.community_photos_dir)
if len(photos) == 0:
# Empty, do nothing
return

# Pick at random
idx = random.randint(0, len(photos) - 1)
photo_name = photos[idx]

full_path = os.path.join(config.community_photos_dir, photo_name)
intro_assets_path = f"assets/normal-intro/1-1.img"
with app.app_context():
photos = os.listdir(config.community_photos_dir)
if len(photos) == 0:
# Empty, do nothing
return

# Pick at random
photo_name = random.choice(photos)

full_path = os.path.join(config.community_photos_dir, photo_name)
first_intro_info_id = (
IntroInfo.query.order_by(IntroInfo.position.asc()).first().cnt_id
)
intro_assets_path = f"assets/normal-intro/{first_intro_info_id}-1.img"

# Copy and rename image
shutil.copy(full_path, intro_assets_path)
# Copy and rename image
shutil.copy(full_path, intro_assets_path)


@app.route("/url1/event/today.xml")
Expand Down
Loading