JoeKennedy / fantasy

A Fantasy League Of Ice And Fire
6 stars 0 forks source link

Create week data when the associated episode is created #42

Open JoeKennedy opened 7 years ago

JoeKennedy commented 7 years ago

This will have a few potential benefits:

  1. airEpisode will only be necessary for marking an episode "Airing"; when determining the current week, just use the air date of the episode, rather than grabbing the most recent week. There could probably be some helper functions here, like getCurrentEpisode and getCurrentWeek.
  2. I can create the episodes whenever, because I wouldn't have to worry about them being created after a certain time.
  3. We can grab the current performance for each player to accurately show their current cumulative points, i.e. the points they've scored in the last (for this season) seven scored weeks. This might help further explain the weighted points system, and plus, more numbers!
  4. Lineups no longer need to be sealed by airEpisode running and functioning properly, just use getCurrentWeek to determine which week to use for starting, benching, claiming, etc. players.