Merge pull request #197 from ajayyy/work

Don't hide submissions from locked videos when banning
This commit is contained in:
Ajay Ramachandran 2020-12-23 00:24:35 -05:00 committed by GitHub
commit 5c4980ed2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,9 @@ export async function shadowBanUser(req: Request, res: Response) {
//find all previous submissions and hide them
if (unHideOldSubmissions) {
db.prepare('run', "UPDATE sponsorTimes SET shadowHidden = 1 WHERE userID = ?", [userID]);
db.prepare('run', "UPDATE sponsorTimes SET shadowHidden = 1 WHERE userID = ?"
+ " AND NOT EXISTS ( SELECT videoID, category FROM noSegments WHERE"
+ " sponsorTimes.videoID = noSegments.videoID AND sponsorTimes.category = noSegments.category)", [userID]);
}
} else if (!enabled && row.userCount > 0) {
//remove them from the shadow ban list