mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 05:38:09 -05:00
Simplify comments
This commit is contained in:
@@ -3,12 +3,10 @@ import type { TablesInsertable } from "~/db/tables";
|
||||
import { databaseTimestampNow } from "~/utils/dates";
|
||||
import { concatUserSubmittedImagePrefix } from "~/utils/kysely.server";
|
||||
|
||||
/** Number of seconds an external stream keeps showing in the sidebar after its start time. */
|
||||
const SIDEBAR_VISIBLE_SECONDS = 6 * 60 * 60;
|
||||
/** Number of seconds after the start time before an external stream row is deleted. */
|
||||
const RETENTION_SECONDS = 24 * 60 * 60;
|
||||
|
||||
/** Inserts a new admin-curated external stream. */
|
||||
/** Inserts an admin-curated external stream. */
|
||||
export function insert(
|
||||
args: Pick<
|
||||
TablesInsertable["ExternalStream"],
|
||||
@@ -23,7 +21,7 @@ export function deleteById(id: number) {
|
||||
return db.deleteFrom("ExternalStream").where("id", "=", id).execute();
|
||||
}
|
||||
|
||||
/** Lists all external streams (for the admin management page), soonest start time first. */
|
||||
/** All external streams, soonest first. */
|
||||
export function findAll() {
|
||||
return db
|
||||
.selectFrom("ExternalStream")
|
||||
@@ -45,7 +43,7 @@ export function findAll() {
|
||||
.execute();
|
||||
}
|
||||
|
||||
/** External streams that should currently show in the sidebar (started under 6h ago or upcoming). */
|
||||
/** Streams started under 6h ago or upcoming. */
|
||||
export function findAllForSidebar() {
|
||||
return db
|
||||
.selectFrom("ExternalStream")
|
||||
@@ -71,7 +69,7 @@ export function findAllForSidebar() {
|
||||
.execute();
|
||||
}
|
||||
|
||||
/** Deletes external streams whose start time is more than 24h in the past. */
|
||||
/** Deletes streams that started over 24h ago. */
|
||||
export function deleteOld() {
|
||||
return db
|
||||
.deleteFrom("ExternalStream")
|
||||
|
||||
Reference in New Issue
Block a user