Changeset 834bcc3 in Klonkt for scripts


Ignore:
Timestamp:
06/23/2026 06:14:27 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
d774679
Parents:
bb42dfb
Message:

i18n: translate Dutch code comments to English across src/

Comments in routes/services/views/config/middleware/assets translated to
English for the public repo. A few dev-facing throw/console message strings
were Englished too. No user-facing UI strings or i18n dictionary values changed
(src/services/i18n.js untouched). Logic unchanged.

Co-Authored-By: Claude <noreply@…>

Location:
scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • scripts/backfill-durations.mjs

    rbb42dfb r834bcc3  
    11#!/usr/bin/env node
    22/**
    3  * Backfill audio_tracks.duration voor bestaande tracks die nog géén duur hebben.
    4  * Leest de duur uit het mp3-bestand via ffmpeg (probeDuration — geen aparte
    5  * ffprobe-binary nodig). Idempotent: pakt alleen rijen met duration NULL of 0,
    6  * dus veilig herhaalbaar.
     3 * Backfill audio_tracks.duration for existing tracks that have no duration yet.
     4 * Reads the duration from the mp3 file via ffmpeg (probeDuration — no separate
     5 * ffprobe binary required). Idempotent: only touches rows with duration NULL or 0,
     6 * so it is safe to run repeatedly.
    77 *
    88 *   npm run backfill:durations
    99 *
    10  * Respecteert AUDIO_PATH (env) net als de upload-route.
     10 * Respects AUDIO_PATH (env) just like the upload route.
    1111 */
    1212import path from 'path';
     
    2121);
    2222
    23 // storage_path is absoluut (opgeslagen bij upload); val terug op AUDIO_DIR/filename.
     23// storage_path is absolute (stored at upload time); fall back to AUDIO_DIR/filename.
    2424function resolveFile(t) {
    2525  const candidates = [t.storage_path, t.filename ? path.join(AUDIO_DIR, t.filename) : null].filter(Boolean);
    2626  for (const c of candidates) {
    27     try { if (fs.statSync(c).isFile()) return c; } catch { /* volgende kandidaat */ }
     27    try { if (fs.statSync(c).isFile()) return c; } catch { /* try next candidate */ }
    2828  }
    2929  return null;
  • scripts/reset-admin.mjs

    rbb42dfb r834bcc3  
    11#!/usr/bin/env node
    2 // Break-glass: reset (of zet) het wachtwoord van een beheerder. Werkt altijd,
    3 // zonder e-mail — de self-hoster heeft immers shell-/servertoegang.
     2// Break-glass: reset (or set) the password of an admin account. Always works,
     3// no email required — the self-hoster has shell/server access.
    44//
    5 // Gebruik:
    6 //   npm run reset-admin                       # reset de (eerste) god-user, print nieuw wachtwoord
    7 //   npm run reset-admin -- <user|email>       # reset specifieke user, print nieuw wachtwoord
    8 //   npm run reset-admin -- <user|email> <pw>  # zet een gekozen wachtwoord
     5// Usage:
     6//   npm run reset-admin                       # reset the (first) god user, print new password
     7//   npm run reset-admin -- <user|email>       # reset a specific user, print new password
     8//   npm run reset-admin -- <user|email> <pw>  # set a chosen password
    99//
    10 // Draai dit vanuit de projectroot zodat DATABASE_PATH/.env correct geladen wordt.
     10// Run from the project root so DATABASE_PATH/.env is loaded correctly.
    1111
    1212import 'dotenv/config';
     
    2222  user = db.prepare('SELECT * FROM users WHERE username = ? OR LOWER(email) = LOWER(?)').get(arg, arg);
    2323} else {
    24   // Geen arg: pak de beheerder (god of admin), anders de allereerste user.
     24  // No arg: pick the admin (god or admin role), otherwise the very first user.
    2525  user =
    2626    db.prepare("SELECT * FROM users WHERE role IN ('god','admin') ORDER BY created_at LIMIT 1").get() ||
Note: See TracChangeset for help on using the changeset viewer.