fixed merge conflicts

This commit is contained in:
2025-06-12 11:32:37 +02:00
47 changed files with 535 additions and 669 deletions

View File

@@ -0,0 +1,17 @@
import { client } from '$lib/minio';
export default async function caseNumberOccupied (caseNumber: string): Promise<boolean> {
const prefix = `${caseNumber}/config.json`;
const promise: Promise<boolean> = new Promise((resolve) => {
const stream = client.listObjectsV2('tatort', prefix, false, '');
stream.on('data', () => {
stream.destroy();
resolve(true);
});
stream.on('end', () => {
resolve(false);
});
});
return promise;
}

View File

@@ -2,12 +2,7 @@ const KILO = 1024;
const MEGA = KILO * KILO;
const GIGA = MEGA * KILO;
/**
* Shortens the size in bytes
* @param {number} size
* @returns{string}
*/
export default function shortenFileSize(size) {
export default function shortenFileSize(size: number): string {
const giga = Math.floor(size / GIGA);
let remainder = size % GIGA;
const mega = Math.floor(remainder / MEGA);

View File

@@ -4,12 +4,7 @@ const DAY = 24 * HOUR;
const YEAR = 365 * DAY;
const MONTH = YEAR / 12;
/**
* get readable string of time elapsed since date
* @param {Date} date
* @returns string
*/
export default function timeElapsed(date) {
export default function timeElapsed(date: Date): string {
const now = new Date();
const age = Math.floor((now.getTime() - date.getTime()) / 1000);