You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/routes/getUserInfo.ts
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ async function dbGetSubmittedSegmentSummary(userID: HashedUserID): Promise<{ min
28
28
segmentCount: 0,
29
29
};
30
30
}
31
-
}catch(err){
31
+
}catch(err)/* istanbul ignore next */{
32
32
returnnull;
33
33
}
34
34
}
@@ -37,7 +37,7 @@ async function dbGetIgnoredSegmentCount(userID: HashedUserID): Promise<number> {
37
37
try{
38
38
constrow=awaitdb.prepare("get",`SELECT COUNT(*) as "ignoredSegmentCount" FROM "sponsorTimes" WHERE "userID" = ? AND ( "votes" <= -2 OR "shadowHidden" = 1 )`,[userID],{useReplica: true});
39
39
returnrow?.ignoredSegmentCount??0;
40
-
}catch(err){
40
+
}catch(err)/* istanbul ignore next */{
41
41
returnnull;
42
42
}
43
43
}
@@ -46,7 +46,7 @@ async function dbGetUsername(userID: HashedUserID) {
46
46
try{
47
47
constrow=awaitdb.prepare("get",`SELECT "userName" FROM "userNames" WHERE "userID" = ?`,[userID]);
48
48
returnrow?.userName??userID;
49
-
}catch(err){
49
+
}catch(err)/* istanbul ignore next */{
50
50
returnfalse;
51
51
}
52
52
}
@@ -55,7 +55,7 @@ async function dbGetViewsForUser(userID: HashedUserID) {
55
55
try{
56
56
constrow=awaitdb.prepare("get",`SELECT SUM("views") as "viewCount" FROM "sponsorTimes" WHERE "userID" = ? AND "votes" > -2 AND "shadowHidden" != 1`,[userID],{useReplica: true});
57
57
returnrow?.viewCount??0;
58
-
}catch(err){
58
+
}catch(err)/* istanbul ignore next */{
59
59
returnfalse;
60
60
}
61
61
}
@@ -64,7 +64,7 @@ async function dbGetIgnoredViewsForUser(userID: HashedUserID) {
64
64
try{
65
65
constrow=awaitdb.prepare("get",`SELECT SUM("views") as "ignoredViewCount" FROM "sponsorTimes" WHERE "userID" = ? AND ( "votes" <= -2 OR "shadowHidden" = 1 )`,[userID],{useReplica: true});
66
66
returnrow?.ignoredViewCount??0;
67
-
}catch(err){
67
+
}catch(err)/* istanbul ignore next */{
68
68
returnfalse;
69
69
}
70
70
}
@@ -73,7 +73,7 @@ async function dbGetWarningsForUser(userID: HashedUserID): Promise<number> {
73
73
try{
74
74
constrow=awaitdb.prepare("get",`SELECT COUNT(*) as total FROM "warnings" WHERE "userID" = ? AND "enabled" = 1`,[userID],{useReplica: true});
75
75
returnrow?.total??0;
76
-
}catch(err){
76
+
}catch(err)/* istanbul ignore next */{
77
77
Logger.error(`Couldn't get warnings for user ${userID}. returning 0`);
78
78
return0;
79
79
}
@@ -83,7 +83,7 @@ async function dbGetLastSegmentForUser(userID: HashedUserID): Promise<SegmentUUI
83
83
try{
84
84
constrow=awaitdb.prepare("get",`SELECT "UUID" FROM "sponsorTimes" WHERE "userID" = ? ORDER BY "timeSubmitted" DESC LIMIT 1`,[userID],{useReplica: true});
85
85
returnrow?.UUID??null;
86
-
}catch(err){
86
+
}catch(err)/* istanbul ignore next */{
87
87
returnnull;
88
88
}
89
89
}
@@ -92,7 +92,7 @@ async function dbGetActiveWarningReasonForUser(userID: HashedUserID): Promise<st
92
92
try{
93
93
constrow=awaitdb.prepare("get",`SELECT reason FROM "warnings" WHERE "userID" = ? AND "enabled" = 1 ORDER BY "issueTime" DESC LIMIT 1`,[userID],{useReplica: true});
94
94
returnrow?.reason??"";
95
-
}catch(err){
95
+
}catch(err)/* istanbul ignore next */{
96
96
Logger.error(`Couldn't get reason for user ${userID}. returning blank`);
97
97
return"";
98
98
}
@@ -102,7 +102,7 @@ async function dbGetBanned(userID: HashedUserID): Promise<boolean> {
102
102
try{
103
103
constrow=awaitdb.prepare("get",`SELECT count(*) as "userCount" FROM "shadowBannedUsers" WHERE "userID" = ? LIMIT 1`,[userID],{useReplica: true});
0 commit comments