Skip to content

Commit

Permalink
Merge branch 'override-flo-tv-delay' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxu committed Nov 3, 2023
2 parents f6a32c9 + 5b36878 commit 3b7265f
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions binaries/flo-stats-service/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,24 @@ impl MutationRoot {
return Err(Error::new("Can not stream a private game."));
}

let mut delay_secs = if let Some(value) = delay_secs {
let mut delay_secs_unwrapped = if game.is_live { 0 } else { 180 };

if let Some(secs) = game.flo_tv_delay_override_secs.clone() {
delay_secs_unwrapped = secs as i64
}

if let Some(value) = delay_secs {
if data.is_admin {
value as i64
delay_secs_unwrapped = value as i64;
} else {
return Err(Error::new("Only admin can specify delay value."));
}
} else {
if game.is_live {
0
} else {
180
}
};

if let Some(secs) = game.flo_tv_delay_override_secs.clone() {
delay_secs = secs as i64
}

let delay_secs = if delay_secs == 0 {
let delay_secs = if delay_secs_unwrapped == 0 {
None
} else {
Some(delay_secs)
Some(delay_secs_unwrapped)
};
Ok(ObserverTokenPayload {
game,
Expand Down

0 comments on commit 3b7265f

Please sign in to comment.