mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat: add TREND_LANGUAGES environment variable
This commit is contained in:
parent
4da82e9484
commit
b33a6cdfe0
1 changed files with 5 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
|
import ISO6391, { LanguageCode } from 'iso-639-1';
|
||||||
import * as dotenv from '@std/dotenv';
|
import * as dotenv from '@std/dotenv';
|
||||||
import { getPublicKey, nip19 } from 'nostr-tools';
|
import { getPublicKey, nip19 } from 'nostr-tools';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
@ -247,6 +248,10 @@ class Conf {
|
||||||
static get zapSplitsEnabled(): boolean {
|
static get zapSplitsEnabled(): boolean {
|
||||||
return optionalBooleanSchema.parse(Deno.env.get('ZAP_SPLITS_ENABLED')) ?? false;
|
return optionalBooleanSchema.parse(Deno.env.get('ZAP_SPLITS_ENABLED')) ?? false;
|
||||||
}
|
}
|
||||||
|
/** Filter trends by languages. */
|
||||||
|
static get trendLanguages(): LanguageCode[] | undefined {
|
||||||
|
return Deno.env.get('TREND_LANGUAGES')?.split(',')?.filter(ISO6391.validate) as LanguageCode[];
|
||||||
|
}
|
||||||
/** Cache settings. */
|
/** Cache settings. */
|
||||||
static caches = {
|
static caches = {
|
||||||
/** NIP-05 cache settings. */
|
/** NIP-05 cache settings. */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue