🚨 Fixed deepsource issues

This commit is contained in:
Mawoka
2023-06-30 18:55:13 +02:00
parent 3a2ab6c64b
commit 3e6e367ed0
10 changed files with 9 additions and 10 deletions
-1
View File
@@ -128,7 +128,6 @@ async def meilisearch_init():
for i in meilisearch.index(settings.meilisearch_index).get_stats(): for i in meilisearch.index(settings.meilisearch_index).get_stats():
number_of_docs = i[1]["numberOfDocuments"] number_of_docs = i[1]["numberOfDocuments"]
break break
# if meilisearch.index(settings.meilisearch_index).get_stats()["numberOfDocuments"] != quiz_count:
if number_of_docs != quiz_count: if number_of_docs != quiz_count:
print("MeiliSearch and Database got out of sync, syncthing them") print("MeiliSearch and Database got out of sync, syncthing them")
meilisearch.delete_index(settings.meilisearch_index) meilisearch.delete_index(settings.meilisearch_index)
+1 -1
View File
@@ -28,7 +28,7 @@ module.exports = {
// Put a blank string as initial translation // Put a blank string as initial translation
// (useful for Weblate be marked as 'not yet translated', see later) // (useful for Weblate be marked as 'not yet translated', see later)
defaultValue: (lng, ns, key) => '', defaultValue: () => '',
// Location of translation files // Location of translation files
resource: { resource: {
+1 -2
View File
@@ -37,8 +37,7 @@ export const getWinnersSorted = (
if (q_res === null) { if (q_res === null) {
continue; continue;
} }
for (let j = 0; j < q_res.length; j++) { for (const res of q_res) {
const res = q_res[j];
if (res['right']) { if (res['right']) {
if (winners[res['username']] === undefined) { if (winners[res['username']] === undefined) {
winners[res['username']] = 0; winners[res['username']] = 0;
@@ -29,6 +29,7 @@ export class I18NextTranslationService implements TranslationService {
// 2. Create a new set function that changes the i18n locale. // 2. Create a new set function that changes the i18n locale.
// 3. Create a new update function that changes the i18n locale. // 3. Create a new update function that changes the i18n locale.
// 4. Return modified writable. // 4. Return modified writable.
// skipcq: JS-0105
private createLocale(i18n: I18nService) { private createLocale(i18n: I18nService) {
const { subscribe, set, update } = writable<string>(i18n.i18n.language); const { subscribe, set, update } = writable<string>(i18n.i18n.language);
+1 -1
View File
@@ -6,7 +6,7 @@
import { signedIn } from '$lib/stores'; import { signedIn } from '$lib/stores';
import type { LayoutLoad } from './$types'; import type { LayoutLoad } from './$types';
export const load: LayoutLoad = async ({ data }) => { export const load: LayoutLoad = ({ data }) => {
const { email } = data; const { email } = data;
if (email) { if (email) {
signedIn.set(true); signedIn.set(true);
@@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
export async function load({ url }) { export function load({ url }) {
const error = url.searchParams.get('error'); const error = url.searchParams.get('error');
return { return {
error error
@@ -2,7 +2,7 @@
// //
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
export async function load({ url }) { export function load({ url }) {
const token = url.searchParams.get('token'); const token = url.searchParams.get('token');
return { return {
+1 -1
View File
@@ -18,6 +18,6 @@ export async function load({ parent, url }) {
return { return {
game_pin: pin === null ? '' : pin, game_pin: pin === null ? '' : pin,
game_token: token === null ? '' : token, game_token: token === null ? '' : token,
auto_connect: auto_connect auto_connect
}; };
} }
+1 -1
View File
@@ -4,7 +4,7 @@
import type { RequestHandler } from '@sveltejs/kit'; import type { RequestHandler } from '@sveltejs/kit';
export const GET: RequestHandler = async () => { export const GET: RequestHandler = () => {
return new Response(undefined, { return new Response(undefined, {
status: 301, status: 301,
headers: { headers: {
@@ -13,7 +13,7 @@ export const load = async ({ params, parent }) => {
} else if (res.status === 200) { } else if (res.status === 200) {
const quiz = await res.json(); const quiz = await res.json();
return { return {
quiz: quiz, quiz,
logged_in: Boolean(email) logged_in: Boolean(email)
}; };
} else { } else {