project-slippi / slippi-launcher

The way to play Slippi Online and watch replays.
GNU General Public License v3.0
244 stars 125 forks source link

Add ReplayProvider and FileSystemReplayProvider #397

Closed vinceau closed 11 months ago

vinceau commented 11 months ago

Description

This PR adds a FileSystemReplayProvider which implements the ReplayProvider interface. We do this in preparation for adding a provider which can fetch and store from the database rather than the filesystem.

We primarily want to avoid returning slippi-js types directly as it complicates the logic for what we need to store in the database. Instead, upon computing the SlippiGame info and stats, we only send to the frontend what is required for rendering the replay browser. For now, we still send the entire stats object for rendering the stats page, but we can revisit that later on when the database is complete.