Skip to content

Commit

Permalink
Add error message and cleanup CurrentlyRolling flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheemap committed Feb 15, 2020
1 parent 29b9273 commit 53dc5ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@ typings/
data/

# Dist folder
dist/
dist/

.vscode
9 changes: 9 additions & 0 deletions src/commands/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ function GetSettingsFromArgs(chanConfig: ChannelConfig, args: string[]) {
if (isNaN(min)) {
errors.push(a);
errors.push(args[args.indexOf(a) + 1]);
} else if (min > 0) {
errors.push(a);
errors.push("Minimum points must be less than than 1");
}
chanConfig.MinimumPoints = min;
break;
Expand Down Expand Up @@ -518,3 +521,9 @@ knex.schema.hasTable("MediaVote").then(exists => {
});
}
});

// Cleanup any flags left set
knex<ChannelConfig>("ChannelConfig")
.update("CurrentlyRolling", 0)
.where("CurrentlyRolling", 1)
.then(() => {});

0 comments on commit 53dc5ee

Please sign in to comment.