codersforcauses / codersforcauses/game-dev

Add components for extra media on different pages

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority::low Requires MVP completion
Dominant language
TypeScript
Stars
7
Forks
4
PR merge metrics
No merged PRs in 30d

Description

This feature depends on MVP being completed, so don't start this yet!

The site would feel a lot more polished if we added collections of media to several different pages. Specifically:
* Individual game pages should feature a carousel of gameplay screenshots/videos, a bit like how it's done on steam
* Individual member pages should feature either the same carousel or some other structure for displaying a gallery of images

To do this, we should have a media table and some additional bridging tables to games and members, like:

Media Model
* varchar media_path (pk and fk)
* varchar alt_text (optionally null)
* enum filetype # 0 for raster images (png, jpeg, etc), 1 for svgs/vectors, 2 for videos

GameMedia Model
* varchar media_path (pk and fk)
* uuid game_id (fk)

MemberMedia Model
* varchar media_path (pk and fk)
* uuid member_id (fk)

and additional bridging tables if we decide to add more media to other pages.

While we trust the committee of the gamedev club at uwa, it's probably a good idea to do some checks on the media first, like:
* Basic serialiser validation on the path supplied (does the path exist? will this path escape from the media folder and into somewhere it shouldn't be?)
* `python-magic` to spot mismatches between the magic numbers inside the actual binary and the magic numbers expected for this file extension, and to infer the appropriate filetype enum.
If these cases pass, we can insert the path and inferred filetype enum into into the database, and store the file on the machine's filesystem

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.